Skip to content

chore: remove redundant sign status & bump checkpoint version#745

Merged
ChaoticTempest merged 2 commits intodevelopfrom
pbuong/chore/redundant-sign-status
Apr 10, 2026
Merged

chore: remove redundant sign status & bump checkpoint version#745
ChaoticTempest merged 2 commits intodevelopfrom
pbuong/chore/redundant-sign-status

Conversation

@ChaoticTempest
Copy link
Copy Markdown
Contributor

sign status is redundant inside BidirectionalTx since it's already in BacklogEntry. So removing it and bumping checkpoint version (which is needed to remove some stale requests).

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR simplifies bidirectional transaction tracking by removing the redundant SignStatus from BidirectionalTx (status already lives on BacklogEntry) and bumps the persisted checkpoint key version to invalidate older checkpoint data.

Changes:

  • Remove status: SignStatus from BidirectionalTx and update construction sites accordingly.
  • Update stream/backlog logic and tests to rely on BacklogEntry for status.
  • Bump Redis checkpoint key version from v2 to v3 to drop stale persisted requests.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
integration-tests/tests/cases/ethereum_stream.rs Updates integration test BidirectionalTx initialization to match the new struct shape.
chain-signatures/node/src/stream/ops.rs Removes redundant status plumbing when creating/completing bidirectional transactions.
chain-signatures/node/src/storage/checkpoint_storage.rs Bumps checkpoint storage key version to v3 to invalidate old persisted checkpoints.
chain-signatures/node/src/sign_bidirectional.rs Removes status from BidirectionalTx definition.
chain-signatures/node/src/backlog/mod.rs Updates backlog tests/helpers to pass status independently of the tx struct.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

chain: Chain,
status: SignStatus,
dest: &str,
) -> BacklogEntry {
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create_execution_entry constructs a BacklogEntry with an execution tx (Some(tx)), but it accepts an arbitrary status. That makes it easy for tests to create impossible states (e.g., AwaitingResponse with an execution tx), which can mask bugs. Consider making this helper always use SignStatus::PendingExecution (or renaming it to reflect that it can create inconsistent combinations / adding a debug assert that status != AwaitingResponse when execution is Some).

Suggested change
) -> BacklogEntry {
) -> BacklogEntry {
debug_assert!(
!matches!(status, SignStatus::AwaitingResponse),
"create_execution_entry cannot create an execution entry with AwaitingResponse status"
);

Copilot uses AI. Check for mistakes.
Comment on lines +1182 to +1185
tx1.clone(),
Chain::Ethereum,
SignStatus::AwaitingResponse,
"ethereum",
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These entries include an execution tx via create_execution_entry(..., Some(tx)), so using SignStatus::AwaitingResponse here represents a state that should not happen in production (execution is only set after advancing, which sets status to PendingExecution). Updating these to PendingExecution (and adjusting the helper accordingly) will make the checkpoint equality test reflect real backlog states.

Copilot uses AI. Check for mistakes.
Comment on lines +1238 to +1242
create_execution_entry(
tx1.clone(),
Chain::Ethereum,
SignStatus::AwaitingResponse,
"ethereum",
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test later calls take_execution_tx() and expects a "pending execution entry", but the entry is created with SignStatus::AwaitingResponse. To keep the serialized checkpoint representative of real data, set the status to PendingExecution (or use a helper that always sets that status when execution is present).

Copilot uses AI. Check for mistakes.
@ChaoticTempest ChaoticTempest merged commit ccc2604 into develop Apr 10, 2026
7 checks passed
@ChaoticTempest ChaoticTempest deleted the pbuong/chore/redundant-sign-status branch April 10, 2026 09:30
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.

3 participants