Skip to content

Commit dce8284

Browse files
committed
downgrade to latest l2geth develop and fix compatibility issues
1 parent 0e831aa commit dce8284

5 files changed

Lines changed: 24 additions & 22 deletions

File tree

encoding/codecv3.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"fmt"
88

99
"github.com/scroll-tech/go-ethereum/common"
10-
"github.com/scroll-tech/go-ethereum/params"
1110
)
1211

1312
type DACodecV3 struct {
@@ -115,7 +114,7 @@ func (d *DACodecV3) EstimateChunkL1CommitGas(c *Chunk) (uint64, error) {
115114
if err != nil {
116115
return 0, fmt.Errorf("failed to estimate L1 commit gas for chunk: %w", err)
117116
}
118-
totalL1CommitGas += params.BlobTxPointEvaluationPrecompileGas // plus gas cost for the point-evaluation precompile call.
117+
totalL1CommitGas += blobTxPointEvaluationPrecompileGas // plus gas cost for the point-evaluation precompile call.
119118
return totalL1CommitGas, nil
120119
}
121120

@@ -127,7 +126,7 @@ func (d *DACodecV3) EstimateBatchL1CommitGas(b *Batch) (uint64, error) {
127126
if err != nil {
128127
return 0, fmt.Errorf("failed to estimate L1 commit gas for batch: %w", err)
129128
}
130-
totalL1CommitGas += params.BlobTxPointEvaluationPrecompileGas // plus gas cost for the point-evaluation precompile call.
129+
totalL1CommitGas += blobTxPointEvaluationPrecompileGas // plus gas cost for the point-evaluation precompile call.
131130
return totalL1CommitGas, nil
132131
}
133132

encoding/da.go

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,19 @@ const (
7878
)
7979

8080
const (
81-
payloadLengthBytes = 4
82-
calldataNonZeroByteGas = 16
83-
coldSloadGas = 2100
84-
coldAddressAccessGas = 2600
85-
warmAddressAccessGas = 100
86-
warmSloadGas = 100
87-
baseTxGas = 21000
88-
sstoreGas = 20000
89-
extraGasCost = 100000 // over-estimate the gas cost for ops like _getAdmin, _implementation, _requireNotPaused, etc
90-
skippedL1MessageBitmapByteSize = 32
91-
functionSignatureBytes = 4
92-
defaultParameterBytes = 32
81+
payloadLengthBytes = 4
82+
calldataNonZeroByteGas = 16
83+
coldSloadGas = 2100
84+
coldAddressAccessGas = 2600
85+
warmAddressAccessGas = 100
86+
warmSloadGas = 100
87+
baseTxGas = 21000
88+
sstoreGas = 20000
89+
extraGasCost = 100000 // over-estimate the gas cost for ops like _getAdmin, _implementation, _requireNotPaused, etc
90+
blobTxPointEvaluationPrecompileGas = 50000
91+
skippedL1MessageBitmapByteSize = 32
92+
functionSignatureBytes = 4
93+
defaultParameterBytes = 32
9394
)
9495

9596
// Block represents an L2 block.
@@ -628,9 +629,9 @@ func GetHardforkName(config *params.ChainConfig, blockHeight, blockTimestamp uin
628629
return "homestead"
629630
} else if !config.IsCurie(blockHeightBigInt) {
630631
return "bernoulli"
631-
} else if !config.IsDarwin(blockHeightBigInt, blockTimestamp) {
632+
} else if !config.IsDarwin(blockTimestamp) {
632633
return "curie"
633-
} else if !config.IsDarwinV2(blockHeightBigInt, blockTimestamp) {
634+
} else if !config.IsDarwinV2(blockTimestamp) {
634635
return "darwin"
635636
} else {
636637
return "darwinV2"
@@ -644,9 +645,9 @@ func GetCodecVersion(config *params.ChainConfig, blockHeight, blockTimestamp uin
644645
return CodecV0
645646
} else if !config.IsCurie(blockHeightBigInt) {
646647
return CodecV1
647-
} else if !config.IsDarwin(blockHeightBigInt, blockTimestamp) {
648+
} else if !config.IsDarwin(blockTimestamp) {
648649
return CodecV2
649-
} else if !config.IsDarwinV2(blockHeightBigInt, blockTimestamp) {
650+
} else if !config.IsDarwinV2(blockTimestamp) {
650651
return CodecV3
651652
} else {
652653
return CodecV4

encoding/interfaces.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ func CodecFromVersion(version CodecVersion) (Codec, error) {
9595

9696
// CodecFromConfig determines and returns the appropriate codec based on chain configuration, block number, and timestamp.
9797
func CodecFromConfig(chainCfg *params.ChainConfig, startBlockNumber *big.Int, startBlockTimestamp uint64) Codec {
98-
if chainCfg.IsDarwinV2(startBlockNumber, startBlockTimestamp) {
98+
if chainCfg.IsDarwinV2(startBlockTimestamp) {
9999
return &DACodecV4{}
100-
} else if chainCfg.IsDarwin(startBlockNumber, startBlockTimestamp) {
100+
} else if chainCfg.IsDarwin(startBlockTimestamp) {
101101
return &DACodecV3{}
102102
} else if chainCfg.IsCurie(startBlockNumber) {
103103
return &DACodecV2{}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.21
44

55
require (
66
github.com/agiledragon/gomonkey/v2 v2.12.0
7-
github.com/scroll-tech/go-ethereum v1.10.14-0.20241010064814-3d88e870ae22
7+
github.com/scroll-tech/go-ethereum v1.10.14-0.20241206090635-a5ecce2dc333
88
github.com/stretchr/testify v1.9.0
99
)
1010

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjR
115115
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
116116
github.com/scroll-tech/go-ethereum v1.10.14-0.20241010064814-3d88e870ae22 h1:s1/8G2HP1z9jd0FBbUVs7viv/lQZA/8QoQppXYTX1CU=
117117
github.com/scroll-tech/go-ethereum v1.10.14-0.20241010064814-3d88e870ae22/go.mod h1:r9FwtxCtybMkTbWYCyBuevT9TW3zHmOTHqD082Uh+Oo=
118+
github.com/scroll-tech/go-ethereum v1.10.14-0.20241206090635-a5ecce2dc333 h1:qJXViC4vPMcYNVImHnSWIL4IMXtiyolaN687+qVwc0Y=
119+
github.com/scroll-tech/go-ethereum v1.10.14-0.20241206090635-a5ecce2dc333/go.mod h1:xRDJvaNUe7lCU2fB+AqyS7gahar+dfJPrUJplfXF4dw=
118120
github.com/scroll-tech/zktrie v0.8.4 h1:UagmnZ4Z3ITCk+aUq9NQZJNAwnWl4gSxsLb2Nl7IgRE=
119121
github.com/scroll-tech/zktrie v0.8.4/go.mod h1:XvNo7vAk8yxNyTjBDj5WIiFzYW4bx/gJ78+NK6Zn6Uk=
120122
github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI=

0 commit comments

Comments
 (0)