Skip to content

Commit 7b5f0de

Browse files
authored
Merge branch 'main' into fix-jobs
2 parents 7d96d11 + fe49ed8 commit 7b5f0de

File tree

11 files changed

+9352
-7373
lines changed

11 files changed

+9352
-7373
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

+1-1
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,6 @@ require (
305305

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

308-
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
309309

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

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -1119,8 +1119,8 @@ github.com/swaggo/swag v1.16.3/go.mod h1:DImHIuOFXKpMFAQjcC7FG4m3Dg4+QuUgUzJmKjI
11191119
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc=
11201120
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs=
11211121
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48=
1122-
github.com/taikoxyz/optimism v0.0.0-20240504104604-6c9729321b29 h1:JcOxHwY5zQfqsjx2Uh9WwWkcwy5jJX3XR2YQEx3IByY=
1123-
github.com/taikoxyz/optimism v0.0.0-20240504104604-6c9729321b29/go.mod h1:bkiRWtDE4T9nXmaK5NBKC/buX5GnyJ6VKozGFwiwKxs=
1122+
github.com/taikoxyz/optimism v0.0.0-20240508063202-db34e8c760ea h1:+oLT2sxS+KLgHZVW4toyKavAMbgjYkFOiL0YpciATnQ=
1123+
github.com/taikoxyz/optimism v0.0.0-20240508063202-db34e8c760ea/go.mod h1:bkiRWtDE4T9nXmaK5NBKC/buX5GnyJ6VKozGFwiwKxs=
11241124
github.com/taikoxyz/taiko-geth v0.0.0-20240504072040-7e1b8b65a3f8 h1:z4juQ4Nyp2T836JTCNC8t3vrbr0K9v2pPUV/ir2dy9s=
11251125
github.com/taikoxyz/taiko-geth v0.0.0-20240504072040-7e1b8b65a3f8/go.mod h1:nqByouVW0a0qx5KKgvYgoXba+pYEHznAAQp6LhZilgM=
11261126
github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA=

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)