Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

Commit

Permalink
feat(bindings): update Go contract bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha committed Mar 19, 2024
1 parent 995b449 commit 8da84bc
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 57 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "Push docker image to GCR"

on:
push:
branches: [main]
branches: [main,bindings-private]
tags:
- "v*"

Expand Down
2 changes: 1 addition & 1 deletion bindings/.githead
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c2d7d6e16ca85e46943af9b520f986921f7b897d
2fba92262869fc58665172ca55c987abc2262368
2 changes: 1 addition & 1 deletion bindings/gen_taiko_l1.go

Large diffs are not rendered by default.

65 changes: 24 additions & 41 deletions bindings/gen_taiko_l2.go

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions driver/chain_syncer/calldata/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ func (s *Syncer) insertNewHead(
}

// Get L2 baseFee
baseFee, err := s.rpc.TaikoL2.GetBasefee(
baseFeeInfo, err := s.rpc.TaikoL2.GetBasefee(
&bind.CallOpts{BlockNumber: parent.Number, Context: ctx},
event.Meta.L1Height,
uint32(parent.GasUsed),
Expand All @@ -332,7 +332,7 @@ func (s *Syncer) insertNewHead(
log.Info(
"L2 baseFee",
"blockID", event.BlockId,
"baseFee", baseFee,
"baseFee", baseFeeInfo.Basefee,
"syncedL1Height", event.Meta.L1Height,
"parentGasUsed", parent.GasUsed,
)
Expand All @@ -349,7 +349,7 @@ func (s *Syncer) insertNewHead(
new(big.Int).SetUint64(event.Meta.L1Height),
event.Meta.L1Hash,
new(big.Int).Add(parent.Number, common.Big1),
baseFee,
baseFeeInfo.Basefee,
parent.GasUsed,
)
if err != nil {
Expand All @@ -370,7 +370,7 @@ func (s *Syncer) insertNewHead(
l1Origin,
headBlockID,
txListBytes,
baseFee,
baseFeeInfo.Basefee,
withdrawals,
)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions internal/testutils/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func (s *ClientTestSuite) ProposeAndInsertValidBlock(
close(sink)
}()

baseFee, err := s.RPCClient.TaikoL2.GetBasefee(nil, 0, uint32(l2Head.GasUsed))
baseFeeInfo, err := s.RPCClient.TaikoL2.GetBasefee(nil, 0, uint32(l2Head.GasUsed))
s.Nil(err)

nonce, err := s.RPCClient.L2.PendingNonceAt(context.Background(), s.TestAddr)
Expand All @@ -123,7 +123,7 @@ func (s *ClientTestSuite) ProposeAndInsertValidBlock(
common.BytesToAddress(RandomBytes(32)),
common.Big1,
100000,
baseFee,
baseFeeInfo.Basefee,
[]byte{},
)
signedTx, err := types.SignTx(tx, types.LatestSignerForChainID(s.RPCClient.L2.ChainID), s.TestAddrPrivKey)
Expand Down
6 changes: 3 additions & 3 deletions pkg/rpc/methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ func (c *Client) GetPoolContent(
return nil, err
}

baseFee, err := c.TaikoL2.GetBasefee(
baseFeeInfo, err := c.TaikoL2.GetBasefee(
&bind.CallOpts{Context: ctx},
uint64(time.Now().Unix())-l2Head.Time,
uint32(l2Head.GasUsed),
Expand All @@ -254,7 +254,7 @@ func (c *Client) GetPoolContent(
return nil, err
}

log.Info("Current base fee", "fee", baseFee)
log.Info("Current base fee", "fee", baseFeeInfo.Basefee)

var localsArg []string
for _, local := range locals {
Expand All @@ -267,7 +267,7 @@ func (c *Client) GetPoolContent(
&result,
"taiko_txPoolContent",
beneficiary,
baseFee,
baseFeeInfo.Basefee,
blockMaxGasLimit,
maxBytesPerTxList,
localsArg,
Expand Down
4 changes: 2 additions & 2 deletions pkg/rpc/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func TestL1ContentFrom(t *testing.T) {
l2Head, err := client.L2.HeaderByNumber(context.Background(), nil)
require.Nil(t, err)

baseFee, err := client.TaikoL2.GetBasefee(nil, 0, uint32(l2Head.GasUsed))
baseFeeInfo, err := client.TaikoL2.GetBasefee(nil, 0, uint32(l2Head.GasUsed))
require.Nil(t, err)

testAddrPrivKey, err := crypto.ToECDSA(common.FromHex(os.Getenv("L1_PROPOSER_PRIVATE_KEY")))
Expand All @@ -56,7 +56,7 @@ func TestL1ContentFrom(t *testing.T) {
testAddr,
common.Big1,
100000,
baseFee,
baseFeeInfo.Basefee,
[]byte{},
)
signedTx, err := types.SignTx(tx, types.LatestSignerForChainID(client.L2.ChainID), testAddrPrivKey)
Expand Down
4 changes: 2 additions & 2 deletions proposer/proposer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ func (s *ProposerTestSuite) TestProposeOp() {
parent, err := s.p.rpc.L2.BlockByNumber(context.Background(), nil)
s.Nil(err)

baseFee, err := s.p.rpc.TaikoL2.GetBasefee(nil, 1, uint32(parent.GasUsed()))
baseFeeInfo, err := s.p.rpc.TaikoL2.GetBasefee(nil, 1, uint32(parent.GasUsed()))
s.Nil(err)

to := common.BytesToAddress(testutils.RandomBytes(32))
tx := types.NewTx(&types.DynamicFeeTx{
ChainID: s.RPCClient.L2.ChainID,
Nonce: nonce,
GasTipCap: common.Big0,
GasFeeCap: new(big.Int).SetUint64(baseFee.Uint64() * 2),
GasFeeCap: new(big.Int).SetUint64(baseFeeInfo.Basefee.Uint64() * 2),
Gas: 21000,
To: &to,
Value: common.Big1,
Expand Down

0 comments on commit 8da84bc

Please sign in to comment.