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 #126

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
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
17 changes: 0 additions & 17 deletions aggregator/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -853,23 +853,6 @@ func (a *Aggregator) buildFinalProof(ctx context.Context, proverI proverInterfac
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) != finalDBBatch.Batch.StateRoot {
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 @@ -78,9 +78,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 @@ -14,7 +14,6 @@ SenderAddress = ""
CleanupLockedProofsInterval = "2m"
GeneratingProofCleanupThreshold = "10m"
BatchProofSanityCheckEnabled = true
FinalProofSanityCheckEnabled = true
ForkId = 9
GasOffset = 0
WitnessURL = "localhost:8123"
Expand Down
Loading