diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 6221dd64..4c273c2f 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -12,7 +12,7 @@ on: - "*" env: - GO_VERSION: "1.20.8" + GO_VERSION: "1.20.10" jobs: e2e_tests: @@ -24,7 +24,7 @@ jobs: uses: actions/checkout@v4 with: repository: ava-labs/subnet-evm - ref: v0.5.6 + ref: v0.5.8 - name: Setup Go uses: actions/setup-go@v4 diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index a1182dbb..95e4ee5a 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -21,7 +21,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v4 with: - go-version: '1.20.7' + go-version: '1.20.10' check-latest: true - name: golangci-lint diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 73996d8c..ddaa30aa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,7 @@ on: - "*" env: - GO_VERSION: "1.20.8" + GO_VERSION: "1.20.10" jobs: test_relayer: diff --git a/README.md b/README.md index 5e56622c..57f04991 100644 --- a/README.md +++ b/README.md @@ -148,6 +148,13 @@ Next, provide the path to the `subnet-evm` repository and the path to a writeabl ```bash ./scripts/e2e_test.sh --local --subnet-evm ~/subnet-evm --data-dir ~/tmp/e2e-test ``` + +The E2E tests use the `TeleporterMessenger` contract deployment transaction specified in the following files: +- `tests/utils/UniversalTeleporterDeployerAddress.txt` +- `tests/utils/UniversalTeleporterDeployerTransaction.txt` +- `tests/utils/UniversalTeleporterMessagerContractAddress.txt` +To update the version of Teleporter used by the E2E tests, update these values with the latest contract deployment information. For more information on how to deploy the Teleporter contract, see the [Teleporter documentation](https://github.com/ava-labs/teleporter/tree/main/utils/contract-deployment). + ### Generate Mocks [Gomock](https://pkg.go.dev/go.uber.org/mock/gomock) is used to generate mocks for testing. To generate mocks, run the following command at the root of the project: diff --git a/go.mod b/go.mod index 32e936de..c43d2032 100644 --- a/go.mod +++ b/go.mod @@ -3,9 +3,9 @@ module github.com/ava-labs/awm-relayer go 1.18 require ( - github.com/ava-labs/avalanchego v1.10.10 - github.com/ava-labs/subnet-evm v0.5.6 - github.com/ava-labs/teleporter v0.0.0-20231018174018-3283c7aeae9e + github.com/ava-labs/avalanchego v1.10.14 + github.com/ava-labs/subnet-evm v0.5.8 + github.com/ava-labs/teleporter v0.0.0-20231107202133-eea4d6312c35 github.com/ethereum/go-ethereum v1.12.0 github.com/onsi/ginkgo/v2 v2.13.0 github.com/onsi/gomega v1.29.0 @@ -20,8 +20,8 @@ require ( require ( github.com/Microsoft/go-winio v0.5.2 // indirect - github.com/ava-labs/avalanche-network-runner v1.7.2 // indirect - github.com/ava-labs/coreth v0.12.5-rc.6 // indirect + github.com/ava-labs/avalanche-network-runner v1.7.3-0.20231026153158-2931f8a448d9 // indirect + github.com/ava-labs/coreth v0.12.7-rc.1 // 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 @@ -40,6 +40,7 @@ require ( github.com/golang-jwt/jwt/v4 v4.3.0 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/pprof v0.0.0-20230207041349-798e818bf904 // indirect + github.com/google/renameio/v2 v2.0.0 // indirect github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect github.com/hashicorp/go-bexpr v0.1.10 // indirect github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect @@ -66,9 +67,11 @@ require ( github.com/subosito/gotenv v1.4.2 // indirect github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect - golang.org/x/exp v0.0.0-20230206171751-46f607a40771 // indirect + golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect golang.org/x/mod v0.12.0 // indirect golang.org/x/tools v0.12.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect gopkg.in/ini.v1 v1.67.0 // indirect ) @@ -96,7 +99,7 @@ require ( github.com/gorilla/mux v1.8.0 // indirect github.com/gorilla/rpc v1.2.0 // indirect github.com/gorilla/websocket v1.4.2 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 // indirect github.com/holiman/big v0.0.0-20221017200358-a027dc42d04e // indirect github.com/holiman/bloomfilter/v2 v2.0.3 // indirect github.com/holiman/uint256 v1.2.3 // indirect @@ -136,8 +139,8 @@ require ( golang.org/x/text v0.13.0 // indirect golang.org/x/time v0.3.0 // indirect gonum.org/v1/gonum v0.11.0 // indirect - google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect - google.golang.org/grpc v1.56.0-dev // indirect + google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 // indirect + google.golang.org/grpc v1.58.3 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 0b17f1e9..694127de 100644 --- a/go.sum +++ b/go.sum @@ -38,7 +38,7 @@ cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3f dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v1.2.0 h1:Rt8g24XnyGTyglgET/PRUNlrUeu9F5L+7FilkXfZgs0= +github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= @@ -61,16 +61,16 @@ 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 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/ava-labs/teleporter v0.0.0-20231018174018-3283c7aeae9e h1:4SQbxrPLaCVvji5t99/loukP5yIQstmXbqBwOGIWwtg= -github.com/ava-labs/teleporter v0.0.0-20231018174018-3283c7aeae9e/go.mod h1:U1XJ7LUucmtAKiDPC0iFwYn3rP5IjH86XuFra+UQips= +github.com/ava-labs/avalanche-network-runner v1.7.3-0.20231026153158-2931f8a448d9 h1:mTxfmBxmV8GSW0PUt0Qj/Obetzsw0gP6dtoNHaKW2+o= +github.com/ava-labs/avalanche-network-runner v1.7.3-0.20231026153158-2931f8a448d9/go.mod h1:M9FC+xU4hQU3Botux8V8j574YETeX6tMvxiOmqLfl5c= +github.com/ava-labs/avalanchego v1.10.14 h1:1jTMrikYD49Pb64ZLUi2z2BnNGLzIGip4fValq6/YfE= +github.com/ava-labs/avalanchego v1.10.14/go.mod h1:En/ti2xoxQqJuN6t9ne2ogckU9leuZzTjl5mbEsfjTc= +github.com/ava-labs/coreth v0.12.7-rc.1 h1:fvjow2Jqkq1RNtW4v2Kx0DdTVp+3+fCY421TxpDDRfM= +github.com/ava-labs/coreth v0.12.7-rc.1/go.mod h1:sNbwitXv4AhLvWpSqy6V8yzkhGFeWBQFD31/xiRDJ5M= +github.com/ava-labs/subnet-evm v0.5.8 h1:CHDCgZFpvKcgAGTiYDOrDXC5My09L8DNct6NsNiEK/U= +github.com/ava-labs/subnet-evm v0.5.8/go.mod h1:gT3NSswQqopAaJ1UVtB/TiViE6H5Ib684M9FCsy7+D8= +github.com/ava-labs/teleporter v0.0.0-20231107202133-eea4d6312c35 h1:u9ELlYbfHV0oFEKyjggkShy5oE8muSrBTyJOCBT+yKE= +github.com/ava-labs/teleporter v0.0.0-20231107202133-eea4d6312c35/go.mod h1:2f5nUzPKKA670kPMUvNtqu9f2l8RmZLPTOhrarvXJjE= 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= @@ -303,6 +303,8 @@ github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20230207041349-798e818bf904 h1:4/hN5RUoecvl+RmJRE2YxKWtnnQls6rQjjW5oV7qg2U= github.com/google/pprof v0.0.0-20230207041349-798e818bf904/go.mod h1:uglQLonpP8qtYCYyzA+8c/9qtqgA3qsXGYqCPKARAFg= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/renameio/v2 v2.0.0 h1:UifI23ZTGY8Tt29JbYFiuyIU3eX+RNFtUwefq9qAhxg= +github.com/google/renameio/v2 v2.0.0/go.mod h1:BtmJXm5YlszgC+TD4HOEEUFgkJP3nLxehU6hfe7jRt4= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -321,8 +323,8 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92Bcuy github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2 h1:gDLXvp5S9izjldquuoAhDzccbskOL6tDC5jMSyx3zxE= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2/go.mod h1:7pdNwVWBBHGiCxa9lAszqCJMbfTISJ7oMftp8+UGV08= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 h1:RtRsiaGvWxcwd8y3BiRZxsylPT8hLWZ5SPcfI+3IDNk= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0/go.mod h1:TzP6duP4Py2pHLVPPQp42aoYI92+PCrVotyR5e8Vqlk= github.com/hashicorp/go-bexpr v0.1.10 h1:9kuI5PFotCboP3dkDYFr/wi0gg0QVbSNz5oFRpxn4uE= github.com/hashicorp/go-bexpr v0.1.10/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= @@ -643,8 +645,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20230206171751-46f607a40771 h1:xP7rWLUr1e1n2xkK5YB4LI0hPEy3LJC6Wk+D4pGlOJg= -golang.org/x/exp v0.0.0-20230206171751-46f607a40771/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df h1:UA2aFVmmsIlefxMk29Dp2juaUSth8Pyn3Tq5Y5mJGME= +golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -964,8 +966,12 @@ google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= +google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 h1:L6iMMGrtzgHsWofoFcihmDEMYeDR9KN/ThbPWGrh++g= +google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5/go.mod h1:oH/ZOT02u4kWEp7oYBGYFFkCdKS/uYR9Z7+0/xuuFp8= +google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d h1:DoPTO70H+bcDXcd39vOqb2viZxgqeBeSGtZ55yZU4/Q= +google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d/go.mod h1:KjSP20unUpOx5kyQUFa7k4OJg0qeJ7DEZflGDu2p6Bk= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= @@ -988,8 +994,8 @@ google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAG google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.56.0-dev h1:3XdSkn+E4E0OxKEID50paHDwVA7cqZVolkHtMFaoQJA= -google.golang.org/grpc v1.56.0-dev/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= +google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ= +google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/main/main.go b/main/main.go index 71cd4096..11d2bf85 100644 --- a/main/main.go +++ b/main/main.go @@ -225,8 +225,6 @@ func runRelayer(logger logging.Logger, "Handling Teleporter submit message log.", zap.String("txId", hex.EncodeToString(txLog.SourceTxID)), zap.String("originChainId", sourceSubnetInfo.ChainID), - zap.String("destinationChainId", txLog.DestinationChainID.String()), - zap.String("destinationChainAddress", txLog.DestinationAddress.String()), zap.String("sourceAddress", txLog.SourceAddress.String()), ) diff --git a/messages/message_manager.go b/messages/message_manager.go index ef3df535..4d946b30 100644 --- a/messages/message_manager.go +++ b/messages/message_manager.go @@ -26,7 +26,9 @@ type MessageManager interface { ShouldSendMessage(warpMessageInfo *vmtypes.WarpMessageInfo, destinationChainID ids.ID) (bool, error) // SendMessage sends the signed message to the destination chain. The payload parsed according to // the VM rules is also passed in, since MessageManager does not assume any particular VM - SendMessage(signedMessage *warp.Message, parsedVMPayload []byte, destinationChainID ids.ID) error + SendMessage(signedMessage *warp.Message, parsedVmPayload []byte, destinationChainID ids.ID) error + // GetDestinationChainID returns the destination chain ID of the destination chain for the given message + GetDestinationChainID(warpMessageInfo *vmtypes.WarpMessageInfo) (ids.ID, error) } // NewMessageManager constructs a MessageManager for a particular message protocol, defined by the message protocol address and config diff --git a/messages/teleporter/message_manager.go b/messages/teleporter/message_manager.go index 2131eed7..a9822f37 100644 --- a/messages/teleporter/message_manager.go +++ b/messages/teleporter/message_manager.go @@ -90,14 +90,31 @@ func isAllowedRelayer(allowedRelayers []common.Address, eoa common.Address) bool return false } +func (m *messageManager) GetDestinationChainID(warpMessageInfo *vmtypes.WarpMessageInfo) (ids.ID, error) { + teleporterMessage, err := m.parseTeleporterMessage(warpMessageInfo.WarpUnsignedMessage.ID(), warpMessageInfo.WarpPayload) + if err != nil { + m.logger.Error( + "Failed get teleporter message.", + zap.String("warpMessageID", warpMessageInfo.WarpUnsignedMessage.ID().String()), + ) + return ids.ID{}, err + } + + // Cache the message so it can be reused in SendMessage + m.teleporterMessageCache.Put(warpMessageInfo.WarpUnsignedMessage.ID(), teleporterMessage) + + return teleporterMessage.DestinationChainID, nil +} + // ShouldSendMessage returns true if the message should be sent to the destination chain func (m *messageManager) ShouldSendMessage(warpMessageInfo *vmtypes.WarpMessageInfo, destinationChainID ids.ID) (bool, error) { - // Unpack the teleporter message and add it to the cache - teleporterMessage, err := teleportermessenger.UnpackTeleporterMessage(warpMessageInfo.WarpPayload) + teleporterMessage, err := m.parseTeleporterMessage(warpMessageInfo.WarpUnsignedMessage.ID(), warpMessageInfo.WarpPayload) if err != nil { m.logger.Error( - "Failed unpacking teleporter message.", + "Failed get teleporter message.", + zap.String("destinationChainID", destinationChainID.String()), zap.String("warpMessageID", warpMessageInfo.WarpUnsignedMessage.ID().String()), + zap.Error(err), ) return false, err } @@ -209,24 +226,15 @@ func (m *messageManager) messageDelivered( // SendMessage extracts the gasLimit and packs the call data to call the receiveCrossChainMessage method of the Teleporter contract, // and dispatches transaction construction and broadcast to the destination client -func (m *messageManager) SendMessage(signedMessage *warp.Message, parsedVMPayload []byte, destinationChainID ids.ID) error { - teleporterMessage, ok := m.teleporterMessageCache.Get(signedMessage.ID()) - if !ok { - m.logger.Debug( - "Teleporter message to send not in cache. Extracting from signed warp message.", +func (m *messageManager) SendMessage(signedMessage *warp.Message, parsedVmPayload []byte, destinationChainID ids.ID) error { + teleporterMessage, err := m.parseTeleporterMessage(signedMessage.ID(), parsedVmPayload) + if err != nil { + m.logger.Error( + "Failed get teleporter message.", zap.String("destinationChainID", destinationChainID.String()), zap.String("warpMessageID", signedMessage.ID().String()), ) - var err error - teleporterMessage, err = teleportermessenger.UnpackTeleporterMessage(parsedVMPayload) - if err != nil { - m.logger.Error( - "Failed unpacking teleporter message.", - zap.String("destinationChainID", destinationChainID.String()), - zap.String("warpMessageID", signedMessage.ID().String()), - ) - return err - } + return err } m.logger.Info( @@ -291,3 +299,27 @@ func (m *messageManager) SendMessage(signedMessage *warp.Message, parsedVMPayloa ) return nil } + +// parseTeleporterMessage returns the Warp message's corresponding Teleporter message from the cache if it exists. +// Otherwise parses the Warp message payload. +func (m *messageManager) parseTeleporterMessage(warpMessageID ids.ID, warpPayload []byte) (*teleportermessenger.TeleporterMessage, error) { + // Check if the message has already been parsed + teleporterMessage, ok := m.teleporterMessageCache.Get(warpMessageID) + if !ok { + // If not, parse the message + m.logger.Debug( + "Teleporter message to send not in cache. Extracting from signed warp message.", + zap.String("warpMessageID", warpMessageID.String()), + ) + var err error + teleporterMessage, err = teleportermessenger.UnpackTeleporterMessage(warpPayload) + if err != nil { + m.logger.Error( + "Failed unpacking teleporter message.", + zap.String("warpMessageID", warpMessageID.String()), + ) + return nil, err + } + } + return teleporterMessage, nil +} diff --git a/messages/teleporter/message_manager_test.go b/messages/teleporter/message_manager_test.go index 10f3be47..77eeb2d8 100644 --- a/messages/teleporter/message_manager_test.go +++ b/messages/teleporter/message_manager_test.go @@ -68,7 +68,11 @@ func TestShouldSendMessage(t *testing.T) { ) require.NoError(t, err) - validMessageBytes, err := teleportermessenger.PackSendCrossChainMessageEvent(common.HexToHash(destinationChainID.Hex()), validTeleporterMessage) + validMessageBytes, err := teleportermessenger.PackTeleporterMessage(validTeleporterMessage) + require.NoError(t, err) + + validTeleporterMessage.MessageID = big.NewInt(2) + validMessageBytes2, err := teleportermessenger.PackTeleporterMessage(validTeleporterMessage) require.NoError(t, err) messageNotDelivered, err := teleportermessenger.PackMessageReceivedOutput(false) @@ -79,6 +83,9 @@ func TestShouldSendMessage(t *testing.T) { warpUnsignedMessage, err := warp.NewUnsignedMessage(0, ids.Empty, validMessageBytes) require.NoError(t, err) + + warpUnsignedMessage2, err := warp.NewUnsignedMessage(0, ids.Empty, validMessageBytes2) + require.NoError(t, err) testCases := []struct { name string destinationChainID ids.ID @@ -111,7 +118,7 @@ func TestShouldSendMessage(t *testing.T) { name: "invalid message", destinationChainID: destinationChainID, warpMessageInfo: &vmtypes.WarpMessageInfo{ - WarpUnsignedMessage: warpUnsignedMessage, + WarpUnsignedMessage: warpUnsignedMessage2, WarpPayload: []byte{1, 2, 3, 4}, }, expectedError: true, diff --git a/peers/app_request_network.go b/peers/app_request_network.go index b2c60f2b..95596e35 100644 --- a/peers/app_request_network.go +++ b/peers/app_request_network.go @@ -77,7 +77,7 @@ func NewNetwork( return nil, nil, err } - network, err := network.NewTestNetwork(logger, networkID, validators.NewSet(), trackedSubnets, handler) + network, err := network.NewTestNetwork(logger, networkID, validators.NewManager(), trackedSubnets, handler) if err != nil { logger.Error( "Failed to create test network", diff --git a/relayer/message_relayer.go b/relayer/message_relayer.go index a88ca365..05a980ef 100644 --- a/relayer/message_relayer.go +++ b/relayer/message_relayer.go @@ -173,7 +173,7 @@ func (r *messageRelayer) createSignedMessage(requestID uint32) (*warp.Message, e } // Construct the request - req := msg.SignatureRequest{ + req := msg.MessageSignatureRequest{ MessageID: r.warpMessage.ID(), } reqBytes, err := msg.RequestToBytes(codec, req) diff --git a/relayer/relayer.go b/relayer/relayer.go index 0b4742a4..28d207b4 100644 --- a/relayer/relayer.go +++ b/relayer/relayer.go @@ -187,16 +187,6 @@ func NewRelayer( // RelayMessage relays a single warp message to the destination chain. Warp message relay requests from the same origin chain are processed serially func (r *Relayer) RelayMessage(warpLogInfo *vmtypes.WarpLogInfo, metrics *MessageRelayerMetrics, messageCreator message.Creator) error { - // Check that the destination chain ID is supported - if !r.CheckSupportedDestination(warpLogInfo.DestinationChainID) { - r.logger.Debug( - "Message destination chain ID not supported. Not relaying.", - zap.String("chainID", r.sourceChainID.String()), - zap.String("destinationChainID", warpLogInfo.DestinationChainID.String()), - ) - return nil - } - r.logger.Info( "Relaying message", zap.String("chainID", r.sourceChainID.String()), @@ -229,8 +219,27 @@ func (r *Relayer) RelayMessage(warpLogInfo *vmtypes.WarpLogInfo, metrics *Messag return nil } + destinationChainID, err := messageManager.GetDestinationChainID(warpMessageInfo) + if err != nil { + r.logger.Error( + "Failed to get destination chain ID", + zap.Error(err), + ) + return err + } + + // Check that the destination chain ID is supported + if !r.CheckSupportedDestination(destinationChainID) { + r.logger.Debug( + "Message destination chain ID not supported. Not relaying.", + zap.String("chainID", r.sourceChainID.String()), + zap.String("destinationChainID", destinationChainID.String()), + ) + return nil + } + // Create and run the message relayer to attempt to deliver the message to the destination chain - messageRelayer := newMessageRelayer(r.logger, metrics, r, warpMessageInfo.WarpUnsignedMessage, warpLogInfo.DestinationChainID, r.responseChan, messageCreator) + messageRelayer := newMessageRelayer(r.logger, metrics, r, warpMessageInfo.WarpUnsignedMessage, destinationChainID, r.responseChan, messageCreator) if err != nil { r.logger.Error( "Failed to create message relayer", diff --git a/scripts/versions.sh b/scripts/versions.sh index fe379988..cf471489 100755 --- a/scripts/versions.sh +++ b/scripts/versions.sh @@ -4,7 +4,7 @@ # Set up the versions to be used AWM_RELAYER_VERSION=${AWM_RELAYER_VERSION:-'v0.2.2'} -SUBNET_EVM_VERSION=${SUBNET_EVM_VERSION:-'v0.5.6'} +SUBNET_EVM_VERSION=${SUBNET_EVM_VERSION:-'v0.5.8'} # Don't export them as they're used in the context of other calls -AVALANCHE_VERSION=${AVALANCHE_VERSION:-'v1.10.10'} +AVALANCHE_VERSION=${AVALANCHE_VERSION:-'v1.10.14'} GINKGO_VERSION=${GINKGO_VERSION:-'v2.2.0'} diff --git a/tests/basic_relay.go b/tests/basic_relay.go index 6d9cda42..cee885a5 100644 --- a/tests/basic_relay.go +++ b/tests/basic_relay.go @@ -13,13 +13,14 @@ import ( "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/utils/logging" avalancheWarp "github.com/ava-labs/avalanchego/vms/platformvm/warp" + warpPayload "github.com/ava-labs/avalanchego/vms/platformvm/warp/payload" "github.com/ava-labs/awm-relayer/config" "github.com/ava-labs/awm-relayer/database" "github.com/ava-labs/awm-relayer/peers" testUtils "github.com/ava-labs/awm-relayer/tests/utils" "github.com/ava-labs/subnet-evm/core/types" - predicateutils "github.com/ava-labs/subnet-evm/utils/predicate" - warpPayload "github.com/ava-labs/subnet-evm/warp/payload" + predicateutils "github.com/ava-labs/subnet-evm/predicate" + subnetevmutils "github.com/ava-labs/subnet-evm/utils" "github.com/ava-labs/subnet-evm/x/warp" teleportermessenger "github.com/ava-labs/teleporter/abi-bindings/go/Teleporter/TeleporterMessenger" teleporterTestUtils "github.com/ava-labs/teleporter/tests/utils" @@ -54,6 +55,7 @@ func BasicRelay() { teleporterMessage := teleportermessenger.TeleporterMessage{ MessageID: big.NewInt(1), SenderAddress: fundedAddress, + DestinationChainID: subnetBInfo.BlockchainID, DestinationAddress: fundedAddress, RequiredGasLimit: big.NewInt(1), AllowedRelayerAddresses: []common.Address{}, @@ -149,11 +151,11 @@ func BasicRelay() { relayerCmd, relayerCancel = testUtils.RunRelayerExecutable(ctx, relayerConfigPath) log.Info("Packing teleporter message") - payload, err = teleportermessenger.PackSendCrossChainMessageEvent(common.Hash(subnetBInfo.BlockchainID), teleporterMessage) + payload, err = teleportermessenger.PackTeleporterMessage(teleporterMessage) Expect(err).Should(BeNil()) input := teleportermessenger.TeleporterMessageInput{ - DestinationChainID: subnetBInfo.BlockchainID, + DestinationChainID: teleporterMessage.DestinationChainID, DestinationAddress: teleporterMessage.DestinationAddress, FeeInfo: teleportermessenger.TeleporterFeeInfo{ ContractAddress: fundedAddress, @@ -208,7 +210,7 @@ func BasicRelay() { // Check the transaction storage key has warp message we're expecting storageKeyHashes := accessLists[0].StorageKeys - packedPredicate := predicateutils.HashSliceToBytes(storageKeyHashes) + packedPredicate := subnetevmutils.HashSliceToBytes(storageKeyHashes) predicateBytes, err := predicateutils.UnpackPredicate(packedPredicate) Expect(err).Should(BeNil()) receivedWarpMessage, err = avalancheWarp.ParseMessage(predicateBytes) @@ -240,19 +242,18 @@ func BasicRelay() { // log.Info("Validating received warp message") Expect(receivedWarpMessage.SourceChainID).Should(Equal(subnetAInfo.BlockchainID)) - addressedPayload, err := warpPayload.ParseAddressedPayload(receivedWarpMessage.Payload) + addressedPayload, err := warpPayload.ParseAddressedCall(receivedWarpMessage.Payload) Expect(err).Should(BeNil()) - receivedDestinationID, err := ids.ToID(addressedPayload.DestinationChainID.Bytes()) - Expect(err).Should(BeNil()) - Expect(receivedDestinationID).Should(Equal(subnetBInfo.BlockchainID)) - Expect(addressedPayload.DestinationAddress).Should(Equal(teleporterContractAddress)) Expect(addressedPayload.Payload).Should(Equal(payload)) // Check that the teleporter message is correct receivedTeleporterMessage, err := teleportermessenger.UnpackTeleporterMessage(addressedPayload.Payload) Expect(err).Should(BeNil()) Expect(*receivedTeleporterMessage).Should(Equal(teleporterMessage)) + receivedDestinationID, err := ids.ToID(receivedTeleporterMessage.DestinationChainID[:]) + Expect(err).Should(BeNil()) + Expect(receivedDestinationID).Should(Equal(subnetBInfo.BlockchainID)) // // Try Relaying Already Delivered Message diff --git a/tests/utils/UniversalTeleporterDeployerAddress.txt b/tests/utils/UniversalTeleporterDeployerAddress.txt index 9e65584f..80ae4a64 100755 --- a/tests/utils/UniversalTeleporterDeployerAddress.txt +++ b/tests/utils/UniversalTeleporterDeployerAddress.txt @@ -1 +1 @@ -0x0aD891d31C69D4dB03F180EF74Af6Da07bB300BF \ No newline at end of file +0xC840476116736863Eb958bfba0edfa53143db5f7 \ No newline at end of file diff --git a/tests/utils/UniversalTeleporterDeployerTransaction.txt b/tests/utils/UniversalTeleporterDeployerTransaction.txt index e539b764..d48db500 100755 --- a/tests/utils/UniversalTeleporterDeployerTransaction.txt +++ b/tests/utils/UniversalTeleporterDeployerTransaction.txt @@ -1 +1 @@ -0xf92f2d80860246139ca800833d09008080b92ed960a06040523480156200001157600080fd5b506001600081905580556040805163084279ef60e31b8152905173020000000000000000000000000000000000000591634213cf789160048083019260209291908290030181865afa1580156200006c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200009291906200009b565b608052620000b5565b600060208284031215620000ae57600080fd5b5051919050565b608051612e01620000d86000396000818161047a0152610c500152612e016000f3fe608060405234801561001057600080fd5b50600436106101735760003560e01c806366533d12116100de578063c473eef811610097578063cd3f2daa11610071578063cd3f2daa14610462578063d127dc9b14610475578063df20e8bc1461049c578063e03555df146104af57600080fd5b8063c473eef8146103eb578063c9bb114314610424578063ccb5f8091461044f57600080fd5b806366533d12146102ea578063781f97441461036757806382f2c43a146103905780638f12376f146103c25780639a496900146103ca578063b771b3bc146103dd57600080fd5b806329ec9beb1161013057806329ec9beb1461022d57806333e890fe1461024d5780635bf91119146102815780636192762c1461028957806362448850146102b457806365171908146102c757600080fd5b8063105343711461017857806319570c74146101935780631af671f8146101a857806321f18054146101bb578063220c95681461020757806322296c3a1461021a575b600080fd5b610180600581565b6040519081526020015b60405180910390f35b6101a66101a1366004611c5d565b6104e5565b005b6101a66101b6366004611cb4565b61068b565b6101ef6101c9366004611cfa565b60056020908152600092835260408084209091529082529020546001600160a01b031681565b6040516001600160a01b03909116815260200161018a565b610180610215366004611cfa565b6107df565b6101a6610228366004611d1c565b610800565b61018061023b366004611d40565b60026020526000908152604090205481565b6101ef61025b366004611cfa565b60009182526005602090815260408084209284529190529020546001600160a01b031690565b610180600481565b610180610297366004611d59565b600760209081526000928352604080842090915290825290205481565b6101806102c2366004611d92565b61087a565b6102da6102d5366004611e0a565b61092c565b604051901515815260200161018a565b61033c6102f8366004611cfa565b60046020908152600092835260408084208252918352918190208054825180840190935260018201546001600160a01b031683526002909101549282019290925282565b6040805192835281516001600160a01b0316602080850191909152909101519082015260600161018a565b6101ef610375366004611d40565b6003602052600090815260409020546001600160a01b031681565b6103a361039e366004611cfa565b610973565b604080516001600160a01b03909316835260208301919091520161018a565b610180604481565b6101806103d8366004611e5e565b6109bc565b6101ef6005600160991b0181565b6101806103f9366004611d59565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205490565b610180610432366004611cfa565b600660209081526000928352604080842090915290825290205481565b6101a661045d366004611ef6565b610b3c565b6101a6610470366004611cb4565b610f26565b6101807f000000000000000000000000000000000000000000000000000000000000000081565b6101806104aa366004611d40565b61113f565b6102da6104bd366004611cfa565b60009182526005602090815260408084209284529190529020546001600160a01b0316151590565b6001600054146105085760405163880a040960e01b815260040160405180910390fd5b6002600090815581900361052f57604051632e206d3360e21b815260040160405180910390fd5b6001600160a01b0382166105565760405163338065fb60e11b815260040160405180910390fd5b600084815260046020908152604080832086845290915290205461058d5760405163d68df41f60e01b815260040160405180910390fd5b60008481526004602090815260408083208684529091529020600101546001600160a01b038381169116146105d55760405163338065fb60e11b815260040160405180910390fd5b60006105e1838361114a565b6000868152600460209081526040808320888452909152812060020180549293508392909190610612908490611f33565b90915550506000858152600460209081526040808320878452825291829020825160018201546001600160a01b0316815260029091015491810191909152859187917f28fe05eedf0479c9159e5b6dd2a28c93fa1a408eba22dc801fd9bc493a7fc0c2910160405180910390a350506001600055505050565b6001600054146106ae5760405163880a040960e01b815260040160405180910390fd5b6002600090815582815260046020908152604080832084358452909152902054806106ec576040516328915ac760e01b815260040160405180910390fd5b6000826040516020016106ff91906120d6565b60405160208183030381529060405290508181805190602001201461073757604051638b56642d60e01b815260040160405180910390fd5b8260000135847f7491aecf1f3e24837ce48fd97fc8729fc036cebb3e5078643f3301b72852aa078560405161076c91906120d6565b60405180910390a360405163125ce2d160e11b81526005600160991b01906324b9c5a2906107a2908790309086906004016121f6565b600060405180830381600087803b1580156107bc57600080fd5b505af11580156107d0573d6000803e3d6000fd5b50506001600055505050505050565b60008281526004602090815260408083208484529091529020545b92915050565b3360009081526007602090815260408083206001600160a01b03851684529091528120549081900361084557604051630d1102c760e21b815260040160405180910390fd5b3360008181526007602090815260408083206001600160a01b0387168085529252822091909155610876918361126e565b5050565b600060016000541461089f5760405163880a040960e01b815260040160405180910390fd5b600260005561092182356108b96040850160208601611d1c565b6040850160808601356108cf60a0880188612220565b6108dc60c08a018a612269565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061091c9250508b3590506112d6565b6114b9565b600160005592915050565b600061096b8484848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061171192505050565b949350505050565b6000828152600460209081526040808320848452825291829020825180840190935260018101546001600160a01b031680845260029091015492909101829052905b9250929050565b60006001600054146109e15760405163880a040960e01b815260040160405180910390fd5b60026000908155856001600160401b03811115610a0057610a006122af565b604051908082528060200260200182016040528015610a4557816020015b6040805180820190915260008082526020820152815260200190600190039081610a1e5790505b50905060005b86811015610b06576000888883818110610a6757610a676122c5565b60008d815260056020908152604080832093820295909501358083529290529290922054919250506001600160a01b031680610ab6576040516303bbb48b60e01b815260040160405180910390fd5b6040518060400160405280838152602001826001600160a01b0316815250848481518110610ae657610ae66122c5565b602002602001018190525050508080610afe906122db565b915050610a4b565b5060408051600080825260208201909252610b2b918a918890829089908990886114b9565b600160005598975050505050505050565b6001805414610b5e5760405163a815ca6b60e01b815260040160405180910390fd5b60026001556001600160a01b038116610b8a5760405163f69d505160e01b815260040160405180910390fd5b6040516306f8253560e41b815263ffffffff8316600482015260009081906005600160991b0190636f82535090602401600060405180830381865afa158015610bd7573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610bff91908101906123ec565b9150915080610c2157604051636b2f19e960e01b815260040160405180910390fd5b60208201516001600160a01b03163014610c4e5760405163e942653d60e01b815260040160405180910390fd5b7f0000000000000000000000000000000000000000000000000000000000000000826040015114610c925760405163ba7cf01760e01b815260040160405180910390fd5b60608201516001600160a01b03163014610cbf57604051635209852960e01b815260040160405180910390fd5b60008260800151806020019051810190610cd991906125fa565b83516000908152600560209081526040808320845184529091529020549091506001600160a01b031615610d205760405163d68df41f60e01b815260040160405180910390fd5b610d2e338260800151611711565b610d4b57604051633c20627b60e01b815260040160405180910390fd5b8251600090815260056020908152604080832084518452909152902080546001600160a01b0319166001600160a01b03861617905560c08101515115610d97578251610d979082611786565b60a08101515160005b81811015610df25760008360a001518281518110610dc057610dc06122c5565b60200260200101519050610de1866000015182600001518360200151611888565b50610deb816122db565b9050610da0565b5083516000908152600360205260409020546001600160a01b031680610e6757604051610e1e90611c28565b604051809103906000f080158015610e3a573d6000803e3d6000fd5b508551600090815260036020526040902080546001600160a01b0319166001600160a01b03831617905590505b604080518082018252845181526001600160a01b0388811660208301529151634877bcdd60e11b8152918316916390ef79ba91610ea6916004016126e4565b600060405180830381600087803b158015610ec057600080fd5b505af1158015610ed4573d6000803e3d6000fd5b50505050826000015185600001517f522ce4da81e9fb994bf6a122282939647b6e69817be443f7d1c152e76a082cc785604051610f11919061278a565b60405180910390a35050600180555050505050565b6001805414610f485760405163a815ca6b60e01b815260040160405180910390fd5b600260015560008281526006602090815260408083208435845290915290205480610f86576040516328915ac760e01b815260040160405180910390fd5b8082604051602001610f9891906120d6565b6040516020818303038152906040528051906020012014610fcc57604051638b56642d60e01b815260040160405180910390fd5b610fdc6060830160408401611d1c565b6001600160a01b03163b60000361100657604051635209852960e01b815260040160405180910390fd5b60405182359084907f3d5f30e93c1e27cda0e05a7b9e51144613a816cd90561f8493393bbcf4e0035890600090a36000838152600660209081526040808320853584529091528082208290556110629060608501908501611d1c565b6001600160a01b03168461107c6040860160208701611d1c565b61108960c0870187612269565b60405160240161109c9493929190612819565b60408051601f198184030181529181526020820180516001600160e01b031663643477d560e11b179052516110d19190612844565b6000604051808303816000865af19150503d806000811461110e576040519150601f19603f3d011682016040523d82523d6000602084013e611113565b606091505b50509050806111355760405163990b27a960e01b815260040160405180910390fd5b5050600180555050565b60006107fa82611958565b6040516370a0823160e01b815230600482015260009081906001600160a01b038516906370a0823190602401602060405180830381865afa158015611193573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111b79190612860565b90506111ce6001600160a01b038516333086611972565b6040516370a0823160e01b81523060048201526000906001600160a01b038616906370a0823190602401602060405180830381865afa158015611215573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112399190612860565b905081811161125b57604051632c1e664f60e11b815260040160405180910390fd5b6112658282612879565b95945050505050565b6040516001600160a01b0383166024820152604481018290526112d190849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526119b0565b505050565b6000818152600360205260409020546060906001600160a01b03168061133b576040805160008082526020820190925290611333565b604080518082019091526000808252602082015281526020019060019003908161130c5790505b509392505050565b6000600590506000826001600160a01b031663949d225d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611381573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a59190612860565b905060058110156113b4578091505b816001600160401b038111156113cc576113cc6122af565b60405190808252806020026020018201604052801561141157816020015b60408051808201909152600080825260208201528152602001906001900390816113ea5790505b50935060005b828110156114b057836001600160a01b031663957908d16040518163ffffffff1660e01b815260040160408051808303816000875af115801561145e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611482919061288c565b858281518110611494576114946122c5565b6020026020010181905250806114a9906122db565b9050611417565b50505050919050565b60006114c489611958565b905060006040518060e00160405280838152602001336001600160a01b031681526020018a6001600160a01b031681526020018881526020018787808060200260200160405190810160405280939291908181526020018383602002808284376000920182905250938552505050602080830187905260409283018890529151929350916115549184910161278a565b60408051601f1981840301815291815260008d8152600260209081529181208690559192508a0135156115d457600061159060208c018c611d1c565b6001600160a01b0316036115b75760405163338065fb60e11b815260040160405180910390fd5b6115d16115c760208c018c611d1c565b8b6020013561114a565b90505b60405180604001604052808380519060200120815260200160405180604001604052808d600001602081019061160a9190611d1c565b6001600160a01b03908116825260209182018690529190925260008f8152600483526040808220898352845290819020845181559383015180516001860180546001600160a01b03191691909416179092559101516002909201919091555184908d907f7491aecf1f3e24837ce48fd97fc8729fc036cebb3e5078643f3301b72852aa079061169a90879061278a565b60405180910390a360405163125ce2d160e11b81526005600160991b01906324b9c5a2906116d0908f90309087906004016121f6565b600060405180830381600087803b1580156116ea57600080fd5b505af11580156116fe573d6000803e3d6000fd5b5050505050505098975050505050505050565b60008151600003611724575060016107fa565b60005b825181101561177c57836001600160a01b031683828151811061174c5761174c6122c5565b60200260200101516001600160a01b03160361176c5760019150506107fa565b611775816122db565b9050611727565b5060009392505050565b80606001515a10156117ab576040516307099c5360e21b815260040160405180910390fd5b80604001516001600160a01b03163b6000036117cb576108768282611a87565b600081604001516001600160a01b031682606001518484602001518560c001516040516024016117fd939291906121f6565b60408051601f198184030181529181526020820180516001600160e01b031663643477d560e11b179052516118329190612844565b60006040518083038160008787f1925050503d8060008114611870576040519150601f19603f3d011682016040523d82523d6000602084013e611875565b606091505b50509050806112d1576112d18383611a87565b60008381526004602090815260408083208584528252918290208251808401845281548152835180850190945260018201546001600160a01b03168452600290910154838301529081019190915280516118e25750505050565b600084815260046020908152604080832086845282528083208381556001810180546001600160a01b031916905560020183905583820180518301516001600160a01b038781168652600785528386209251511685529252822080549192909161194d908490611f33565b909155505050505050565b6000818152600260205260408120546107fa906001611f33565b6040516001600160a01b03808516602483015283166044820152606481018290526119aa9085906323b872dd60e01b9060840161129a565b50505050565b6000611a05826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611b059092919063ffffffff16565b8051909150156112d15780806020019051810190611a2391906128a8565b6112d15760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084015b60405180910390fd5b80604051602001611a98919061278a565b60408051601f198184030181528282528051602091820120600086815260068352838120865182529092529190205581519083907f50e5f3de5b0b3e6c82553b7e0f5f7080a291be07aa30a311084a9457f4a956bc90611af990859061278a565b60405180910390a35050565b606061096b848460008585600080866001600160a01b03168587604051611b2c9190612844565b60006040518083038185875af1925050503d8060008114611b69576040519150601f19603f3d011682016040523d82523d6000602084013e611b6e565b606091505b5091509150611b7f87838387611b8a565b979650505050505050565b60608315611bf9578251600003611bf2576001600160a01b0385163b611bf25760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401611a7e565b508161096b565b61096b8383815115611c0e5781518083602001fd5b8060405162461bcd60e51b8152600401611a7e91906128c3565b6104f5806128d783390190565b6001600160a01b0381168114611c4a57600080fd5b50565b8035611c5881611c35565b919050565b60008060008060808587031215611c7357600080fd5b84359350602085013592506040850135611c8c81611c35565b9396929550929360600135925050565b600060e08284031215611cae57600080fd5b50919050565b60008060408385031215611cc757600080fd5b8235915060208301356001600160401b03811115611ce457600080fd5b611cf085828601611c9c565b9150509250929050565b60008060408385031215611d0d57600080fd5b50508035926020909101359150565b600060208284031215611d2e57600080fd5b8135611d3981611c35565b9392505050565b600060208284031215611d5257600080fd5b5035919050565b60008060408385031215611d6c57600080fd5b8235611d7781611c35565b91506020830135611d8781611c35565b809150509250929050565b600060208284031215611da457600080fd5b81356001600160401b03811115611dba57600080fd5b61096b84828501611c9c565b60008083601f840112611dd857600080fd5b5081356001600160401b03811115611def57600080fd5b6020830191508360208260051b85010111156109b557600080fd5b600080600060408486031215611e1f57600080fd5b8335611e2a81611c35565b925060208401356001600160401b03811115611e4557600080fd5b611e5186828701611dc6565b9497909650939450505050565b60008060008060008086880360a0811215611e7857600080fd5b8735965060208801356001600160401b0380821115611e9657600080fd5b611ea28b838c01611dc6565b90985096508691506040603f1984011215611ebc57600080fd5b60408a01955060808a0135925080831115611ed657600080fd5b5050611ee489828a01611dc6565b979a9699509497509295939492505050565b60008060408385031215611f0957600080fd5b823563ffffffff81168114611d7757600080fd5b634e487b7160e01b600052601160045260246000fd5b808201808211156107fa576107fa611f1d565b6000808335601e19843603018112611f5d57600080fd5b83016020810192503590506001600160401b03811115611f7c57600080fd5b8060051b36038213156109b557600080fd5b8183526000602080850194508260005b85811015611fcc578135611fb181611c35565b6001600160a01b031687529582019590820190600101611f9e565b509495945050505050565b6000808335601e19843603018112611fee57600080fd5b83016020810192503590506001600160401b0381111561200d57600080fd5b8060061b36038213156109b557600080fd5b8183526000602080850194508260005b85811015611fcc57813587528282013561204881611c35565b6001600160a01b031687840152604096870196919091019060010161202f565b6000808335601e1984360301811261207f57600080fd5b83016020810192503590506001600160401b0381111561209e57600080fd5b8036038213156109b557600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6020815281356020820152600060208301356120f181611c35565b6001600160a01b031660408381019190915261210e908401611c4d565b6001600160a01b038116606084015250606083013560808301526121356080840184611f46565b60e060a085015261214b61010085018284611f8e565b91505061215b60a0850185611fd7565b601f19808685030160c087015261217384838561201f565b935061218260c0880188612068565b93509150808685030160e08701525061219c8383836120ad565b9695505050505050565b60005b838110156121c15781810151838201526020016121a9565b50506000910152565b600081518084526121e28160208601602086016121a6565b601f01601f19169290920160200192915050565b8381526001600160a01b0383166020820152606060408201819052600090611265908301846121ca565b6000808335601e1984360301811261223757600080fd5b8301803591506001600160401b0382111561225157600080fd5b6020019150600581901b36038213156109b557600080fd5b6000808335601e1984360301811261228057600080fd5b8301803591506001600160401b0382111561229a57600080fd5b6020019150368190038213156109b557600080fd5b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000600182016122ed576122ed611f1d565b5060010190565b60405160a081016001600160401b0381118282101715612316576123166122af565b60405290565b60405160e081016001600160401b0381118282101715612316576123166122af565b604051601f8201601f191681016001600160401b0381118282101715612366576123666122af565b604052919050565b8051611c5881611c35565b600082601f83011261238a57600080fd5b81516001600160401b038111156123a3576123a36122af565b6123b6601f8201601f191660200161233e565b8181528460208386010111156123cb57600080fd5b61096b8260208301602087016121a6565b80518015158114611c5857600080fd5b600080604083850312156123ff57600080fd5b82516001600160401b038082111561241657600080fd5b9084019060a0828703121561242a57600080fd5b6124326122f4565b82518152602083015161244481611c35565b602082015260408381015190820152606083015161246181611c35565b606082015260808301518281111561247857600080fd5b61248488828601612379565b608083015250935061249b915050602084016123dc565b90509250929050565b60006001600160401b038211156124bd576124bd6122af565b5060051b60200190565b600082601f8301126124d857600080fd5b815160206124ed6124e8836124a4565b61233e565b82815260059290921b8401810191818101908684111561250c57600080fd5b8286015b8481101561253057805161252381611c35565b8352918301918301612510565b509695505050505050565b60006040828403121561254d57600080fd5b604051604081018181106001600160401b038211171561256f5761256f6122af565b806040525080915082518152602083015161258981611c35565b6020919091015292915050565b600082601f8301126125a757600080fd5b815160206125b76124e8836124a4565b82815260069290921b840181019181810190868411156125d657600080fd5b8286015b84811015612530576125ec888261253b565b8352918301916040016125da565b60006020828403121561260c57600080fd5b81516001600160401b038082111561262357600080fd5b9083019060e0828603121561263757600080fd5b61263f61231c565b8251815261264f6020840161236e565b60208201526126606040840161236e565b60408201526060830151606082015260808301518281111561268157600080fd5b61268d878286016124c7565b60808301525060a0830151828111156126a557600080fd5b6126b187828601612596565b60a08301525060c0830151828111156126c957600080fd5b6126d587828601612379565b60c08301525095945050505050565b815181526020808301516001600160a01b031690820152604081016107fa565b600081518084526020808501945080840160005b83811015611fcc5781516001600160a01b031687529582019590820190600101612718565b600081518084526020808501945080840160005b83811015611fcc57612777878351805182526020908101516001600160a01b0316910152565b6040969096019590820190600101612751565b60208152815160208201526000602083015160018060a01b038082166040850152806040860151166060850152505060608301516080830152608083015160e060a08401526127dd610100840182612704565b905060a0840151601f19808584030160c08601526127fb838361273d565b925060c08601519150808584030160e08601525061126582826121ca565b8481526001600160a01b038416602082015260606040820181905260009061219c90830184866120ad565b600082516128568184602087016121a6565b9190910192915050565b60006020828403121561287257600080fd5b5051919050565b818103818111156107fa576107fa611f1d565b60006040828403121561289e57600080fd5b611d39838361253b565b6000602082840312156128ba57600080fd5b611d39826123dc565b602081526000611d3960208301846121ca56fe60a06040526000600155600060025534801561001a57600080fd5b50336080526080516104ae6100476000396000818160ac01528181610187015261027d01526104ae6000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c806390ef79ba1161005b57806390ef79ba146100e6578063949d225d146100fb578063957908d114610103578063ddf0b0091461012f57600080fd5b80633df4ddf41461008257806347799da81461009e5780638da5cb5b146100a7575b600080fd5b61008b60015481565b6040519081526020015b60405180910390f35b61008b60025481565b6100ce7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610095565b6100f96100f436600461037b565b61017c565b005b61008b610247565b61010b61025e565b60408051825181526020928301516001600160a01b03169281019290925201610095565b61015f61013d366004610393565b600060208190529081526040902080546001909101546001600160a01b031682565b604080519283526001600160a01b03909116602083015201610095565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146101c4576040516282b42960e81b815260040160405180910390fd5b6002805482916000918291826101d9836103c2565b91905055815260200190815260200160002081816101f791906103f3565b5061020a90506040820160208301610428565b6001600160a01b031681600001357fc4193cc773105974437d05cb715f0f6ec12111aaea921df69ece51d70093f12760405160405180910390a350565b6000600154600254610259919061044c565b905090565b6040805180820190915260008082526020820152336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146102ba576040516282b42960e81b815260040160405180910390fd5b6001546002548190036102e0576040516331dcf2b560e01b815260040160405180910390fd5b600081815260208181526040808320815180830190925280548252600180820180546001600160a01b0381168587015287875294869052949091556001600160a01b0319909216909255909250610338908290610465565b600155602082015182516040516001600160a01b03909216917f05a9686ec81d1f07f4a996660cf66d8c3f2fd0fdfd7bb23458fe7a7df30c9ce790600090a35090565b60006040828403121561038d57600080fd5b50919050565b6000602082840312156103a557600080fd5b5035919050565b634e487b7160e01b600052601160045260246000fd5b6000600182016103d4576103d46103ac565b5060010190565b6001600160a01b03811681146103f057600080fd5b50565b81358155600181016020830135610409816103db565b81546001600160a01b0319166001600160a01b03919091161790555050565b60006020828403121561043a57600080fd5b8135610445816103db565b9392505050565b8181038181111561045f5761045f6103ac565b92915050565b8082018082111561045f5761045f6103ac56fea2646970667358221220ef3b9249e96b862c464779da703fa448652039bb8e3dae0a6fc1a79678d9b35b64736f6c63430008120033a2646970667358221220f98592fa226f2ffcceadb0945b7af3883dae376933c3f3acb263eaf09989a1a964736f6c634300081200331ba03333333333333333333333333333333333333333333333333333333333333333a03333333333333333333333333333333333333333333333333333333333333333 \ No newline at end of file +0xf930bb80860246139ca800833d09008080b93067608060405234801561001057600080fd5b5060016000819055805561303e806100296000396000f3fe608060405234801561001057600080fd5b50600436106101585760003560e01c8063781f9744116100c3578063c9bb11431161007c578063c9bb11431461041a578063ccb5f80914610445578063d127dc9b14610458578063df20e8bc14610461578063e03555df14610474578063fc2d6197146104aa57600080fd5b8063781f97441461033257806382f2c43a1461036e578063892bf412146103a0578063af402850146103c0578063b771b3bc146103d3578063c473eef8146103e157600080fd5b80632bc8b0bf116101155780632bc8b0bf1461022a57806333e890fe1461023d5780636192762c14610271578063624488501461029c57806365171908146102af57806366533d12146102d257600080fd5b8063191eb6981461015d57806319570c741461018357806321f1805414610198578063220c9568146101e457806322296c3a146101f757806329ec9beb1461020a575b600080fd5b61017061016b3660046121f6565b6104bd565b6040519081526020015b60405180910390f35b6101966101913660046122b6565b610683565b005b6101cc6101a63660046122f5565b60056020908152600092835260408084209091529082529020546001600160a01b031681565b6040516001600160a01b03909116815260200161017a565b6101706101f23660046122f5565b6108be565b610196610205366004612317565b6108df565b610170610218366004612334565b60026020526000908152604090205481565b610170610238366004612334565b6109d4565b6101cc61024b3660046122f5565b60009182526005602090815260408084209284529190529020546001600160a01b031690565b61017061027f36600461234d565b600760209081526000928352604080842090915290825290205481565b6101706102aa366004612386565b6109eb565b6102c26102bd3660046123c0565b610aa7565b604051901515815260200161017a565b6103246102e03660046122f5565b60046020908152600092835260408084208252918352918190208054825180840190935260018201546001600160a01b031683526002909101549282019290925282565b60405161017a929190612414565b610359610340366004612334565b6003602052600090815260409020805460019091015482565b6040805192835260208301919091520161017a565b61038161037c3660046122f5565b610af0565b604080516001600160a01b03909316835260208301919091520161017a565b6103b36103ae3660046122f5565b610b39565b60405161017a919061243b565b6101966103ce36600461245b565b610b65565b6101cc6005600160991b0181565b6101706103ef36600461234d565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205490565b6101706104283660046122f5565b600660209081526000928352604080842090915290825290205481565b61019661045336600461249e565b610cfa565b61017060085481565b61017061046f366004612334565b611207565b6102c26104823660046122f5565b60009182526005602090815260408084209284529190529020546001600160a01b0316151590565b6101966104b836600461245b565b611212565b60006001600054146104ea5760405162461bcd60e51b81526004016104e1906124c5565b60405180910390fd5b60026000908155856001600160401b0381111561050957610509612508565b60405190808252806020026020018201604052801561054e57816020015b60408051808201909152600080825260208201528152602001906001900390816105275790505b50905060005b8681101561064d5760008888838181106105705761057061251e565b60008d815260056020908152604080832093820295909501358083529290529290922054919250506001600160a01b0316806105fd5760405162461bcd60e51b815260206004820152602660248201527f54656c65706f727465724d657373656e6765723a2072656365697074206e6f7460448201526508199bdd5b9960d21b60648201526084016104e1565b6040518060400160405280838152602001826001600160a01b031681525084848151811061062d5761062d61251e565b6020026020010181905250505080806106459061254a565b915050610554565b5060408051600080825260208201909252610672918a918890829089908990886114b6565b600160005598975050505050505050565b6001600054146106a55760405162461bcd60e51b81526004016104e1906124c5565b60026000558061070f5760405162461bcd60e51b815260206004820152602f60248201527f54656c65706f727465724d657373656e6765723a207a65726f2061646469746960448201526e1bdb985b0819995948185b5bdd5b9d608a1b60648201526084016104e1565b6001600160a01b0382166107355760405162461bcd60e51b81526004016104e190612563565b600084815260046020908152604080832086845290915290205461076b5760405162461bcd60e51b81526004016104e1906125b7565b60008481526004602090815260408083208684529091529020600101546001600160a01b038381169116146108085760405162461bcd60e51b815260206004820152603760248201527f54656c65706f727465724d657373656e6765723a20696e76616c69642066656560448201527f20617373657420636f6e7472616374206164647265737300000000000000000060648201526084016104e1565b6000610814838361174e565b60008681526004602090815260408083208884529091528120600201805492935083929091906108459084906125fd565b90915550506000858152600460209081526040808320878452825291829020825160018201546001600160a01b0316815260029091015491810191909152859187917f28fe05eedf0479c9159e5b6dd2a28c93fa1a408eba22dc801fd9bc493a7fc0c2910160405180910390a350506001600055505050565b60008281526004602090815260408083208484529091529020545b92915050565b3360009081526007602090815260408083206001600160a01b0385168452909152902054806109615760405162461bcd60e51b815260206004820152602860248201527f54656c65706f727465724d657373656e6765723a206e6f2072657761726420746044820152676f2072656465656d60c01b60648201526084016104e1565b3360008181526007602090815260408083206001600160a01b03871680855290835281842093909355518481529192917f3294c84e5b0f29d9803655319087207bc94f4db29f7927846944822773780b88910160405180910390a36109d06001600160a01b03831633836118b6565b5050565b60008181526003602052604081206108d99061191e565b6000600160005414610a0f5760405162461bcd60e51b81526004016104e1906124c5565b6002600055610a9c8235610a296040850160208601612317565b604085016080860135610a3f60a0880188612610565b610a4c60c08a018a612659565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052508d358152600360205260409020610a97935091506119319050565b6114b6565b600160005592915050565b6000610ae684848480806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611a4392505050565b90505b9392505050565b6000828152600460209081526040808320848452825291829020825180840190935260018101546001600160a01b031680845260029091015492909101829052905b9250929050565b60408051808201909152600080825260208201526000838152600360205260409020610ae99083611ab8565b600160005414610b875760405162461bcd60e51b81526004016104e1906124c5565b60026000818155838152600460209081526040808320853584528252918290208251808401845281548152835180850190945260018201546001600160a01b03168452930154828201528201528051610bf25760405162461bcd60e51b81526004016104e1906125b7565b600082604051602001610c0591906128f4565b60408051601f1981840301815291905282518151602083012091925014610c3e5760405162461bcd60e51b81526004016104e190612907565b8260000135847f0563d357b89128d5a0c37c9b06420836e35d193eaf17f7960fc88e47d1e02f57858560200151604051610c79929190612950565b60405180910390a360405163ee5b48eb60e01b81526005600160991b019063ee5b48eb90610cab9084906004016129d5565b6020604051808303816000875af1158015610cca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cee91906129e8565b50506001600055505050565b6001805414610d1b5760405162461bcd60e51b81526004016104e190612a01565b60026001556001600160a01b038116610d8f5760405162461bcd60e51b815260206004820152603060248201527f54656c65706f727465724d657373656e6765723a207a65726f2072656c61796560448201526f7220726577617264206164647265737360801b60648201526084016104e1565b6040516306f8253560e41b815263ffffffff8316600482015260009081906005600160991b0190636f82535090602401600060405180830381865afa158015610ddc573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610e049190810190612b3f565b9150915080610e675760405162461bcd60e51b815260206004820152602960248201527f54656c65706f727465724d657373656e6765723a20696e76616c69642077617260448201526870206d65737361676560b81b60648201526084016104e1565b60208201516001600160a01b03163014610ede5760405162461bcd60e51b815260206004820152603260248201527f54656c65706f727465724d657373656e6765723a20696e76616c6964206f726960448201527167696e2073656e646572206164647265737360701b60648201526084016104e1565b600854610f52576005600160991b016001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4e91906129e8565b6008555b60008260400151806020019051810190610f6c9190612d0f565b9050600854816040015114610fdd5760405162461bcd60e51b815260206004820152603160248201527f54656c65706f727465724d657373656e6765723a20696e76616c6964206465736044820152701d1a5b985d1a5bdb8818da185a5b881251607a1b60648201526084016104e1565b82516000908152600560209081526040808320845184529091529020546001600160a01b0316156110675760405162461bcd60e51b815260206004820152602e60248201527f54656c65706f727465724d657373656e6765723a206d65737361676520616c7260448201526d1958591e4819195b1a5d995c995960921b60648201526084016104e1565b611075338260a00151611a43565b6110d35760405162461bcd60e51b815260206004820152602960248201527f54656c65706f727465724d657373656e6765723a20756e617574686f72697a6560448201526832103932b630bcb2b960b91b60648201526084016104e1565b8251600090815260056020908152604080832084518452909152902080546001600160a01b0319166001600160a01b03861617905560e0810151511561111f57825161111f9082611b7d565b60c08101515160005b8181101561117a5760008360c0015182815181106111485761114861251e565b60200260200101519050611169866000015182600001518360200151611cee565b506111738161254a565b9050611128565b5083516000908152600360209081526040918290208251808401909352845183526001600160a01b03881691830191909152906111b8908290611dbe565b82518551604051339291907f6b013241f9192863bc66c1f1e9a01dc592c94592bfed5e1ed380808525679575906111f2908b908990612f1f565b60405180910390a45050600180555050505050565b60006108d982611e1a565b60018054146112335760405162461bcd60e51b81526004016104e190612a01565b6002600155600082815260066020908152604080832084358452909152902054806112705760405162461bcd60e51b81526004016104e1906125b7565b808260405160200161128291906128f4565b60405160208183030381529060405280519060200120146112b55760405162461bcd60e51b81526004016104e190612907565b60006112c76080840160608501612317565b6001600160a01b03163b1161133b5760405162461bcd60e51b815260206004820152603460248201527f54656c65706f727465724d657373656e6765723a2064657374696e6174696f6e604482015273206164647265737320686173206e6f20636f646560601b60648201526084016104e1565b60405182359084907f5ad362d54cba0e49d358be9ce586a7136d10a2533579c4460b7e48ec273083ef90600090a360008381526006602090815260408083208535845290915281208190556113966080840160608501612317565b6001600160a01b0316846113b06040860160208701612317565b6113bd60e0870187612659565b6040516024016113d09493929190612f43565b60408051601f198184030181529181526020820180516001600160e01b031663643477d560e11b179052516114059190612f6e565b6000604051808303816000865af19150503d8060008114611442576040519150601f19603f3d011682016040523d82523d6000602084013e611447565b606091505b50509050806114ac5760405162461bcd60e51b815260206004820152602b60248201527f54656c65706f727465724d657373656e6765723a20726574727920657865637560448201526a1d1a5bdb8819985a5b195960aa1b60648201526084016104e1565b5050600180555050565b60006114c189611e1a565b90506000604051806101000160405280838152602001336001600160a01b031681526020018b81526020018a6001600160a01b0316815260200188815260200187878080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509385525050506020808301879052604092830188905291519293509161155891849101612f8a565b60408051601f1981840301815291815260008d8152600260209081529181208690559192508a0135156115d757600061159460208c018c612317565b6001600160a01b0316036115ba5760405162461bcd60e51b81526004016104e190612563565b6115d46115ca60208c018c612317565b8b6020013561174e565b90505b60408051808201909152600090806115f260208e018e612317565b6001600160a01b0316815260200183815250905060405180604001604052808480519060200120815260200182815250600460008f815260200190815260200160002060008781526020019081526020016000206000820151816000015560208201518160010160008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550602082015181600101555050905050848d7f0563d357b89128d5a0c37c9b06420836e35d193eaf17f7960fc88e47d1e02f5786846040516116c8929190612f9d565b60405180910390a360405163ee5b48eb60e01b81526005600160991b019063ee5b48eb906116fa9086906004016129d5565b6020604051808303816000875af1158015611719573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061173d91906129e8565b505050505098975050505050505050565b6040516370a0823160e01b815230600482015260009081906001600160a01b038516906370a0823190602401602060405180830381865afa158015611797573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117bb91906129e8565b90506117d26001600160a01b038516333086611e34565b6040516370a0823160e01b81523060048201526000906001600160a01b038616906370a0823190602401602060405180830381865afa158015611819573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061183d91906129e8565b90508181116118a35760405162461bcd60e51b815260206004820152602c60248201527f5361666545524332305472616e7366657246726f6d3a2062616c616e6365206e60448201526b1bdd081a5b98dc99585cd95960a21b60648201526084016104e1565b6118ad8282612fb0565b95945050505050565b6040516001600160a01b03831660248201526044810182905261191990849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611e72565b505050565b805460018201546000916108d991612fb0565b6060600061193e8361191e565b90508060000361198d576040805160008082526020820190925290611985565b604080518082019091526000808252602082015281526020019060019003908161195e5790505b509392505050565b600581111561199a575060055b806001600160401b038111156119b2576119b2612508565b6040519080825280602002602001820160405280156119f757816020015b60408051808201909152600080825260208201528152602001906001900390816119d05790505b50915060005b81811015611a3c57611a0e84611f44565b838281518110611a2057611a2061251e565b602002602001018190525080611a359061254a565b90506119fd565b5050919050565b60008151600003611a56575060016108d9565b60005b8251811015611aae57836001600160a01b0316838281518110611a7e57611a7e61251e565b60200260200101516001600160a01b031603611a9e5760019150506108d9565b611aa78161254a565b9050611a59565b5060009392505050565b6040805180820190915260008082526020820152611ad58361191e565b8210611b2d5760405162461bcd60e51b815260206004820152602160248201527f5265636569707451756575653a20696e646578206f7574206f6620626f756e646044820152607360f81b60648201526084016104e1565b826002016000838560000154611b4391906125fd565b81526020808201929092526040908101600020815180830190925280548252600101546001600160a01b0316918101919091529392505050565b80608001515a1015611bdf5760405162461bcd60e51b815260206004820152602560248201527f54656c65706f727465724d657373656e6765723a20696e73756666696369656e604482015264742067617360d81b60648201526084016104e1565b80606001516001600160a01b03163b600003611bff576109d0828261200f565b600081606001516001600160a01b031682608001518484602001518560e00151604051602401611c3193929190612fc3565b60408051601f198184030181529181526020820180516001600160e01b031663643477d560e11b17905251611c669190612f6e565b60006040518083038160008787f1925050503d8060008114611ca4576040519150601f19603f3d011682016040523d82523d6000602084013e611ca9565b606091505b5050905080611cbc57611919838361200f565b815160405184907f5ad362d54cba0e49d358be9ce586a7136d10a2533579c4460b7e48ec273083ef90600090a3505050565b60008381526004602090815260408083208584528252918290208251808401845281548152835180850190945260018201546001600160a01b0316845260029091015483830152908101919091528051611d485750505050565b600084815260046020908152604080832086845282528083208381556001810180546001600160a01b031916905560020183905583820180518301516001600160a01b0387811686526007855283862092515116855292528220805491929091611db39084906125fd565b909155505050505050565b6001820180548291600285019160009182611dd88361254a565b90915550815260208082019290925260400160002082518155910151600190910180546001600160a01b0319166001600160a01b039092169190911790555050565b6000818152600260205260408120546108d99060016125fd565b6040516001600160a01b0380851660248301528316604482015260648101829052611e6c9085906323b872dd60e01b906084016118e2565b50505050565b6000611ec7826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661208d9092919063ffffffff16565b8051909150156119195780806020019051810190611ee59190612fed565b6119195760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016104e1565b604080518082019091526000808252602082015281546001830154819003611fae5760405162461bcd60e51b815260206004820152601960248201527f5265636569707451756575653a20656d7074792071756575650000000000000060448201526064016104e1565b60008181526002840160208181526040808420815180830190925280548252600180820180546001600160a01b03811685870152888852959094529490556001600160a01b0319909216905592506120079082906125fd565b909255919050565b806040516020016120209190612f8a565b60408051601f198184030181528282528051602091820120600086815260068352838120865182529092529190205581519083907fbedbbe6103cef0a6c9ecbf6aa23da414542c42d7918bea18aab8b601b2c3a44990612081908590612f8a565b60405180910390a35050565b6060610ae6848460008585600080866001600160a01b031685876040516120b49190612f6e565b60006040518083038185875af1925050503d80600081146120f1576040519150601f19603f3d011682016040523d82523d6000602084013e6120f6565b606091505b509150915061210787838387612114565b925050505b949350505050565b6060831561218357825160000361217c576001600160a01b0385163b61217c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016104e1565b508161210c565b61210c83838151156121985781518083602001fd5b8060405162461bcd60e51b81526004016104e191906129d5565b60008083601f8401126121c457600080fd5b5081356001600160401b038111156121db57600080fd5b6020830191508360208260051b8501011115610b3257600080fd5b60008060008060008086880360a081121561221057600080fd5b8735965060208801356001600160401b038082111561222e57600080fd5b61223a8b838c016121b2565b90985096508691506040603f198401121561225457600080fd5b60408a01955060808a013592508083111561226e57600080fd5b505061227c89828a016121b2565b979a9699509497509295939492505050565b6001600160a01b03811681146122a357600080fd5b50565b80356122b18161228e565b919050565b600080600080608085870312156122cc57600080fd5b843593506020850135925060408501356122e58161228e565b9396929550929360600135925050565b6000806040838503121561230857600080fd5b50508035926020909101359150565b60006020828403121561232957600080fd5b8135610ae98161228e565b60006020828403121561234657600080fd5b5035919050565b6000806040838503121561236057600080fd5b823561236b8161228e565b9150602083013561237b8161228e565b809150509250929050565b60006020828403121561239857600080fd5b81356001600160401b038111156123ae57600080fd5b820160e08185031215610ae957600080fd5b6000806000604084860312156123d557600080fd5b83356123e08161228e565b925060208401356001600160401b038111156123fb57600080fd5b612407868287016121b2565b9497909650939450505050565b82815260608101610ae9602083018480516001600160a01b03168252602090810151910152565b815181526020808301516001600160a01b031690820152604081016108d9565b6000806040838503121561246e57600080fd5b8235915060208301356001600160401b0381111561248b57600080fd5b8301610100818603121561237b57600080fd5b600080604083850312156124b157600080fd5b823563ffffffff8116811461236b57600080fd5b60208082526023908201527f5265656e7472616e63794775617264733a2073656e646572207265656e7472616040820152626e637960e81b606082015260800190565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161255c5761255c612534565b5060010190565b60208082526034908201527f54656c65706f727465724d657373656e6765723a207a65726f2066656520617360408201527373657420636f6e7472616374206164647265737360601b606082015260800190565b60208082526026908201527f54656c65706f727465724d657373656e6765723a206d657373616765206e6f7460408201526508199bdd5b9960d21b606082015260800190565b808201808211156108d9576108d9612534565b6000808335601e1984360301811261262757600080fd5b8301803591506001600160401b0382111561264157600080fd5b6020019150600581901b3603821315610b3257600080fd5b6000808335601e1984360301811261267057600080fd5b8301803591506001600160401b0382111561268a57600080fd5b602001915036819003821315610b3257600080fd5b6000808335601e198436030181126126b657600080fd5b83016020810192503590506001600160401b038111156126d557600080fd5b8060051b3603821315610b3257600080fd5b8183526000602080850194508260005b8581101561272557813561270a8161228e565b6001600160a01b0316875295820195908201906001016126f7565b509495945050505050565b6000808335601e1984360301811261274757600080fd5b83016020810192503590506001600160401b0381111561276657600080fd5b8060061b3603821315610b3257600080fd5b8183526000602080850194508260005b858110156127255781358752828201356127a18161228e565b6001600160a01b0316878401526040968701969190910190600101612788565b6000808335601e198436030181126127d857600080fd5b83016020810192503590506001600160401b038111156127f757600080fd5b803603821315610b3257600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60006101008235845260208301356128468161228e565b6001600160a01b031660208501526040838101359085015261286a606084016122a6565b6001600160a01b031660608501526080838101359085015261288f60a084018461269f565b8260a08701526128a283870182846126e7565b925050506128b360c0840184612730565b85830360c08701526128c6838284612778565b925050506128d760e08401846127c1565b85830360e08701526128ea838284612806565b9695505050505050565b602081526000610ae9602083018461282f565b60208082526029908201527f54656c65706f727465724d657373656e6765723a20696e76616c6964206d65736040820152680e6c2ceca40d0c2e6d60bb1b606082015260800190565b606081526000612963606083018561282f565b9050610ae9602083018480516001600160a01b03168252602090810151910152565b60005b838110156129a0578181015183820152602001612988565b50506000910152565b600081518084526129c1816020860160208601612985565b601f01601f19169290920160200192915050565b602081526000610ae960208301846129a9565b6000602082840312156129fa57600080fd5b5051919050565b60208082526025908201527f5265656e7472616e63794775617264733a207265636569766572207265656e7460408201526472616e637960d81b606082015260800190565b604080519081016001600160401b0381118282101715612a6857612a68612508565b60405290565b60405161010081016001600160401b0381118282101715612a6857612a68612508565b604051601f8201601f191681016001600160401b0381118282101715612ab957612ab9612508565b604052919050565b80516122b18161228e565b600082601f830112612add57600080fd5b81516001600160401b03811115612af657612af6612508565b612b09601f8201601f1916602001612a91565b818152846020838601011115612b1e57600080fd5b61210c826020830160208701612985565b805180151581146122b157600080fd5b60008060408385031215612b5257600080fd5b82516001600160401b0380821115612b6957600080fd5b9084019060608287031215612b7d57600080fd5b604051606081018181108382111715612b9857612b98612508565b604052825181526020830151612bad8161228e565b6020820152604083015182811115612bc457600080fd5b612bd088828601612acc565b6040830152509350612be791505060208401612b2f565b90509250929050565b60006001600160401b03821115612c0957612c09612508565b5060051b60200190565b600082601f830112612c2457600080fd5b81516020612c39612c3483612bf0565b612a91565b82815260059290921b84018101918181019086841115612c5857600080fd5b8286015b84811015612c7c578051612c6f8161228e565b8352918301918301612c5c565b509695505050505050565b600082601f830112612c9857600080fd5b81516020612ca8612c3483612bf0565b82815260069290921b84018101918181019086841115612cc757600080fd5b8286015b84811015612c7c5760408189031215612ce45760008081fd5b612cec612a46565b8151815284820151612cfd8161228e565b81860152835291830191604001612ccb565b600060208284031215612d2157600080fd5b81516001600160401b0380821115612d3857600080fd5b908301906101008286031215612d4d57600080fd5b612d55612a6e565b82518152612d6560208401612ac1565b602082015260408301516040820152612d8060608401612ac1565b60608201526080830151608082015260a083015182811115612da157600080fd5b612dad87828601612c13565b60a08301525060c083015182811115612dc557600080fd5b612dd187828601612c87565b60c08301525060e083015182811115612de957600080fd5b612df587828601612acc565b60e08301525095945050505050565b600081518084526020808501945080840160005b838110156127255781516001600160a01b031687529582019590820190600101612e18565b600081518084526020808501945080840160005b8381101561272557612e77878351805182526020908101516001600160a01b0316910152565b6040969096019590820190600101612e51565b60006101008251845260018060a01b036020840151166020850152604083015160408501526060830151612ec960608601826001600160a01b03169052565b506080830151608085015260a08301518160a0860152612eeb82860182612e04565b91505060c083015184820360c0860152612f058282612e3d565b91505060e083015184820360e08601526118ad82826129a9565b6001600160a01b0383168152604060208201819052600090610ae690830184612e8a565b8481526001600160a01b03841660208201526060604082018190526000906128ea9083018486612806565b60008251612f80818460208701612985565b9190910192915050565b602081526000610ae96020830184612e8a565b6060815260006129636060830185612e8a565b818103818111156108d9576108d9612534565b8381526001600160a01b03831660208201526060604082018190526000906118ad908301846129a9565b600060208284031215612fff57600080fd5b610ae982612b2f56fea2646970667358221220a66f8e9829a6d017323d35273e5753c2a0b1abd3e7b8251e89d84685679a712864736f6c634300081200331ba03333333333333333333333333333333333333333333333333333333333333333a03333333333333333333333333333333333333333333333333333333333333333 \ No newline at end of file diff --git a/tests/utils/UniversalTeleporterMessengerContractAddress.txt b/tests/utils/UniversalTeleporterMessengerContractAddress.txt index f4b168e2..25ecc389 100755 --- a/tests/utils/UniversalTeleporterMessengerContractAddress.txt +++ b/tests/utils/UniversalTeleporterMessengerContractAddress.txt @@ -1 +1 @@ -0xc16964cD2D22559A24401A8E491391390B564F0B \ No newline at end of file +0xa36D9bA55297443692B4Be84Ab23aA35d2e5dFDd \ No newline at end of file diff --git a/vms/evm/contract_message.go b/vms/evm/contract_message.go index a6ffb183..ed4c6e22 100644 --- a/vms/evm/contract_message.go +++ b/vms/evm/contract_message.go @@ -5,10 +5,10 @@ package evm import ( "github.com/ava-labs/avalanchego/utils/logging" - avalancheWarp "github.com/ava-labs/avalanchego/vms/platformvm/warp" + warpPayload "github.com/ava-labs/avalanchego/vms/platformvm/warp/payload" "github.com/ava-labs/awm-relayer/config" "github.com/ava-labs/awm-relayer/vms/vmtypes" - warpPayload "github.com/ava-labs/subnet-evm/warp/payload" + "github.com/ava-labs/subnet-evm/x/warp" "go.uber.org/zap" ) @@ -23,7 +23,7 @@ func NewContractMessage(logger logging.Logger, subnetInfo config.SourceSubnet) * } func (m *contractMessage) UnpackWarpMessage(unsignedMsgBytes []byte) (*vmtypes.WarpMessageInfo, error) { - unsignedMsg, err := avalancheWarp.ParseUnsignedMessage(unsignedMsgBytes) + unsignedMsg, err := warp.UnpackSendWarpEventDataToMessage(unsignedMsgBytes) if err != nil { m.logger.Error( "Failed parsing unsigned message", @@ -32,7 +32,7 @@ func (m *contractMessage) UnpackWarpMessage(unsignedMsgBytes []byte) (*vmtypes.W return nil, err } - warpPayload, err := warpPayload.ParseAddressedPayload(unsignedMsg.Payload) + warpPayload, err := warpPayload.ParseAddressedCall(unsignedMsg.Payload) if err != nil { m.logger.Error( "Failed parsing addressed payload", diff --git a/vms/evm/contract_message_test.go b/vms/evm/contract_message_test.go index fbc50c91..0695582c 100644 --- a/vms/evm/contract_message_test.go +++ b/vms/evm/contract_message_test.go @@ -10,8 +10,9 @@ import ( "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/utils/logging" "github.com/ava-labs/avalanchego/vms/platformvm/warp" + warpPayload "github.com/ava-labs/avalanchego/vms/platformvm/warp/payload" "github.com/ava-labs/awm-relayer/config" - warpPayload "github.com/ava-labs/subnet-evm/warp/payload" + "github.com/ava-labs/awm-relayer/peers" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" @@ -24,15 +25,9 @@ func createUnsignedMessage() *warp.UnsignedMessage { if err != nil { return nil } - destinationChainID, err := ids.FromString("11111111111111111111111111111111LpoYY") - if err != nil { - return nil - } - payload, err := warpPayload.NewAddressedPayload( - common.HexToAddress("27aE10273D17Cd7e80de8580A51f476960626e5f"), - common.Hash(destinationChainID), - common.HexToAddress("1234123412341234123412341234123412341234"), + payload, err := warpPayload.NewAddressedCall( + common.Hex2Bytes("27aE10273D17Cd7e80de8580A51f476960626e5f"), []byte{}, ) if err != nil { @@ -59,15 +54,15 @@ func TestUnpack(t *testing.T) { }{ { name: "valid", - input: "0000000000007fc93d85c6d62c5b2ac0b519c87010ea5294012d1e407030d6acd0021cac10d50000005200000000000027ae10273d17cd7e80de8580a51f476960626e5f0000000000000000000000000000000000000000000000000000000000000000123412341234123412341234123412341234123400000000", - networkID: 0, + input: "0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000024c00000000053968786a235cbcfb6e57321b94378e95939b773a9626acf7a8cc440075c02c7268000002220000000000010000001452718d4ea91a6dd9a68940dbd687efa32315d11600000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000008db97c7cece249c2b98bdc0226cc4c2a57bf52fcb1d32d469938520383696931c26b9753662db74ad33c012f41e337aa828f1b74000000000000000000000000abcedf1234abcedf1234abcedf1234abcedf12340000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000a100ff48a37cab9f87c8b5da933da46ea1a5fb80000000000000000000000000000000000000000000000000000000000000002acafebabecafebabecafebabecafebabecafebabecafebabecafebabecafebabecafebabecafebabecafe000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + networkID: peers.LocalNetworkID, errorLogTimes: 0, expectError: false, }, { name: "invalid", errorLogTimes: 1, - input: "1000000000007fc93d85c6d62c5b2ac0b519c87010ea5294012d1e407030d6acd0021cac10d50000005200000000000027ae10273d17cd7e80de8580a51f476960626e5f0000000000000000000000000000000000000000000000000000000000000000123412341234123412341234123412341234123400000000", + input: "1000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000024c00000000053968786a235cbcfb6e57321b94378e95939b773a9626acf7a8cc440075c02c7268000002220000000000010000001452718d4ea91a6dd9a68940dbd687efa32315d11600000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000008db97c7cece249c2b98bdc0226cc4c2a57bf52fcb1d32d469938520383696931c26b9753662db74ad33c012f41e337aa828f1b74000000000000000000000000abcedf1234abcedf1234abcedf1234abcedf12340000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000a100ff48a37cab9f87c8b5da933da46ea1a5fb80000000000000000000000000000000000000000000000000000000000000002acafebabecafebabecafebabecafebabecafebabecafebabecafebabecafebabecafebabecafebabecafe000000000000000000000000000000000000000000000000000000000000000000000000000000000000", expectError: true, }, } diff --git a/vms/evm/destination_client.go b/vms/evm/destination_client.go index 56497870..19c48cf2 100644 --- a/vms/evm/destination_client.go +++ b/vms/evm/destination_client.go @@ -18,7 +18,7 @@ import ( "github.com/ava-labs/awm-relayer/config" "github.com/ava-labs/subnet-evm/core/types" "github.com/ava-labs/subnet-evm/ethclient" - predicateutils "github.com/ava-labs/subnet-evm/utils/predicate" + predicateutils "github.com/ava-labs/subnet-evm/predicate" "github.com/ava-labs/subnet-evm/x/warp" "github.com/ethereum/go-ethereum/common" "go.uber.org/zap" diff --git a/vms/evm/subscriber.go b/vms/evm/subscriber.go index c42aac03..ef19c616 100644 --- a/vms/evm/subscriber.go +++ b/vms/evm/subscriber.go @@ -87,7 +87,7 @@ func NewSubscriber(logger logging.Logger, subnetInfo config.SourceSubnet, db dat } func (s *subscriber) NewWarpLogInfo(log types.Log) (*vmtypes.WarpLogInfo, error) { - if len(log.Topics) != 4 { + if len(log.Topics) != 3 { s.logger.Error( "Log did not have the correct number of topics", zap.Int("numTopics", len(log.Topics)), @@ -102,22 +102,12 @@ func (s *subscriber) NewWarpLogInfo(log types.Log) (*vmtypes.WarpLogInfo, error) ) return nil, ErrInvalidLog } - destinationChainID, err := ids.ToID(log.Topics[1].Bytes()) - if err != nil { - s.logger.Error( - "Failed to decode destination chain ID", - zap.Error(err), - ) - return nil, ErrInvalidLog - } return &vmtypes.WarpLogInfo{ - DestinationChainID: destinationChainID, - DestinationAddress: log.Topics[2], - SourceAddress: log.Topics[3], - SourceTxID: log.TxHash[:], - UnsignedMsgBytes: log.Data, - BlockNumber: log.BlockNumber, + SourceAddress: log.Topics[1], + SourceTxID: log.TxHash[:], + UnsignedMsgBytes: log.Data, + BlockNumber: log.BlockNumber, }, nil } diff --git a/vms/vmtypes/message_info.go b/vms/vmtypes/message_info.go index b54da2b5..ab9cb1ad 100644 --- a/vms/vmtypes/message_info.go +++ b/vms/vmtypes/message_info.go @@ -4,7 +4,6 @@ package vmtypes import ( - "github.com/ava-labs/avalanchego/ids" "github.com/ethereum/go-ethereum/common" ) @@ -12,10 +11,8 @@ import ( // describes the transaction information emitted by the source chain, // including the Warp Message payload bytes type WarpLogInfo struct { - SourceAddress common.Hash - DestinationChainID ids.ID - DestinationAddress common.Hash - SourceTxID []byte - UnsignedMsgBytes []byte - BlockNumber uint64 + SourceAddress common.Hash + SourceTxID []byte + UnsignedMsgBytes []byte + BlockNumber uint64 }