Repository navigation
fix: preserve seeded accounts on restart - #196
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Change: Bug fix · Severity of issue fixed: Medium Merge Risk:
|
Strengthen preserves_seeded_accounts_on_reopen with non-empty account data and a distinct owner. Assert lamports, data, and owner after reopening so the regression catches partial overwrites that preserve only lamports. Validated with cargo fmt --check and cargo test -p magicblock-keeper preserves_seeded_accounts_on_reopen -- --nocapture.
What changed
Keeper now seeds caller supplied startup accounts only when they are absent from AccountsDB. An existing account keeps its saved data when the node restarts; a missing account is still initialized. This preserves the validator's
MagicContextintent ID across a leader restart, matching the V1 validator's behavior.Closes #195
Impact
The
KeeperBuilder.possibly_missing_accountsfield makes the seed-if-absent behavior explicit. Builtin program and sysvar seeding is unchanged. The previous overwrite changed leader state without a replicated transaction, so the verifiers rejected the next state seal.Reviewer notes
The new
preserves_seeded_accounts_on_reopenregression test checks both saved-account preservation and creation of a missing account. Before this change, the validator'sredhat/replication_settlement_recoveryfailed after the leader restart with matching transaction counts but different state checksums. With Engine commit2f8a90dpinned, the scenario passes on validator PR #1867 and PR #1868.