Skip to content
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

Merged

Conversation

brianp
Copy link
Contributor

@brianp brianp commented May 27, 2022

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.

@brianp brianp changed the title Constitution acceptance feat: scan base node for constitutions May 27, 2022
@brianp brianp force-pushed the constitution-acceptance branch from 3b79322 to 1b29357 Compare May 27, 2022 09:17
@brianp
Copy link
Contributor Author

brianp commented May 27, 2022

I'm trying to write a feature spec for this but javascript. So I'm moving it into review in the meantime.

@brianp brianp marked this pull request as ready for review May 27, 2022 10:35
@delta1
Copy link
Contributor

delta1 commented May 27, 2022

I'm trying to write a feature spec for this but javascript.

lol the pain 😩

Copy link
Collaborator

@stringhandler stringhandler left a 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 {
Copy link
Collaborator

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(
Copy link
Collaborator

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;
Copy link
Collaborator

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");
Copy link
Collaborator

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| {
Copy link
Collaborator

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

Copy link
Contributor Author

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.

@aviator-app aviator-app bot added mq-failed and removed mq-failed labels May 27, 2022
@stringhandler stringhandler merged commit 310a2d2 into tari-project:development May 27, 2022
@brianp brianp deleted the constitution-acceptance branch February 13, 2023 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants