-
Notifications
You must be signed in to change notification settings - Fork 444
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 block validator state to the database #324
Conversation
Codecov Report
@@ Coverage Diff @@
## master #324 +/- ##
==========================================
- Coverage 49.10% 48.89% -0.22%
==========================================
Files 161 161
Lines 16266 16525 +259
Branches 458 458
==========================================
+ Hits 7988 8080 +92
- Misses 7115 7276 +161
- Partials 1163 1169 +6 |
arbnode/transaction_streamer.go
Outdated
if s.validator != nil { | ||
s.validator.ReorgToBlock(targetBlock.NumberU64()) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to be concerned with atomicity here when exiting? If there are issues there I think it would only affect force kill since anything caught by the the signal handler should exit gracefully
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed this to call ReorgToBlock on the validator before the blockchain is reorg'd. That said, I'm thinking we'll want a more resilient scheme in the longer term, which I'll discuss a bit more in Tsahi's first review comment.
log.Error("sequencer message bad format", "blockNr", validationEntry.BlockNumber, "msgNum", start.BatchNumber) | ||
return | ||
BlockHash: entry.PrevBlockHash, | ||
SendRoot: entry.PrevSendRoot, | ||
} | ||
|
||
if arbstate.IsDASMessageHeaderByte(seqMsg[40]) { | ||
if v.das == nil { | ||
log.Error("No DAS configured, but sequencer message found with DAS header") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did you remove that return?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a DAS message is posted on a non-DAS chain, it should just be mostly ignored, but validation should still succeed. I'm changing this to gate the return behind a check of ArbitrumChainParams.DataAvailabilityCommittee
.
if err != nil { | ||
log.Error("Couldn't retrieve message from DAS", "err", err) | ||
return | ||
log.Error("Failed to deserialize DAS message", "err", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same Q (why no return?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the DAS message can't be deserialized, it should just be ignored, but validation can still succeed
@@ -489,43 +587,41 @@ func (v *BlockValidator) validate(ctx context.Context, validationEntry *validati | |||
} | |||
// stupid search for now, assuming the list will always be empty or very mall | |||
for _, blockNr := range v.config.BlocksToRecord { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can remove this entire block and BlocksToRecord config, and replace it with a better way to manually record blocks. Not urgent..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Rebase failed
TODO: