-
Notifications
You must be signed in to change notification settings - Fork 30
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(consensus): add config to Context #3268
base: main
Are you sure you want to change the base?
Conversation
83fa23c
to
4afa386
Compare
147811a
to
f6cb2c3
Compare
160be43
to
56db437
Compare
f6cb2c3
to
d94f865
Compare
56db437
to
53b29cd
Compare
d94f865
to
174e78f
Compare
53b29cd
to
14cc693
Compare
174e78f
to
6df7549
Compare
3010128
to
4c6ccd6
Compare
Artifacts upload workflows: |
4c6ccd6
to
7878ee6
Compare
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.
Reviewed 8 of 8 files at r1, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @dan-starkware, @giladchase, and @guy-starkware)
crates/papyrus_node/src/config/mod.rs
line 12 at r1 (raw file):
use std::ops::IndexMut; use std::path::{Path, PathBuf}; use std::task::Context;
unused right?
crates/papyrus_node/src/config/mod.rs
line 69 at r1 (raw file):
pub p2p_sync: Option<P2pSyncClientConfig>, pub consensus: Option<ConsensusConfig>, pub context: ContextConfig,
make it optional, and apply the relevant changes
Suggestion:
pub context: Option<ContextConfig>,
crates/sequencing/papyrus_consensus/src/types.rs
line 35 at r1 (raw file):
/// Configuration for the Context struct. #[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Validate)] pub struct ContextConfig {
why not adding it to the context dir?
crates/sequencing/papyrus_consensus/src/types.rs
line 41 at r1 (raw file):
pub num_validators: u64, /// The chain id of the Starknet chain. pub chain_id: ChainId,
both num_validators and chain_id are part of the consensus config and are passed to the context. I suggest either removing them now or adding a TODO to complete the concept within the PR.
also to add batcher_build_buffer when its used (if we still want to add it to the config since the papyrus context doesn't interact with the batcher)
crates/sequencing/papyrus_consensus_orchestrator/src/papyrus_consensus_context_test.rs
line 145 at r1 (raw file):
let papyrus_context = PapyrusConsensusContext::new( ContextConfig::default(),
by default its 1 not 4.. tests are safe :)
7878ee6
to
41718f0
Compare
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.
Reviewable status: 3 of 9 files reviewed, 4 unresolved discussions (waiting on @asmaastarkware, @dan-starkware, and @giladchase)
crates/papyrus_node/src/config/mod.rs
line 12 at r1 (raw file):
Previously, asmaastarkware (asmaa-starkware) wrote…
unused right?
yes! I wonder why clippy didn't see that...
crates/papyrus_node/src/config/mod.rs
line 69 at r1 (raw file):
Previously, asmaastarkware (asmaa-starkware) wrote…
make it optional, and apply the relevant changes
Done.
crates/sequencing/papyrus_consensus/src/types.rs
line 35 at r1 (raw file):
Previously, asmaastarkware (asmaa-starkware) wrote…
why not adding it to the context dir?
I'm not really happy about having it in types.rs
either.
I think I should do a PR at the end of the stack where I move the ContextConfig to another place. I'm not sure where it will be, if you have a place you think is right, let me know.
crates/sequencing/papyrus_consensus/src/types.rs
line 41 at r1 (raw file):
Previously, asmaastarkware (asmaa-starkware) wrote…
both num_validators and chain_id are part of the consensus config and are passed to the context. I suggest either removing them now or adding a TODO to complete the concept within the PR.
also to add batcher_build_buffer when its used (if we still want to add it to the config since the papyrus context doesn't interact with the batcher)
I added a TODO. This happens in another PR on this stack.
crates/sequencing/papyrus_consensus_orchestrator/src/papyrus_consensus_context_test.rs
line 145 at r1 (raw file):
Previously, asmaastarkware (asmaa-starkware) wrote…
by default its 1 not 4.. tests are safe :)
I think I had an issue with the number of validators in one of the tests in the next PRs. I don't remember exactly.
Adds a ContextConfig struct that is used by the two context structs.