Skip to content

Commit

Permalink
Integrate warp non compatible changes (#42)
Browse files Browse the repository at this point in the history
* new predicate utils for tx

* update subnet-evm commit to v0.5.6

* update abi and receiveCrossChainMessage for index parameter

* update teleporter deployment

* receiveCrossChainMessage packing

* update deploy files

* update abi for teleporter

* test added buffer gas

* add comment and remove extra gas

* update messageIndex parameter and abi references

* update ci with v0.5.6

* update unit test go version

* update versions and use subnet-evm rpc

* update warp genesis and fix typo
  • Loading branch information
minghinmatthewlam authored Sep 26, 2023
1 parent 9e80165 commit 9670b8d
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 29 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
- "*"

env:
GO_VERSION: "1.20.7"
GO_VERSION: "1.20.8"

jobs:
e2e_tests:
Expand All @@ -24,7 +24,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: ava-labs/subnet-evm
ref: v0.5.4
ref: v0.5.6

- name: Setup Go
uses: actions/setup-go@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ name: Tests
on:
push:
branches:
- '*'
- "*"

env:
GO_VERSION: "1.20.7"
GO_VERSION: "1.20.8"

jobs:
test_relayer:
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### Build Stage ###
FROM golang:1.20.7-bullseye as build
FROM golang:1.20.8-bullseye as build

WORKDIR /go/src
# Copy the code into the container
Expand All @@ -9,7 +9,7 @@ RUN go mod tidy
RUN bash ./scripts/build.sh

### RUN Stage ###
FROM golang:1.20.7
FROM golang:1.20.8
COPY --from=build /go/src/build/awm-relayer /usr/bin/awm-relayer
EXPOSE 8080
USER 1001
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ module github.com/ava-labs/awm-relayer
go 1.18

require (
github.com/ava-labs/avalanche-network-runner v1.7.2-0.20230825150237-723bc7b31724
github.com/ava-labs/avalanchego v1.10.9
github.com/ava-labs/coreth v0.12.5-rc.3
github.com/ava-labs/subnet-evm v0.5.4
github.com/ava-labs/avalanche-network-runner v1.7.2
github.com/ava-labs/avalanchego v1.10.10
github.com/ava-labs/subnet-evm v0.5.6
github.com/ethereum/go-ethereum v1.12.0
github.com/onsi/ginkgo/v2 v2.12.0
github.com/onsi/gomega v1.27.10
Expand All @@ -21,6 +20,7 @@ require (

require (
github.com/Microsoft/go-winio v0.5.2 // indirect
github.com/ava-labs/coreth v0.12.5-rc.6 // indirect
github.com/cockroachdb/errors v1.9.1 // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/pebble v0.0.0-20230209160836-829675f94811 // indirect
Expand Down
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah
github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/ava-labs/avalanche-network-runner v1.7.2-0.20230825150237-723bc7b31724 h1:ptqFgQtJ5DyLb2lvuvawLJNlvo1A1qv+JXYTneNeg14=
github.com/ava-labs/avalanche-network-runner v1.7.2-0.20230825150237-723bc7b31724/go.mod h1:euKHwZ77sGvGfhVj4v9WPM4jD2b5N80ldE2XHqO7lwA=
github.com/ava-labs/avalanchego v1.10.9 h1:qxhp3YoD2Wm/iIKP6Wb1isbkUPWmIrJxWgivDoL0obM=
github.com/ava-labs/avalanchego v1.10.9/go.mod h1:C8R5uiltpc8MQ62ixxgODR+15mesWF0aAw3H+Qrl9Iw=
github.com/ava-labs/coreth v0.12.5-rc.3 h1:cpmC+fSZMsO4gaFWqXHzAHrJACf05u5HPAYmwh7nmkU=
github.com/ava-labs/coreth v0.12.5-rc.3/go.mod h1:HI+jTIflnDFBd0bledgkgid1Uurwr8q1h7zb3LsFsSo=
github.com/ava-labs/subnet-evm v0.5.4 h1:4+UHva8rhGlvH4gDYpI0Lt6/J5ie1DqQa6kEmbebArI=
github.com/ava-labs/subnet-evm v0.5.4/go.mod h1:PAyhfYnECzA17N62i7OAdKazjfSsN2l8KR5nOspg39I=
github.com/ava-labs/avalanche-network-runner v1.7.2 h1:XFad/wZfYzDnqbLzPAPPRYU3a1Zc8QT8x5dtLTS3lUo=
github.com/ava-labs/avalanche-network-runner v1.7.2/go.mod h1:naLveusSrP7YgTAqRykD1SyLOAUilCp9jGjk3MDxoPI=
github.com/ava-labs/avalanchego v1.10.10 h1:EYX4LVotcfdtIQ0nJSBTcoisubx/Bzk2tM1aP3yiYiw=
github.com/ava-labs/avalanchego v1.10.10/go.mod h1:6UA0nxxTvvpyuCbP2DSzx9+7uWQfQx9DPApK8JptLiE=
github.com/ava-labs/coreth v0.12.5-rc.6 h1:OajGUyKkO5Q82XSuMa8T5UD6QywtCHUiZ4Tv3RFmRBU=
github.com/ava-labs/coreth v0.12.5-rc.6/go.mod h1:s5wVyy+5UCCk2m0Tq3jVmy0UqOpKBDYqRE13gInCJVs=
github.com/ava-labs/subnet-evm v0.5.6 h1:u+xBvEExOa362Up02hgSgeF+aqDona57whhRIeEIim8=
github.com/ava-labs/subnet-evm v0.5.6/go.mod h1:desGY3ghT+Ner+oqxeovwF37eM4dmMQbYZECONPQU9w=
github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
Expand Down
4 changes: 2 additions & 2 deletions messages/teleporter/abi.go

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion messages/teleporter/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ type TeleporterMessageReceipt struct {

// ReceiveCrossChainMessageInput is the input to receiveCrossChainMessage call
// in the contract deployed on the destination chain
// - messageIndex: specifies the warp message in the transaction's storage slots.
type ReceiveCrossChainMessageInput struct {
MessageIndex uint32 `json:"messageIndex"`
RelayerRewardAddress common.Address `json:"relayerRewardAddress"`
}

Expand Down Expand Up @@ -69,7 +71,7 @@ func UnpackTeleporterMessage(messageBytes []byte) (*TeleporterMessage, error) {

// PackReceiveCrossChainMessage packs a ReceiveCrossChainMessageInput to form a call to the receiveCrossChainMessage function
func PackReceiveCrossChainMessage(inputStruct ReceiveCrossChainMessageInput) ([]byte, error) {
return EVMTeleporterContractABI.Pack("receiveCrossChainMessage", inputStruct.RelayerRewardAddress)
return EVMTeleporterContractABI.Pack("receiveCrossChainMessage", inputStruct.MessageIndex, inputStruct.RelayerRewardAddress)
}

// PackMessageReceived packs a MessageReceivedInput to form a call to the messageReceived function
Expand Down
1 change: 1 addition & 0 deletions messages/teleporter/message_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ func (m *messageManager) SendMessage(signedMessage *warp.Message, parsedVmPayloa
}
// Construct the transaction call data to call the receive cross chain message method of the receiver precompile.
callData, err := PackReceiveCrossChainMessage(ReceiveCrossChainMessageInput{
MessageIndex: uint32(0),
RelayerRewardAddress: common.HexToAddress(m.messageConfig.RewardAddress),
})
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions scripts/versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# See the file LICENSE for licensing terms.

# Set up the versions to be used
AWM_RELAYER_VERSION=${AWM_RELAYER_VERSION:-'v0.2.1'}
SUBNET_EVM_VERSION=${SUBNET_EVM_VERSION:-'v0.5.4'}
AWM_RELAYER_VERSION=${AWM_RELAYER_VERSION:-'v0.2.2'}
SUBNET_EVM_VERSION=${SUBNET_EVM_VERSION:-'v0.5.6'}
# Don't export them as they're used in the context of other calls
AVALANCHE_VERSION=${AVALANCHE_VERSION:-'v1.10.9'}
AVALANCHE_VERSION=${AVALANCHE_VERSION:-'v1.10.10'}
GINKGO_VERSION=${GINKGO_VERSION:-'v2.2.0'}
2 changes: 1 addition & 1 deletion tests/UniversalTeleporterDeployerAddress.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0x49db6B95B7005c0adfac0629cb1Ac77ADbDEDafE
0x0aD891d31C69D4dB03F180EF74Af6Da07bB300BF
2 changes: 1 addition & 1 deletion tests/UniversalTeleporterDeployerTransaction.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/UniversalTeleporterMessengerContractAddress.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0xF3106362ca2B4291DE3e130Cd0335F0eC4d70b26
0xc16964cD2D22559A24401A8E491391390B564F0B
4 changes: 2 additions & 2 deletions tests/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import (
"github.com/ava-labs/awm-relayer/messages/teleporter"
"github.com/ava-labs/awm-relayer/peers"
relayerEvm "github.com/ava-labs/awm-relayer/vms/evm"
"github.com/ava-labs/coreth/rpc"
"github.com/ava-labs/subnet-evm/core/types"
"github.com/ava-labs/subnet-evm/ethclient"
"github.com/ava-labs/subnet-evm/plugin/evm"
"github.com/ava-labs/subnet-evm/rpc"
"github.com/ava-labs/subnet-evm/tests/utils/runner"
predicateutils "github.com/ava-labs/subnet-evm/utils/predicate"
warpPayload "github.com/ava-labs/subnet-evm/warp/payload"
Expand Down Expand Up @@ -511,7 +511,7 @@ var _ = ginkgo.Describe("[Relayer E2E]", ginkgo.Ordered, func() {
_ = relayerCmd.Wait()
})

ginkgo.It("Validate Received Warp Message Values", ginkgo.Label("Relaery", "VerifyWarp"), func() {
ginkgo.It("Validate Received Warp Message Values", ginkgo.Label("Relayer", "VerifyWarp"), func() {
Expect(receivedWarpMessage.SourceChainID).Should(Equal(blockchainIDA))
addressedPayload, err := warpPayload.ParseAddressedPayload(receivedWarpMessage.Payload)
Expect(err).Should(BeNil())
Expand Down
1 change: 1 addition & 0 deletions tests/warp-genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"istanbulBlock": 0,
"muirGlacierBlock": 0,
"subnetEVMTimestamp": 0,
"dUpgradeTimestamp": 0,
"feeConfig": {
"gasLimit": 20000000,
"minBaseFee": 1000000000,
Expand Down

0 comments on commit 9670b8d

Please sign in to comment.