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

code: Failure to process commit certificate from ValueSync #854

Open
romac opened this issue Feb 14, 2025 · 0 comments
Open

code: Failure to process commit certificate from ValueSync #854

romac opened this issue Feb 14, 2025 · 0 comments
Labels
bug Something isn't working code Code/implementation related sync Synchronization protocols
Milestone

Comments

@romac
Copy link
Member

romac commented Feb 14, 2025

$ cargo nextest run -p informalsystems-malachitebft-starknet-test --no-capture  value_sync::crash_restart_from_start

The following error can be seen in the logs:

2025-02-14T08:33:51.578371Z  INFO test{id=1}:node{id=3}:node{moniker=node-3}:consensus{height=3 round=2}: Processing synced proposed value
2025-02-14T08:33:51.578552Z  INFO test{id=1}:node{id=3}:node{moniker=node-3}:consensus{height=3 round=2}:on_proposed_value{height=3 round=1 validity=Valid id=0x2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a}: Decided round=2 height=3 value=0x2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a
2025-02-14T08:33:51.578898Z DEBUG test{id=1}:node{id=3}: Event: ReceivedProposedValue(value: ProposedValue { height: Height { block_number: 3, fork_id: 0 }, round: Some(1), valid_round: Nil, proposer: Address(0x02db240d1e5be278ab077755ef2d8b93a8e4f655914f33e0ee7170c5c36bf0b2), value: 0x2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a, validity: Valid }, origin: Sync)
2025-02-14T08:33:51.581989Z  INFO test{id=1}:node{id=3}:node{moniker=node-3}:consensus{height=3 round=2}: Processing synced commit certificate
2025-02-14T08:33:51.582043Z ERROR test{id=1}:node{id=3}:node{moniker=node-3}:consensus{height=3 round=2}: Error when processing received synced block: Decided value not found after commit timeout height=3 request_id=3

The error is emitted here when processing the commit certificate.

The log in the last line would be better worded as Error when processing synced commit certificate.

Processing the synced value synchronously instead of asynchronously does not help:

diff --git a/code/crates/engine/src/consensus.rs b/code/crates/engine/src/consensus.rs
index 75f41427..258e5112 100644
--- a/code/crates/engine/src/consensus.rs
+++ b/code/crates/engine/src/consensus.rs
@@ -351,37 +351,44 @@ where
                         peer,
                         sync::Response::ValueResponse(ValueResponse { height, value }),
                     ) => {
-                        debug!(%height, %request_id, "Received sync response");
+                        debug!(%height, %request_id, "Received value sync response");
 
-                        let Some(value) = value else {
+                        let Some(raw_decided_value) = value else {
                             error!(%height, %request_id, "Received empty value sync response");
                             return Ok(());
                         };
 
-                        self.host.call_and_forward(
-                            |reply_to| HostMsg::ProcessSyncedValue {
-                                height: value.certificate.height,
-                                round: value.certificate.round,
+                        info!("Decoding proposed value from synced value");
+
+                        let proposed_value =
+                            ractor::call!(self.host, |reply_to| HostMsg::ProcessSyncedValue {
+                                height: raw_decided_value.certificate.height,
+                                round: raw_decided_value.certificate.round,
                                 validator_address: state.consensus.address().clone(),
-                                value_bytes: value.value_bytes.clone(),
+                                value_bytes: raw_decided_value.value_bytes.clone(),
                                 reply_to,
-                            },
-                            &myself,
-                            |proposed| {
-                                Msg::<Ctx>::ReceivedProposedValue(proposed, ValueOrigin::Sync)
-                            },
-                            None,
-                        )?;
+                            })?;
+
+                        info!("Processing synced proposed value");
+
+                        self.handle(
+                            myself.clone(),
+                            Msg::ReceivedProposedValue(proposed_value, ValueOrigin::Sync),
+                            state,
+                        )
+                        .await?;
@romac romac added bug Something isn't working code Code/implementation related sync Synchronization protocols labels Feb 14, 2025
@romac romac added this to the Phase 5 milestone Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working code Code/implementation related sync Synchronization protocols
Projects
None yet
Development

No branches or pull requests

1 participant