Skip to content

Commit

Permalink
fix(ethexe): multiple validators test fix (#4256)
Browse files Browse the repository at this point in the history
  • Loading branch information
grishasobol authored Sep 25, 2024
1 parent 2658dc3 commit 33130a6
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ethexe/cli/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,10 @@ impl Service {
.map(BlockCommitmentValidationRequest::from)
.collect();

if block_requests.is_empty() && code_requests.is_empty() {
return Ok(());
}

if let Some(network_sender) = maybe_network_sender {
log::debug!("Request validation of aggregated commitments...");

Expand Down
3 changes: 2 additions & 1 deletion ethexe/cli/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,8 @@ async fn multiple_validators() {
let mut validator2 = env.new_node(
NodeConfig::default()
.validator(env.validators[2])
.network(None, sequencer.multiaddr.clone()),
.network(None, sequencer.multiaddr.clone())
.db(validator2.db),
);
validator2.start_service().await;

Expand Down
3 changes: 3 additions & 0 deletions ethexe/network/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ impl NetworkSender {
(Self { tx }, rx)
}

// TODO: consider to append salt here to be sure that message is unique.
// This is important for the cases of malfunctions in ethexe, when the same message
// needs to be sent again #4255
pub fn publish_message(&self, data: impl Into<Vec<u8>>) {
let _res = self
.tx
Expand Down
4 changes: 4 additions & 0 deletions ethexe/sequencer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ impl Sequencer {
&mut self,
aggregated: AggregatedCommitments<CodeCommitment>,
) -> Result<()> {
log::debug!("Received code commitments: {aggregated:?}");

Self::receive_commitments(
aggregated,
&self.validators,
Expand All @@ -207,6 +209,8 @@ impl Sequencer {
&mut self,
aggregated: AggregatedCommitments<BlockCommitment>,
) -> Result<()> {
log::debug!("Received block commitments: {aggregated:?}");

Self::receive_commitments(
aggregated,
&self.validators,
Expand Down
2 changes: 2 additions & 0 deletions ethexe/validator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ impl Validator {
) -> Result<(Digest, Signature)> {
let mut commitment_digests = Vec::new();
for request in requests {
log::debug!("Receive code commitment for validation: {:?}", request);
commitment_digests.push(request.to_digest());
Self::validate_code_commitment(db, request)?;
}
Expand All @@ -119,6 +120,7 @@ impl Validator {
) -> Result<(Digest, Signature)> {
let mut commitment_digests = Vec::new();
for request in requests.into_iter() {
log::debug!("Receive block commitment for validation: {:?}", request);
commitment_digests.push(request.to_digest());
Self::validate_block_commitment(db, request)?;
}
Expand Down

0 comments on commit 33130a6

Please sign in to comment.