-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Persist information about merged ATX members across checkpoint #6074
Persist information about merged ATX members across checkpoint #6074
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## atx-handler-v2/syntactical-validation-merged #6074 +/- ##
==============================================================================
Coverage ? 81.5%
==============================================================================
Files ? 299
Lines ? 32260
Branches ? 0
==============================================================================
Hits ? 26307
Misses ? 4241
Partials ? 1712 ☔ View full report in Codecov by Sentry. |
bors try |
tryBuild failed: |
af2b7b7
to
b55ef60
Compare
bors try |
tryBuild failed: |
b55ef60
to
6cbca05
Compare
bors try |
tryBuild failed: |
6cbca05
to
b7cba29
Compare
f8445a9
into
atx-handler-v2/syntactical-validation-merged
Motivation
A merged ATX contains PoST proofs for multiple IDs. When using such ATX as the previous ATX, we must ensure that the identity which claims this ATX to be its previous one was a member of that ATX. To do this, we must persist a mapping (
ATXID
,NODEID
) -> number of POST units across a checkpoint-restore.As a benefit, it also simplifies and speeds up the code calculating the effective num units for ID as we don't need to decode the previous ATX blob anymore.
Description
I added a table
posts
that maps a pair ofATXID
andNodeID
to units. There will be a row for every identity contributing its PoST in an ATX (1 row for ATX v1 and 1-256 rows for ATX v2). This table simplifies the calculation of effective units in the ATX handler - decoding the previous ATX blob turned into a lookup in theposts
table.I didn't include a
map[types.NodeID]uint32
field in thetypes.ActivationTx
to avoid having to fill it every time an ATX is retrieved from the database. Reading PoSTs is only required in the ATX handler and the checkpoint generation.The checkpoint generation and recovery code was updated to persist the units across checkpoint.
Test Plan
TODO