-
Notifications
You must be signed in to change notification settings - Fork 27
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
fix(starknet_integration_tests): fix config when creating multiple nodes #2426
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2426 +/- ##
==========================================
- Coverage 40.10% 34.10% -6.01%
==========================================
Files 26 276 +250
Lines 1895 32153 +30258
Branches 1895 32153 +30258
==========================================
+ Hits 760 10965 +10205
- Misses 1100 20200 +19100
- Partials 35 988 +953 ☔ View full report in Codecov by Sentry. |
f5f4085
to
52e4c23
Compare
643f20c
to
11245e1
Compare
63ba0b3
to
9d45367
Compare
11245e1
to
2664cd6
Compare
9d45367
to
bafa090
Compare
2664cd6
to
9ac2853
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 3 of 4 files at r1, all commit messages.
Reviewable status: 3 of 4 files reviewed, 5 unresolved discussions (waiting on @Itay-Tsabary-Starkware and @yair-starkware)
crates/starknet_integration_tests/src/utils.rs
line 39 at r1 (raw file):
// Currently the orchestrator expects the sequencer addresses in the form of [0..n_sequencers). // TODO(yair): Change this offset to be a non-zero value once the orchestrator is updated. pub const SEQUENCER_ADDRESS_OFFSET: usize = 0;
Shouldn't this be 100?
Suggestion:
pub const SEQUENCER_ADDRESS_OFFSET: usize = 100;
crates/starknet_integration_tests/src/utils.rs
line 66 at r1 (raw file):
let mempool_p2p_config = create_mempool_p2p_config(sequencer_id, chain_info.chain_id.clone()); let monitoring_endpoint_config = create_monitoring_endpoint_config(sequencer_id); let sequencer_address = create_sequencer_address(sequencer_id);
Use this to set validator id in config.
Code quote:
let sequencer_address = create_sequencer_address(sequencer_id);
crates/starknet_integration_tests/src/utils.rs
line 282 at r1 (raw file):
config.port += u16::try_from(sequencer_id).unwrap(); config }
@ShahakShama can you ptal at this?
Code quote:
fn create_mempool_p2p_config(sequencer_id: usize, chain_id: ChainId) -> MempoolP2pConfig {
let mut config = MempoolP2pConfig::default();
// When running multiple sequencers on the same machine, we need to make sure their ports are
// different. Use the sequencer_id to differentiate between them.
config.network_config.tcp_port += u16::try_from(sequencer_id).unwrap();
config.network_config.quic_port += u16::try_from(sequencer_id).unwrap();
config.network_config.chain_id = chain_id;
config
}
fn create_monitoring_endpoint_config(sequencer_id: usize) -> MonitoringEndpointConfig {
let mut config = MonitoringEndpointConfig::default();
config.port += u16::try_from(sequencer_id).unwrap();
config
}
crates/starknet_sequencer_node/src/config/node_config.rs
line 86 at r1 (raw file):
"The sequencer address.", ), // TODO(Matan): make validator id of consensus point to the sequencer address.
We are removing the sequencer address from the block builder config. You can remove the TODO.
crates/starknet_integration_tests/src/integration_test_setup.rs
line 61 at r1 (raw file):
// Derive the configuration for the sequencer node. let (config, required_params) = create_config( SEQUENCER_ID,
It's confusing that this is an index while validator id is a contract address. Can you change everywhere to differentiate?
use index
or number
instead of id
Code quote:
SEQUENCER_ID
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 1 of 4 files at r1.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @Itay-Tsabary-Starkware and @yair-starkware)
20734a2
to
60b70c2
Compare
9ac2853
to
5724ec3
Compare
5724ec3
to
04595ed
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: 1 of 4 files reviewed, 5 unresolved discussions (waiting on @alonh5 and @Itay-Tsabary-Starkware)
crates/starknet_integration_tests/src/integration_test_setup.rs
line 61 at r1 (raw file):
Previously, alonh5 (Alon Haramati) wrote…
It's confusing that this is an index while validator id is a contract address. Can you change everywhere to differentiate?
useindex
ornumber
instead ofid
Done.
crates/starknet_integration_tests/src/utils.rs
line 39 at r1 (raw file):
Previously, alonh5 (Alon Haramati) wrote…
Shouldn't this be 100?
Code moved
crates/starknet_integration_tests/src/utils.rs
line 66 at r1 (raw file):
Previously, alonh5 (Alon Haramati) wrote…
Use this to set validator id in config.
No need to create sequencer address anymore
crates/starknet_sequencer_node/src/config/node_config.rs
line 86 at r1 (raw file):
Previously, alonh5 (Alon Haramati) wrote…
We are removing the sequencer address from the block builder config. You can remove the TODO.
Done.
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 2 of 3 files at r2, 2 of 2 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Itay-Tsabary-Starkware and @yair-starkware)
crates/starknet_integration_tests/src/utils.rs
line 256 at r3 (raw file):
// When running multiple sequencers on the same machine, we need to make sure their ports are // different. Use the sequencer_index to differentiate between them. config.network_config.tcp_port += u16::try_from(sequencer_index).unwrap();
Can we ensure or assert that the ports aren't colliding?
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: all files reviewed, 1 unresolved discussion (waiting on @alonh5 and @Itay-Tsabary-Starkware)
crates/starknet_integration_tests/src/utils.rs
line 256 at r3 (raw file):
Previously, alonh5 (Alon Haramati) wrote…
Can we ensure or assert that the ports aren't colliding?
It will be checked at the node's startup.
04595ed
to
08adc42
Compare
60b70c2
to
81c7a4c
Compare
08adc42
to
b1ee806
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 2 of 2 files at r4, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Itay-Tsabary-Starkware and @yair-starkware)
crates/starknet_integration_tests/src/utils.rs
line 261 at r4 (raw file):
// different. Use the sequencer_index to differentiate between them. config.network_config.tcp_port += u16::try_from(sequencer_index).unwrap(); config.network_config.quic_port += u16::try_from(sequencer_index).unwrap();
The quic port is configured to be 1 over the tcp port, so the first node's quic port collides with the second's tcp port.
Shahak told me the quic port isn't currently used, which is why this doesn't fail, and they will remove it. Jusy an FYI
b1ee806
to
a9e9690
Compare
a9e9690
to
a4dc64d
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 1 of 1 files at r5, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Itay-Tsabary-Starkware and @yair-starkware)
No description provided.