Skip to content
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

Beacon node slasher improvement #13549

Merged
merged 29 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
9270c52
Slasher: Ensure all gorouting are stopped before running `Stop` actions.
nalepae Jan 18, 2024
d1d287b
`slasher.go`: Add comments and rename some variables. - NFC
nalepae Jan 17, 2024
45ce8ed
`detect_blocks.go`: Improve. - NFC
nalepae Jan 17, 2024
0189027
`chunks.go`: Remove `_`receivers. - NFC
nalepae Jan 18, 2024
5add622
`validateAttestationIntegrity`: Improve documentation. - NFC
nalepae Jan 18, 2024
d8462fd
`filterAttestations`: Avoid `else`and rename variable. - NFC
nalepae Jan 18, 2024
0f53312
`slasher.go`: Fix and add comments.
nalepae Jan 18, 2024
b6bb491
`SaveAttestationRecordsForValidators`: Remove unused code.
nalepae Jan 19, 2024
5c4180c
`LastEpochWrittenForValidators`: Name variables consistently. - NFC
nalepae Jan 19, 2024
7049d77
`SaveLastEpochsWrittenForValidators`: Name variables consistently. - NFC
nalepae Jan 19, 2024
2508142
`CheckAttesterDoubleVotes`: Rename variables and add comments. - NFC
nalepae Jan 19, 2024
eefb8ae
`schema.go`: Add comments. - NFC
nalepae Jan 19, 2024
c19b8ee
`processQueuedAttestations`: Add comments. - NFC
nalepae Jan 19, 2024
f6b96ed
`checkDoubleVotes`: Rename variable. - NFC
nalepae Jan 19, 2024
104e794
`Test_processQueuedAttestations`: Ensure there is no error log.
nalepae Jan 19, 2024
257b0cb
`shouldNotBeSlashable` => `shouldBeSlashable`
nalepae Jan 19, 2024
efdbeb0
`Test_processQueuedAttestations`: Add 2 test cases:
nalepae Jan 19, 2024
72f108b
`checkDoubleVotesOnDisk` ==> `checkDoubleVotes`.
nalepae Jan 19, 2024
e171085
`Test_processQueuedBlocks_DetectsDoubleProposals`: Wrap proposals.
nalepae Jan 20, 2024
d546115
Fix slasher multiple proposals false negative.
nalepae Jan 20, 2024
9f1c451
`params.go`: Change comments. - NFC
nalepae Jan 29, 2024
f19225d
`CheckSlashable`: Keep the happy path without indentation.
nalepae Jan 29, 2024
025110e
`detectAllAttesterSlashings` => `checkSurrounds`.
nalepae Jan 29, 2024
6e42331
Update beacon-chain/db/slasherkv/slasher.go
nalepae Jan 29, 2024
084cd08
Update beacon-chain/db/slasherkv/slasher.go
nalepae Jan 29, 2024
67235ae
`CheckAttesterDoubleVotes`: Keep happy path without indentation.
nalepae Jan 30, 2024
74fe7af
'SaveAttestationRecordsForValidators': Save the first attestation.
nalepae Jan 30, 2024
fec9d56
Rename `min` => `minimum`.
nalepae Jan 30, 2024
e9afe03
`couldNotSaveSlashableAtt` ==> `couldNotCheckSlashableAtt`
nalepae Jan 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions beacon-chain/db/slasherkv/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,21 @@ package slasherkv
// it easy to scan for keys that have a certain shard number as a prefix and return those
// corresponding attestations.
var (
// Slasher buckets.
attestedEpochsByValidator = []byte("attested-epochs-by-validator")
attestationRecordsBucket = []byte("attestation-records")

// key: (encoded) ValidatorIndex
// value: (encoded) Epoch
attestedEpochsByValidator = []byte("attested-epochs-by-validator")

// key: attestation SigningRoot
// value: (encoded + compressed) IndexedAttestation
attestationRecordsBucket = []byte("attestation-records")

// key: (encoded) Target Epoch + (encoded) ValidatorIndex
// value: attestation SigningRoot
attestationDataRootsBucket = []byte("attestation-data-roots")
proposalRecordsBucket = []byte("proposal-records")
slasherChunksBucket = []byte("slasher-chunks")

// key: Slot+ValidatorIndex
// value: (encoded) SignedBlockHeaderWrapper
proposalRecordsBucket = []byte("proposal-records")
slasherChunksBucket = []byte("slasher-chunks")
)
Loading
Loading