fix(supernode): preserve audit identities across account migration (companion to chain #199) - #318
fix(supernode): preserve audit identities across account migration (companion to chain #199)#318mateeullahmalik wants to merge 1 commit into
Conversation
CI status — expected red until chain #199 mergesAll failing jobs ( Exact compiler output from the I checked the full job log for any other error class — there is none. Verified green against the actual chain PR headUsing a throwaway Go workspace joining this branch with UnblockingCI here goes green once chain #199 merges and this branch's |
Preserve audit identities across account migration (SuperNode companion to chain PR2)
Companion to
LumeraProtocol/lumeraPR #199 (matee/evmigration-continuity-core).Requires the chain protos from that PR —
EpochReport.current_submitter,QueryAssignedTargetsResponse.reporter_supernode_account,target_account_mappings. Cannot compile against released chain tags. Do not merge before the chain PR.Why
After an account migration, a SuperNode has two distinct identities that the daemon currently conflates:
Likewise for targets: T_A is the logical target identity recorded in the epoch, while T_B is the live account whose transport address you must actually dial.
Before this change the daemon used one account for both roles. After a migration that is wrong in both directions: it either signs with an identity the chain no longer recognises, or reports under an identity nobody scores — and it tries to reach peers at addresses belonging to retired accounts.
What changes
Splits the two axes across the assignment and dispatch paths:
pkg/lumera/modules/audit/assignment.go— consumes the new chain query contract, surfacing the logical reporter and the ordered logical→current target mappings while preserving target order.supernode/host_reporter/service.go— reports under the epoch-logical identity A, signs as current account B.supernode/storage_challenge/lep6_dispatch.go— scores against logical target T_A, dispatches to live transport target T_B.supernode/storage_challenge/lep6_client_factory.go— resolves the live account for connection setup.supernode/storage_challenge/lep6_recheck.go— resolves rechecks against historical transcript identity, avoiding the recheck deadlock where a transcript requires the old target but current-registration checks require the new one.Target ordering is preserved throughout:
target_account_mappingsis index-aligned withtarget_supernode_accounts, so existing order-sensitive logic is unaffected.Compatibility and rollout order
current_submitteron historical reports decodes correctly — reports written before the chain change remain readable.disabled → canary. SuperNodes must be compatible before any migration can execute.Risks
Limited to the audit/LEP-6 reporting and storage-challenge paths. A wrong split does not corrupt chain state — the chain validates identities independently — but it can cause a migrated node to fail submission or miss peer observations for an epoch. Mitigated by the A==B degenerate case being the common path and covered by tests.
Rollback
Revert and redeploy the prior SuperNode release. Safe as long as no account migration has executed on the target network; the chain keeps migration disabled by default precisely so this ordering holds.
Evidence
Verified against chain PR #199 head
d7504279using a throwaway Go workspace joining both repos (never committed; onego work edit -replaceneeded for thego-ethereumreplacement-directive conflict between the two modules):Not yet done