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

feat: remove final proof sanity check #71

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Changes from all commits
Commits
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
feat: remove final proof sanity check
ToniRamirezM committed Sep 11, 2024
commit 60be7a31016c2f92b3f45bbf8bd9539d07fa4b1d
22 changes: 0 additions & 22 deletions aggregator/aggregator.go
Original file line number Diff line number Diff line change
@@ -1045,28 +1045,6 @@ func (a *Aggregator) buildFinalProof(
finalProof.Public.NewLocalExitRoot = finalDBBatch.Batch.LocalExitRoot.Bytes()
}

// Sanity Check: state root from the proof must match the one from the final batch
if a.cfg.FinalProofSanityCheckEnabled {
finalDBBatch, err := a.state.GetBatch(ctx, proof.BatchNumberFinal, nil)
if err != nil {
return nil, fmt.Errorf("failed to retrieve batch with number [%d]", proof.BatchNumberFinal)
}

if common.BytesToHash(finalProof.Public.NewStateRoot).String() != finalDBBatch.Batch.StateRoot.String() {
for {
log.Errorf(
"State root from the final proof does not match the expected for batch %d: Proof = [%s] Expected = [%s]",
proof.BatchNumberFinal,
common.BytesToHash(finalProof.Public.NewStateRoot).String(),
finalDBBatch.Batch.StateRoot.String(),
)
time.Sleep(a.cfg.RetryTime.Duration)
}
} else {
log.Infof("State root sanity check from the final proof for batch %d passed", proof.BatchNumberFinal)
}
}

return finalProof, nil
}

3 changes: 0 additions & 3 deletions aggregator/config.go
Original file line number Diff line number Diff line change
@@ -82,9 +82,6 @@ type Config struct {
// BatchProofSanityCheckEnabled is a flag to enable the sanity check of the batch proof
BatchProofSanityCheckEnabled bool `mapstructure:"BatchProofSanityCheckEnabled"`

// FinalProofSanityCheckEnabled is a flag to enable the sanity check of the final proof
FinalProofSanityCheckEnabled bool `mapstructure:"FinalProofSanityCheckEnabled"`

// ChainID is the L2 ChainID provided by the Network Config
ChainID uint64

1 change: 0 additions & 1 deletion config/default.go
Original file line number Diff line number Diff line change
@@ -61,7 +61,6 @@ SenderAddress = ""
CleanupLockedProofsInterval = "2m"
GeneratingProofCleanupThreshold = "10m"
BatchProofSanityCheckEnabled = true
FinalProofSanityCheckEnabled = true
ForkId = 9
GasOffset = 0
WitnessURL = "localhost:8123"