Skip to content

Preserve historical withdrawal accounting on Drivenet - #49

Draft
ekulkisnek wants to merge 1 commit into
LayerTwo-Labs:masterfrom
ekulkisnek:agent/fix-drivenet-withdrawal-accounting
Draft

ekulkisnek wants to merge 1 commit into
LayerTwo-Labs:masterfrom
ekulkisnek:agent/fix-drivenet-withdrawal-accounting

Conversation

@ekulkisnek

Copy link
Copy Markdown
Contributor

Problem

Commit 48208c5 correctly made new withdrawals fund both the payout and mainchain fee, but Drivenet already contained blocks mined under the former payout-only rule. Current nodes stop syncing when they revalidate those blocks.

Fix

  • keep the corrected rule for every new block
  • apply payout-only accounting only to the two observed historical block hashes
  • use the same rule for fee validation and the fee-committing Merkle root
  • add focused tests for historical acceptance and current underfunding rejection

Evidence

Before this change, replay stopped at height 447 on block f9a7a9117bec4ed6c4fffbf3b651b60f9459a5fc881f267b271778874ad55d0f. A second historical block was found at height 807: 208e6bb567efd46d073bab68d9cff041279faada60c7f27a011a56bd1f7f86b7. With both exact exceptions, the node replayed the existing Drivenet history to tip height 7360.

Validation: cargo test --workspace --locked, cargo clippy --workspace --all-targets --locked -- -D warnings, formatting, and diff checks pass.

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.

1 participant