Skip to content

Commit

Permalink
feat: remove final proof sanity check
Browse files Browse the repository at this point in the history
  • Loading branch information
ToniRamirezM committed Sep 11, 2024
1 parent 29d3a8b commit 60be7a3
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 26 deletions.
22 changes: 0 additions & 22 deletions aggregator/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
3 changes: 0 additions & 3 deletions aggregator/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

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

0 comments on commit 60be7a3

Please sign in to comment.