mirror of
https://github.com/scroll-tech/scroll.git
synced 2026-01-11 23:18:07 -05:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f00c400993 | ||
|
|
bb6428848f | ||
|
|
df97200a41 |
@@ -236,7 +236,7 @@ func (r *Layer2Relayer) commitGenesisBatch(batchHash string, batchHeader []byte,
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to send import genesis batch tx to L1, error: %v", err)
|
||||
}
|
||||
log.Info("importGenesisBatch transaction sent", "contract", r.cfg.RollupContractAddress, "txHash", txHash, "batchHash", batchHash)
|
||||
log.Info("importGenesisBatch transaction sent", "contract", r.cfg.RollupContractAddress, "txHash", txHash.String(), "batchHash", batchHash)
|
||||
|
||||
// wait for confirmation
|
||||
// we assume that no other transactions are sent before initializeGenesis completes
|
||||
@@ -247,11 +247,11 @@ func (r *Layer2Relayer) commitGenesisBatch(batchHash string, batchHeader []byte,
|
||||
select {
|
||||
// print progress
|
||||
case <-ticker.C:
|
||||
log.Info("Waiting for confirmation, pending count: %d", r.rollupSender.PendingCount())
|
||||
log.Info("Waiting for confirmation", "pending count", r.rollupSender.PendingCount())
|
||||
|
||||
// timeout
|
||||
case <-time.After(5 * time.Minute):
|
||||
return fmt.Errorf("import genesis timeout after 5 minutes, original txHash: %v", txHash)
|
||||
return fmt.Errorf("import genesis timeout after 5 minutes, original txHash: %v", txHash.String())
|
||||
|
||||
// handle confirmation
|
||||
case confirmation := <-r.rollupSender.ConfirmChan():
|
||||
@@ -261,7 +261,7 @@ func (r *Layer2Relayer) commitGenesisBatch(batchHash string, batchHeader []byte,
|
||||
if !confirmation.IsSuccessful {
|
||||
return fmt.Errorf("import genesis batch tx failed")
|
||||
}
|
||||
log.Info("Successfully committed genesis batch on L1", "txHash", confirmation.TxHash)
|
||||
log.Info("Successfully committed genesis batch on L1", "txHash", confirmation.TxHash.String())
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,15 +106,6 @@ func (p *ChunkProposer) proposeChunk() (*bridgeTypes.Chunk, error) {
|
||||
)
|
||||
}
|
||||
|
||||
if totalTxGasUsed > p.maxTxGasPerChunk {
|
||||
return nil, fmt.Errorf(
|
||||
"the first block exceeds l2 tx gas limit; block number: %v, gas used: %v, max gas limit: %v",
|
||||
firstBlock.Header.Number,
|
||||
totalTxGasUsed,
|
||||
p.maxTxGasPerChunk,
|
||||
)
|
||||
}
|
||||
|
||||
if totalL1CommitGas > p.maxL1CommitGasPerChunk {
|
||||
return nil, fmt.Errorf(
|
||||
"the first block exceeds l1 commit gas limit; block number: %v, commit gas: %v, max commit gas limit: %v",
|
||||
@@ -133,6 +124,16 @@ func (p *ChunkProposer) proposeChunk() (*bridgeTypes.Chunk, error) {
|
||||
)
|
||||
}
|
||||
|
||||
// Check if the first block breaks any soft limits.
|
||||
if totalTxGasUsed > p.maxTxGasPerChunk {
|
||||
log.Warn(
|
||||
"The first block in chunk exceeds l2 tx gas limit",
|
||||
"block number", firstBlock.Header.Number,
|
||||
"gas used", totalTxGasUsed,
|
||||
"max gas limit", p.maxTxGasPerChunk,
|
||||
)
|
||||
}
|
||||
|
||||
for i, block := range blocks[1:] {
|
||||
totalTxGasUsed += block.Header.GasUsed
|
||||
totalL2TxNum += block.L2TxsNum()
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"runtime/debug"
|
||||
)
|
||||
|
||||
var tag = "v4.0.2"
|
||||
var tag = "v4.0.4"
|
||||
|
||||
var commit = func() string {
|
||||
if info, ok := debug.ReadBuildInfo(); ok {
|
||||
|
||||
@@ -231,30 +231,38 @@ func (r *Roller) prove() error {
|
||||
|
||||
var traces []*types.BlockTrace
|
||||
traces, err = r.getSortedTracesByHashes(task.Task.BlockHashes)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// If FFI panic during Prove, the roller will restart and re-enter prove() function,
|
||||
// the proof will not be submitted.
|
||||
var proof *message.AggProof
|
||||
proof, err = r.prover.Prove(task.Task.ID, traces)
|
||||
if err != nil {
|
||||
proofMsg = &message.ProofDetail{
|
||||
Status: message.StatusProofError,
|
||||
Error: err.Error(),
|
||||
Error: "get traces failed",
|
||||
ID: task.Task.ID,
|
||||
Type: task.Task.Type,
|
||||
Proof: &message.AggProof{},
|
||||
Proof: nil,
|
||||
}
|
||||
log.Error("prove block failed!", "task-id", task.Task.ID)
|
||||
log.Error("get traces failed!", "task-id", task.Task.ID, "err", err)
|
||||
} else {
|
||||
proofMsg = &message.ProofDetail{
|
||||
Status: message.StatusOk,
|
||||
ID: task.Task.ID,
|
||||
Type: task.Task.Type,
|
||||
Proof: proof,
|
||||
// If FFI panic during Prove, the roller will restart and re-enter prove() function,
|
||||
// the proof will not be submitted.
|
||||
var proof *message.AggProof
|
||||
proof, err = r.prover.Prove(task.Task.ID, traces)
|
||||
if err != nil {
|
||||
proofMsg = &message.ProofDetail{
|
||||
Status: message.StatusProofError,
|
||||
Error: err.Error(),
|
||||
ID: task.Task.ID,
|
||||
Type: task.Task.Type,
|
||||
Proof: nil,
|
||||
}
|
||||
log.Error("prove block failed!", "task-id", task.Task.ID)
|
||||
} else {
|
||||
proofMsg = &message.ProofDetail{
|
||||
Status: message.StatusOk,
|
||||
ID: task.Task.ID,
|
||||
Type: task.Task.Type,
|
||||
Proof: proof,
|
||||
}
|
||||
log.Info("prove block successfully!", "task-id", task.Task.ID)
|
||||
}
|
||||
log.Info("prove block successfully!", "task-id", task.Task.ID)
|
||||
}
|
||||
} else {
|
||||
// when the roller has more than 3 times panic,
|
||||
@@ -264,7 +272,7 @@ func (r *Roller) prove() error {
|
||||
Error: "zk proving panic",
|
||||
ID: task.Task.ID,
|
||||
Type: task.Task.Type,
|
||||
Proof: &message.AggProof{},
|
||||
Proof: nil,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user