Skip to content

Commit

Permalink
feat(all): update client softwares based on the new protocol upgrade (t…
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha authored Apr 4, 2023
1 parent d21093a commit d44ae1b
Show file tree
Hide file tree
Showing 57 changed files with 2,137 additions and 2,130 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: 1.19
cache: true

- name: Lint
Expand Down Expand Up @@ -45,11 +45,15 @@ jobs:
with:
repository: taikoxyz/taiko-mono
path: ${{ env.TAIKO_MONO_DIR }}
ref: major_protocol_upgrade_rebase

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: 1.19
cache: true
cache-dependency-path: ${{ env.CLIENT_DIR }}/go.sum

Expand Down Expand Up @@ -81,7 +85,7 @@ jobs:
- name: Install protocol dependencies
working-directory: ${{ env.TAIKO_MONO_DIR }}
run: cd ./packages/protocol && pnpm install && ./scripts/download_solc.sh
run: cd ./packages/protocol && pnpm install && ./script/download_solc.sh && forge install

- name: Build
working-directory: ${{ env.CLIENT_DIR }}
Expand Down
6 changes: 6 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ issues:
- path: bindings/encoding/custom_error.go
linters:
- errorlint
- path: pkg/tx_list_validator/tx_list_validator_test.go
linters:
- typecheck
- path: prover/proof_submitter/merkle_proof_test.go
linters:
- typecheck

linters:
disable-all: true
Expand Down
2 changes: 1 addition & 1 deletion bindings/.githead
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20fac4c7430c633c1b1418baf11be16ac342fb3d
f91185bbb3eb75cd8d3e36991c9a47cd51203f21
5 changes: 3 additions & 2 deletions bindings/constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
var (
// Account address and private key of golden touch account, defined in protocol's LibAnchorSignature.
// ref: https://github.com/taikoxyz/taiko-mono/blob/main/packages/protocol/contracts/libs/LibAnchorSignature.sol
GoldenTouchAddress = common.HexToAddress("0x0000777735367b36bC9B61C50022d9D0700dB4Ec")
GoldenTouchPrivKey = "0x92954368afd3caa1f3ce3ead0069c1af414054aefe1ef9aeacc1bf426222ce38"
GoldenTouchAddress = common.HexToAddress("0x0000777735367b36bC9B61C50022d9D0700dB4Ec")
GoldenTouchPrivKey = "0x92954368afd3caa1f3ce3ead0069c1af414054aefe1ef9aeacc1bf426222ce38"
AnchorGasLimit uint64 = 250_000 // TODO: update this value
)
15 changes: 7 additions & 8 deletions bindings/encoding/custom_error_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,26 @@ import (

"github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/require"
"github.com/taikoxyz/taiko-client/testutils"
)

type testJsonError struct{}

func (e *testJsonError) Error() string { return common.Bytes2Hex(testutils.RandomBytes(10)) }
func (e *testJsonError) Error() string { return common.Bytes2Hex(randomBytes(10)) }

func (e *testJsonError) ErrorData() interface{} { return "0xb6d363fd" }
func (e *testJsonError) ErrorData() interface{} { return "0x3b67b808" }

func TestTryParsingCustomError(t *testing.T) {
randomErr := common.Bytes2Hex(testutils.RandomBytes(10))
randomErr := common.Bytes2Hex(randomBytes(10))
require.Equal(t, randomErr, TryParsingCustomError(errors.New(randomErr)).Error())

err := TryParsingCustomError(errors.New(
// L1_COMMITTED
"VM Exception while processing transaction: reverted with an unrecognized custom error (return data: 0xb6d363fd)",
// L1_FORK_CHOICE_NOT_FOUND
"VM Exception while processing transaction: reverted with an unrecognized custom error (return data: 0x3b67b808)",
))

require.True(t, strings.HasPrefix(err.Error(), "L1_COMMITTED"))
require.True(t, strings.HasPrefix(err.Error(), "L1_FORK_CHOICE_NOT_FOUND"))

err = TryParsingCustomError(&testJsonError{})

require.True(t, strings.HasPrefix(err.Error(), "L1_COMMITTED"))
require.True(t, strings.HasPrefix(err.Error(), "L1_FORK_CHOICE_NOT_FOUND"))
}
Loading

0 comments on commit d44ae1b

Please sign in to comment.