-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: scan base node for constitutions #4144
feat: scan base node for constitutions #4144
Conversation
3b79322
to
1b29357
Compare
I'm trying to write a feature spec for this but javascript. So I'm moving it into review in the meantime. |
lol the pain 😩 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments, but they can be addressed later
|
||
let mut handler = self.node_service.clone(); | ||
let (mut sender, receiver) = mpsc::channel(50); | ||
task::spawn(async move { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I wonder if it would be better to retrieve all the constitutions first, then spawn a task. That way you'd know what size to make the channel
@@ -99,6 +100,22 @@ impl BaseNodeClient for GrpcBaseNodeClient { | |||
Ok(output) | |||
} | |||
|
|||
async fn check_for_constitutions_for_me( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably better to call this get_constitutions
to keep it predictable
// info!(target: LOG_TARGET, "The request was aborted, {}", err); | ||
// break; | ||
// } | ||
_test += 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol
@@ -129,6 +154,7 @@ impl<TServiceSpecification: ServiceSpecification + 'static> rpc::validator_node_ | |||
&self, | |||
request: Request<rpc::InvokeReadMethodRequest>, | |||
) -> Result<Response<rpc::InvokeReadMethodResponse>, Status> { | |||
println!("invoke_read_method grpc call"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to use info!
etc, at some point all of these println
's should be replaced
dan_node_public_key: &PublicKey, | ||
) -> Result<Vec<TransactionOutput>, ChainStorageError> { | ||
let txn = self.read_transaction()?; | ||
lmdb_filter_map_values(&txn, &self.utxos_db, |output: TransactionOutputRowData| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine for now, but we'll need to index this in the future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally. I've made a note about the constitutions index for later but was less worried about it for the moment.
Description
Check for constitutions that the VN is part of.
Motivation and Context
For a VN to become part of a committee or help manage constitutions it must be able to find relevant constitutions it is a member, or proposed member of.
How Has This Been Tested?
It hasn't but it will be, and if this text is still here then maybe don't merge it yet.