Skip to content

[Fix] Ensure aborted transactions are handled properly on sync#4138

Closed
kaimast wants to merge 3 commits intostagingfrom
fix/load-aborted-transmissions
Closed

[Fix] Ensure aborted transactions are handled properly on sync#4138
kaimast wants to merge 3 commits intostagingfrom
fix/load-aborted-transmissions

Conversation

@kaimast
Copy link
Copy Markdown
Contributor

@kaimast kaimast commented Mar 3, 2026

This PR introduces two small, but important, improvements to block sync.

c1b4d7a updates the snarkVM rev to leverage the new try_get functionality for transmissions (ProvableHQ/snarkVM#3117). This change also makes errors propagate to the calling function, instead of simply logging a warning.

362e9e9 ensures that the sync logic checks whether a transaction was aborted before querying the ledger. In the current implementation the ledger returns an error for aborted transmissions, as there exists a reference to it in the ledger but the transmission itself is not stored in the ledger.
This should probably be fixed on the snarkVM-side, but checking the aborted set first is also cheap and avoids expensive rocksdb lookups in some cases.

I made this a separate PR as the changes are self-standing and provide a useful improvement.

@kaimast kaimast force-pushed the fix/load-aborted-transmissions branch from 362e9e9 to b06e695 Compare March 4, 2026 00:25
@kaimast kaimast marked this pull request as ready for review March 4, 2026 03:54
{
// The solution was already contained in the ledger.
missing_transmissions.insert(*transmission_id, solution.into());
} else {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm missing the ledger.contains_transmission call for aborted transmissions

// was aborted before querying the ledger.
if let Some(transaction) = unconfirmed_transactions.get(transaction_id) {
missing_transmissions.insert(*transmission_id, transaction.clone().into());
} else if aborted_transactions.contains(transaction_id) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same here about ledger.contains

@kaimast kaimast force-pushed the fix/load-aborted-transmissions branch from b06e695 to 871ed93 Compare March 5, 2026 22:18
@kaimast kaimast changed the base branch from staging to refactor/no-bft-channels March 5, 2026 22:23
@kaimast
Copy link
Copy Markdown
Contributor Author

kaimast commented Mar 6, 2026

I updated the PR and addresses @vicsn's comments. It now includes the workaround to log a warning when a transaction is not found, instead of aborting.

@vicsn vicsn requested a review from ljedrz March 6, 2026 14:27
Base automatically changed from refactor/no-bft-channels to staging March 6, 2026 14:27
Comment thread Cargo.toml Outdated
#path = "../snarkVM"
git = "https://github.com/ProvableHQ/snarkVM.git"
rev = "8df377d"
rev = "bb5c8ae6"
Copy link
Copy Markdown
Collaborator

@ljedrz ljedrz Mar 6, 2026

Choose a reason for hiding this comment

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

This revision needs to be updated, as we already have snarkOS changes depending on very recent snarkVM revisions. Actually, it seems that the current value is fine, this line just needs to be reverted.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I did a rebase and removed this change.

Copy link
Copy Markdown
Collaborator

@ljedrz ljedrz left a comment

Choose a reason for hiding this comment

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

LGTM, but needs rebasing.

@kaimast kaimast force-pushed the fix/load-aborted-transmissions branch from e83b624 to 25114de Compare March 6, 2026 21:58
@kaimast
Copy link
Copy Markdown
Contributor Author

kaimast commented Mar 11, 2026

I made some fixes to this logic, but I don't want to rebase #4039 again, so I will close this PR.

@kaimast kaimast closed this Mar 11, 2026
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