Skip to content

Commit 6168115

Browse files
authored
Merge branch 'main' into use_taiko-geth_params
2 parents d4b1899 + fe49ed8 commit 6168115

File tree

11 files changed

+9372
-7455
lines changed

11 files changed

+9372
-7455
lines changed

.github/workflows/eventindexer.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
go-version: 1.21.0
2020
- uses: actions/checkout@v4
2121
- name: golangci-lint
22-
uses: golangci/golangci-lint-action@v4
22+
uses: golangci/golangci-lint-action@v6
2323
with:
2424
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
2525
version: latest

.github/workflows/guardianproverhealthcheck.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
go-version: 1.21.0
2020
- uses: actions/checkout@v4
2121
- name: golangci-lint
22-
uses: golangci/golangci-lint-action@v4
22+
uses: golangci/golangci-lint-action@v6
2323
with:
2424
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
2525
version: latest

.github/workflows/relayer.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
go-version: 1.21.0
2020
- uses: actions/checkout@v4
2121
- name: golangci-lint
22-
uses: golangci/golangci-lint-action@v4
22+
uses: golangci/golangci-lint-action@v6
2323
with:
2424
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
2525
version: latest

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,6 @@ __pycache__/
118118
.vscode/launch.json
119119
packages/protocol/config.js
120120
.vercel
121+
122+
# Idea
123+
.idea/

go.mod

+7-8
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ require (
2727
github.com/patrickmn/go-cache v2.1.0+incompatible
2828
github.com/phayes/freeport v0.0.0-20220201140144-74d24b5ae9f5
2929
github.com/pkg/errors v0.9.1
30-
github.com/pressly/goose/v3 v3.19.2
30+
github.com/pressly/goose/v3 v3.20.0
3131
github.com/prometheus/client_golang v1.19.0
3232
github.com/prysmaticlabs/prysm/v4 v4.2.0
3333
github.com/rabbitmq/amqp091-go v1.9.0
@@ -36,7 +36,7 @@ require (
3636
github.com/swaggo/swag v1.16.3
3737
github.com/testcontainers/testcontainers-go v0.30.0
3838
github.com/urfave/cli/v2 v2.27.2
39-
golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3
39+
golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8
4040
golang.org/x/sync v0.7.0
4141
gopkg.in/go-playground/assert.v1 v1.2.1
4242
gopkg.in/yaml.v3 v3.0.1
@@ -117,7 +117,7 @@ require (
117117
github.com/go-playground/locales v0.14.1 // indirect
118118
github.com/go-playground/universal-translator v0.18.1 // indirect
119119
github.com/go-playground/validator/v10 v10.13.0 // indirect
120-
github.com/go-sql-driver/mysql v1.8.0 // indirect
120+
github.com/go-sql-driver/mysql v1.8.1 // indirect
121121
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
122122
github.com/godbus/dbus/v5 v5.1.0 // indirect
123123
github.com/gofrs/flock v0.8.1 // indirect
@@ -229,8 +229,7 @@ require (
229229
github.com/prysmaticlabs/gohashtree v0.0.3-alpha // indirect
230230
github.com/prysmaticlabs/prombbolt v0.0.0-20210126082820-9b7adba6db7c // indirect
231231
github.com/quic-go/qpack v0.4.0 // indirect
232-
github.com/quic-go/qtls-go1-20 v0.3.4 // indirect
233-
github.com/quic-go/quic-go v0.39.4 // indirect
232+
github.com/quic-go/quic-go v0.42.0 // indirect
234233
github.com/quic-go/webtransport-go v0.6.0 // indirect
235234
github.com/raulk/go-watchdog v1.3.0 // indirect
236235
github.com/rivo/uniseg v0.4.4 // indirect
@@ -270,7 +269,7 @@ require (
270269
go.opentelemetry.io/otel/trace v1.24.0 // indirect
271270
go.uber.org/dig v1.17.1 // indirect
272271
go.uber.org/fx v1.20.1 // indirect
273-
go.uber.org/mock v0.3.0 // indirect
272+
go.uber.org/mock v0.4.0 // indirect
274273
go.uber.org/multierr v1.11.0 // indirect
275274
go.uber.org/zap v1.26.0 // indirect
276275
golang.org/x/crypto v0.22.0 // indirect
@@ -281,7 +280,7 @@ require (
281280
golang.org/x/term v0.19.0 // indirect
282281
golang.org/x/text v0.14.0 // indirect
283282
golang.org/x/time v0.5.0 // indirect
284-
golang.org/x/tools v0.17.0 // indirect
283+
golang.org/x/tools v0.19.0 // indirect
285284
google.golang.org/api v0.44.0 // indirect
286285
google.golang.org/appengine v1.6.8 // indirect
287286
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect
@@ -306,6 +305,6 @@ require (
306305

307306
replace github.com/ethereum/go-ethereum v1.13.15 => github.com/taikoxyz/taiko-geth v0.0.0-20240504072040-7e1b8b65a3f8
308307

309-
replace github.com/ethereum-optimism/optimism v1.7.4 => github.com/taikoxyz/optimism v0.0.0-20240504104604-6c9729321b29
308+
replace github.com/ethereum-optimism/optimism v1.7.4 => github.com/taikoxyz/optimism v0.0.0-20240508063202-db34e8c760ea
310309

311310
replace github.com/uber/jaeger-client-go => github.com/uber/jaeger-client-go v2.25.0+incompatible

go.sum

+16-77
Large diffs are not rendered by default.

packages/bridge-ui/src/libs/connect/web3modal.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const web3modal = createWeb3Modal({
1212
projectId,
1313
featuredWalletIds: [],
1414
allowUnsupportedChain: true,
15-
excludeWalletIds: ['c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96'],
15+
excludeWalletIds: [],
1616
// chains,
1717
chainImages,
1818
themeVariables: {

packages/taiko-client/Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ lint:
1818
&& goimports -local "github.com/taikoxyz/taiko-mono/packages/taiko-client" -w ./ \
1919
&& golangci-lint run
2020

21-
test:
22-
PACKAGE=${PACKAGE} \
21+
test: lint
22+
@PACKAGE=${PACKAGE} \
2323
RUN_TESTS=true \
2424
./integration_test/entrypoint.sh
2525

2626
dev_net:
27-
COMPILE_PROTOCOL=${COMPILE_PROTOCOL} \
27+
@COMPILE_PROTOCOL=${COMPILE_PROTOCOL} \
2828
./integration_test/entrypoint.sh
2929

3030
gen_bindings:
31-
TAIKO_GETH_DIR=${TAIKO_GETH_DIR} \
31+
@TAIKO_GETH_DIR=${TAIKO_GETH_DIR} \
3232
./scripts/gen_bindings.sh
3333

3434
.PHONY: build \
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8532b7750513b87732340030139513d2b2ee203b
1+
d4b62d23b4819bd932ad52b040a01f2cbbbeb9f2

packages/taiko-client/driver/txlist_decompressor/txlist_decompressor_test.go

+54-69
Original file line numberDiff line numberDiff line change
@@ -6,101 +6,86 @@ import (
66
"testing"
77

88
"github.com/ethereum/go-ethereum/common"
9-
"github.com/ethereum/go-ethereum/core"
109
"github.com/ethereum/go-ethereum/core/types"
1110
"github.com/ethereum/go-ethereum/crypto"
1211
"github.com/ethereum/go-ethereum/log"
1312
"github.com/ethereum/go-ethereum/params"
1413
"github.com/ethereum/go-ethereum/rlp"
15-
"github.com/stretchr/testify/require"
14+
"github.com/stretchr/testify/suite"
1615

16+
"github.com/taikoxyz/taiko-mono/packages/taiko-client/internal/testutils"
1717
"github.com/taikoxyz/taiko-mono/packages/taiko-client/internal/utils"
18+
"github.com/taikoxyz/taiko-mono/packages/taiko-client/pkg/rpc"
1819
)
1920

2021
var (
21-
maxBlocksGasLimit = uint64(50)
22-
maxTxlistBytes = uint64(10000)
23-
chainID = genesis.Config.ChainID
24-
testKey, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
25-
testAddr = crypto.PubkeyToAddress(testKey.PublicKey)
26-
genesis = &core.Genesis{
27-
Config: params.AllEthashProtocolChanges,
28-
Alloc: types.GenesisAlloc{testAddr: {Balance: big.NewInt(2e15)}},
29-
ExtraData: []byte("test genesis"),
30-
Timestamp: 9000,
31-
BaseFee: big.NewInt(params.InitialBaseFee),
32-
}
22+
chainID = new(big.Int).SetUint64(167001)
23+
testKey, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
24+
testAddr = crypto.PubkeyToAddress(testKey.PublicKey)
3325
)
3426

35-
func TestDecomporess(t *testing.T) {
36-
d := NewTxListDecompressor(
37-
maxBlocksGasLimit,
38-
maxTxlistBytes,
27+
type TxListDecompressorTestSuite struct {
28+
testutils.ClientTestSuite
29+
d *TxListDecompressor
30+
}
31+
32+
func (s *TxListDecompressorTestSuite) SetupTest() {
33+
s.ClientTestSuite.SetupTest()
34+
s.d = NewTxListDecompressor(
35+
params.MaxGasLimit,
36+
rpc.BlockMaxTxListBytes,
3937
chainID,
4038
)
39+
}
40+
41+
func (s *TxListDecompressorTestSuite) TestZeroBytes() {
42+
s.Empty(s.d.TryDecompress(chainID, []byte{}, false))
43+
}
44+
45+
func (s *TxListDecompressorTestSuite) TestCalldataSize() {
46+
s.Empty(s.d.TryDecompress(chainID, randBytes(rpc.BlockMaxTxListBytes+1), false))
47+
s.Empty(s.d.TryDecompress(chainID, randBytes(rpc.BlockMaxTxListBytes-1), false))
48+
}
49+
50+
func (s *TxListDecompressorTestSuite) TestValidTxList() {
4151
compressed, err := utils.Compress(rlpEncodedTransactionBytes(1, true))
42-
require.NoError(t, err)
43-
44-
tests := []struct {
45-
name string
46-
blockID *big.Int
47-
txListBytes []byte
48-
decompressed []byte
49-
}{
50-
{
51-
"txListBytes binary too large",
52-
chainID,
53-
randBytes(maxTxlistBytes + 1),
54-
[]byte{},
55-
},
56-
{
57-
"txListBytes not decodable to rlp",
58-
chainID,
59-
randBytes(0x1),
60-
[]byte{},
61-
},
62-
{
63-
"success empty tx list",
64-
chainID,
65-
rlpEncodedTransactionBytes(0, true),
66-
[]byte{},
67-
},
68-
{
69-
"success non-empty tx list",
70-
chainID,
71-
compressed,
72-
rlpEncodedTransactionBytes(1, true),
73-
},
74-
}
52+
s.Nil(err)
53+
decompressed, err := utils.Decompress(compressed)
54+
s.Nil(err)
7555

76-
for _, tt := range tests {
77-
t.Run(tt.name, func(t *testing.T) {
78-
require.Equal(t, tt.decompressed, d.TryDecompress(tt.blockID, tt.txListBytes, false))
79-
})
80-
}
56+
s.Equal(s.d.TryDecompress(chainID, compressed, true), decompressed)
57+
s.Equal(s.d.TryDecompress(chainID, compressed, false), decompressed)
58+
}
59+
60+
func (s *TxListDecompressorTestSuite) TestInvalidTxList() {
61+
compressed, err := utils.Compress(randBytes(1024))
62+
s.Nil(err)
63+
64+
s.Zero(len(s.d.TryDecompress(chainID, compressed, true)))
65+
s.Zero(len(s.d.TryDecompress(chainID, compressed, false)))
66+
}
67+
68+
func (s *TxListDecompressorTestSuite) TestInvalidZlibBytes() {
69+
s.Zero(len(s.d.TryDecompress(chainID, randBytes(1024), true)))
70+
s.Zero(len(s.d.TryDecompress(chainID, randBytes(1024), false)))
71+
}
72+
73+
func TestDriverTestSuite(t *testing.T) {
74+
suite.Run(t, new(TxListDecompressorTestSuite))
8175
}
8276

8377
func rlpEncodedTransactionBytes(l int, signed bool) []byte {
8478
txs := make(types.Transactions, 0)
8579
for i := 0; i < l; i++ {
8680
var tx *types.Transaction
8781
if signed {
88-
txData := &types.LegacyTx{
89-
Nonce: 1,
90-
To: &testAddr,
91-
GasPrice: common.Big256,
92-
Value: common.Big1,
93-
Gas: 10,
94-
}
95-
96-
tx = types.MustSignNewTx(testKey, types.LatestSigner(genesis.Config), txData)
82+
txData := &types.LegacyTx{Nonce: 1, To: &testAddr, GasPrice: common.Big256, Value: common.Big1, Gas: 10}
83+
84+
tx = types.MustSignNewTx(testKey, types.LatestSigner(&params.ChainConfig{ChainID: chainID}), txData)
9785
} else {
9886
tx = types.NewTransaction(1, testAddr, common.Big1, 10, new(big.Int).SetUint64(10*params.GWei), nil)
9987
}
100-
txs = append(
101-
txs,
102-
tx,
103-
)
88+
txs = append(txs, tx)
10489
}
10590
b, _ := rlp.EncodeToBytes(txs)
10691
return b

0 commit comments

Comments
 (0)