diff --git a/packages/protocol/script/layer1/ProcessMessage.s.sol b/packages/protocol/script/layer1/ProcessMessage.s.sol new file mode 100644 index 00000000000..e177dbde91a --- /dev/null +++ b/packages/protocol/script/layer1/ProcessMessage.s.sol @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.24; + +import "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol"; +import "test/shared/DeployCapability.sol"; +import "test/shared/thirdparty/Multicall3.sol"; +import "../../contracts/shared/bridge/IBridge.sol"; + +contract RecallMessage is DeployCapability { + uint256 public privateKey = vm.envUint("PRIVATE_KEY"); + + modifier broadcast() { + require(privateKey != 0, "invalid private key"); + vm.startBroadcast(privateKey); + _; + vm.stopBroadcast(); + } + + function run() external broadcast { + IBridge.Message memory message = IBridge.Message({ + id: 1636509, + fee: 0, + gasLimit: 806657, + from: 0x1D2D1bb9D180541E88a6a682aCf3f61c1605B190, + srcChainId: 17_000, + srcOwner: 0x1D2D1bb9D180541E88a6a682aCf3f61c1605B190, + destChainId: 167_009, + destOwner: 0x1D2D1bb9D180541E88a6a682aCf3f61c1605B190, + to: 0x1D2D1bb9D180541E88a6a682aCf3f61c1605B190, + value: 12345678900000000, + data: hex"" + }); + bytes32 msgHash = + IBridge(0x1670090000000000000000000000000000000001).hashMessage(message); + console2.logBytes32(msgHash); + + console2.logBytes32(keccak256(abi.encodePacked("STATE_ROOT"))); + + IBridge(0x1670090000000000000000000000000000000001).processMessage( + message, + hex"0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000028c6100000000000000000000000000000000000000000000000000000000002f46c7c372cb578c7c21a2c8aa16ef55e3d094770764f71f22167ebeab7b5a6d6fd73c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000114000000000000000000000000000000000000000000000000000000000000000090000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000036000000000000000000000000000000000000000000000000000000000000005a000000000000000000000000000000000000000000000000000000000000007e00000000000000000000000000000000000000000000000000000000000000a200000000000000000000000000000000000000000000000000000000000000c600000000000000000000000000000000000000000000000000000000000000e800000000000000000000000000000000000000000000000000000000000000f400000000000000000000000000000000000000000000000000000000000000fc00000000000000000000000000000000000000000000000000000000000000214f90211a0bfb28d792b6c777668fb3ca8f05b1f72b63a6e94c4857f8aaa555eabbc6d5208a0ba18a8664e24b28975c5b56fcfff02d8fe4a5366a7008c6ca0c4411e929aab4aa03b805ad5fea154b4ae3868fb2a89bd3d28c81a941b2a94575456c01229e2ed1fa03550d59d38855693573a6d58d019d886d38c149b29a0b98214f01eb60c1e2039a0ff3316e7e893e6422667fa222f4b4f324ff5c6b81f36ecd993c09d209e65d13ea0282557e6d5cd9e4277c565ce5ee0bf80af5ad91d822ac860baaca1510ec5dd74a0ce405ed50be8d140b0b83692ba484b0a058f2a662dad83a5e9b7694fe1c1ec61a01df7ac55ed53ffbc32493d0c864f8b6109b6813e7a44ecfb724c2fa2f867fb92a0a6b6a36f37f7061340bc7239273067fe1fe3448a91cb2b3c187b779cdaeb000ca0311b056888a85091466977a83d2b6717cd20c34ce134591502adaf739a54ce91a0d33d6f8c9abffd61ab702b8bd3bb36ecdf27478f8f6f757e08bd7c7c80db6341a041e7fbe0942b0826e0232ceaa743a3b042e79469d870a50b074f3ae9c02ddf57a010676bc0cb6fc27b4fb45f43f8a38e8eb1b303417a2a9b57f0c2a8a7b8805153a0fcbd84826fd91f007b5a01468b62b5338163671cba7f89b8ebb38182f6a5f543a0afb0d24c07267b25000236adf38c42e83a438eea7b81d3f93332cac9d7855d13a08c909ef53d11a313da53d4c465c418bfc854efa99b24fae1dbda7ef9c137c702800000000000000000000000000000000000000000000000000000000000000000000000000000000000000214f90211a01de377112585a354903f2083634bfb9b0b3dd5ccbae63786574044cce10e567ba0697fa145639d30ae221461166f41d13c6b7505ffa5d8ed94aaa294e8c466b5aaa0d4f542afc7597a9bf4ddd3b83f97275a75f87b941086b40de11d7717b30b3706a0f87f65393d9a7cfce2f8fdb0a0e3a26157e24b5e03a476bee7c795c64c0c47fca0759b3bea4c5f5c66e75bfe7deb3ba8b4dc979f4383c1310dab2797e78e0c2e90a093574eb9759ed64893c2659c1c055dc4e290a8a27704cbcaf78525a51207f3f4a09c3c4ceff13f5dfade54c6e765176d8350d0602b3417f81c43966aa7afc0c5eba001764d0054e1e6927bb6f200c60dc77d415270e3af39d764d16d0dab4e34d479a04a775acef295e4658d1bd1720cad6a104dba75cf4f93333fc39971b4e5cf97f7a05df176d5a4432e4696f08bb0c897ba93311656bcf207493d6fe2ca7ccb9e25f6a0359cf7a1415be06e5f7d9d4fb5e95df65f84aafdffa7d96f0a3c6165c21f642aa05fd83c909cc85b2916e58f905fa142eb32494512357e3b247dbc74f665922e43a0f7265f717a47ad60dc5e30e2f18f3aabdd82b63563cfa133ccab70629e0bd0cba0c43db630728e79c9156ad8d7940201a0d0f816b3cb2dd12ec4653ac81182f850a0be9b34309d722c1e055e11060bd297130e291423ef8c33c539e3d8acd05d5c81a05cd566d733c0b04d2ce220495ddb53d3f892efad53f182e79d41d2a997a31fae800000000000000000000000000000000000000000000000000000000000000000000000000000000000000214f90211a042885e977355aea769c8abaaae2659f64c65b71ac7d73f36858ee852a08be53aa078c059948c340b6bfe25a3f5d3adc3dee2140639c63a5d72232f63c40b72ebf2a00c0d1ae49c67d297b49613152a8bcd7dcadae44c699f3f8c66b284afb22d2ed9a0a98a1005b5fbc578d00ff48a6a9a916ac60d4005d2a9a660661f211cedd23551a0c04eeb554d724bde1a77faa7cf32e57396a9f03ace16c8b417765aea20b46f02a09abe26e1be39a6915a8d1e757cd3f4e7440776832e9b970cf2133e17146e8cbfa036d9da872f434aa8d7d422f8cb32d20acc58e8941c760718f4cd60a86d65560ca0427f78456c98124894e69f561a225e11ab801e1bd579b967d938cca11230f83da046b1a26482affefefc92cfdbdc8a3927359b4cd63290774aef0fb11826183121a08126d36fa112c4c619c1f5a036907e5b3331fe0ab9bb39e3f422f7e1227a1c8aa04c03408138e79044e40a09baa855595d46ec28e9c9d6f31cbdb334452d7206f7a0da339095a721292cd0505d6ae5810744ffcd0fe3d2c290b2c07526fc7714f81ca07c05e87d4475515fce79431294b50f2e6eeb4725654799c0f06112d84d3a7b2ba035b50f560da7294a80e2ec6314b5e7304fb59954e003b5a958ab64897e2f051ba08e876c8dc0e297108b6815a25d5f29ff3ff26cef4c9891d9fda2b4092315f812a0558a53160db7a4e76f10517acd90fa2cc9cde670cd7f87753ef6ee6e9ebf2706800000000000000000000000000000000000000000000000000000000000000000000000000000000000000214f90211a03f0de8680bb4b7ca7250187c317de5a997d6db09ee59c57adcc20f9b088f6fc1a008cf6b3c3b2940c067b26862e59b77994a5d06e78f6559a6cac8046adb3cb55aa0a645aae0b2d3e211537292847bc26ac5a1e59586edc1d0eb922d9b769f1516d8a0f746b3947dd57b0f138e3914f19423e72c460715c61436cede216b349963fe37a0a386b69418d26f3270084b864140fbae65c4f7e0d14b44bbf422d321e5de7b45a03d27678d51204f440a7880c47302eb51d0a01d49e5d8bc55a7ebcc1fa5d3d5a8a08145756c90dc29a18c517f650217e2ac8dcf92b4ff558683288053d701547f0aa0d8bd1fc4521295678fabeac226bcadc422b3986e6270e521663f17dd770d01f2a08253ff09a04804a539f06e92b6cab9df1ec7aa57946d8433ce055e31d8df224ba0f8befac97639066f930661812343bf82089d641618026123c909757e998d5176a022f409ca424e727c13e8217e83106aef5655c4bc3deb4515dc73896787a2f64ea0e9e4fcbc6b5a136a09fc8dada862ea21744bac1445ee363899bd21b1bbcee66ea063426262634b42f4bc9707f8fb9edddd45021796692aa43df19eb4bddca7b6d7a0d48b591f2c3884b18506cc8c2011a133811d03c0c24c7f349e20c7b3d1dd3351a0c3d76e5ba094fb8e717baf582edb2b8e37ea05fcfacc64315ebed8321a225b20a05cde7f10d7bfb95621f6d8ddc1de09f28a133192a00dbf680eb1bb8d1a2f05f1800000000000000000000000000000000000000000000000000000000000000000000000000000000000000214f90211a026afb07de86e7b28609468f447285e4522f3e2c211e1e79b5fdc895cf6a815bea0619b2a09f4863a1d36f726c0090008945c8e63feac998256317a79cab1f9ac96a006dc8cf46bfc508b5d9aaa3800a449f26d577313e8fa97f27e22a6aec0c48adea0c12b475ad72e9f2ed329b520ada188340abe071ca312207f1ce55893c1560b24a0cf8b40886515305649db5dc3eab7655ed058fdd3fa031005b17591491c49b56ba0191f0c128cc796607f4111f2e263c3ef3846de6f9162c0b6c772f3b8a83c1c64a06c6ef0fd53d91057d7c551c15c5ca2cda70b4b2ef3704c389ef5778dbc1d6d99a02d78c7c60f5e4b5b1c705950cacc515f6013c4606033660fd0fbc79d4223968fa0b3780c0fc124c719745778fe5686eeaa3e6d881a9c176ba92c75b52eb8f13f9da07332fc9b4a198a91a7cb20e1a4604b804cfce0aa694ce1e3031b3212a8373053a016e368d8719f35a639846b02816643ab804ff51d24c2b781e75da3d74096b6bda083f1ccd0f6c30a49bfa3d8dc954d9e61b9c4a609db172c475537a3726309c6dfa0307dcc0b9f46ca1e732fa089f887b2b8b7e41c83321a84ece4bec3f0ad8aeee9a05d28fc350ab8612529b62c1bc32b8750362707b704cdd427381e286c6b6e0296a01978ff505350144fc3a62b8c75b04835979ff834f4e073ec6b9c6f77bb99545da0f7f8cd4512b82d9fabadaa5287d98c952a92d8ea8da84e9700b306dc63c7cc4a8000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f4f901f1a053df7249a37519eec5ca8f6b47dbadea25dce521092a30ac8f91b9e01665c338a04026dd021d7d4dc1aa14b924b30ee1facf513fdd28c217d9c0f2d7148abb0aeea004be2889c32fee2ff26b45e8054ab7a615ae531994c5e7cc9ebe886219f0bc25a07564c544eda037c83c83f6ae65824b6f5d424fa1d44ac0aaf916e6099b3e3a08a0de1cd98994a6bee50ea717651335d489ad9b8efe71af2b63c062b8bedd076066a01770f3f1979f2b9fd6e9a4881d12a4db9c8ce31051e630469c4ea49bf3ca1a13a0d425971abbad096ba172427bd3dca132bf0722659636987df7ff546460c09795a08aa3526c39f7d3285da20e75ab0ce3aded11b56c0663680ae1f7132e11d7f3daa0b4c6ce48eb8901c819e70ac0042f99db2ba3cba4eb4f9ed9d063cf00dc076856a06aa20accd5484803bcbacf8db26023022a7cd2fe95201aeefdff337e6def3958a06035d6b76441e946e719d65e482a1625c8d20e036fbfe47312ca12050fb60f6c80a01e569d93ade0b0950427bfae37b8f40ab83a1529f99e0689d5fb43ab741fcf73a082e6e9d4fdf7aa2667286a7396e8bb9cd78b4723912e609b6b382fb8081bfc19a0d3c5bc0ab950302d724a7c7164418031c31615fa8e5cc61bee2782fcb5b71edaa02f66305ae8245ddfd7ace77482a5da7628fb10625782a65cae6eaefd5f2f6891800000000000000000000000000000000000000000000000000000000000000000000000000000000000000093f891808080a0e0a3f4f4e5e98db5432e97ff7148edd5f60540677b6caa83264f2524a1447ed8a00c20c1087b3a297fea4bee443727659ba097f631cf18dd0339584d59ab8e19f38080808080a0a5eda2866f0db928404a936f8f62d9829c06a6570779280b9d7c53aa23115b328080a0fa70313be2a234a88ca80f3022f3dc16fe9e902f24c88a8a73b06fa007f4f126808080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000053f85180808080808080808080808080a00d710e4f049100beca5afe20afe9352366808ce40288be2ddcda0e628722c2dda09af7348c5962a82c3566646d39d644a2e700f10d870bbd41804f62e07f930b408080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000068f8669d20d6c66fdeafd58dd28952ea547647ffe9bdf58ad841cd73ee5a6b66a3b846f8440180a04b2cc9075703c5ddb35aa9bc6b85034c75e83d875716679062a6c6d44a2e4178a026e751b9fd68f5207c6d2b35f2871bc22c1b05e9d20368c10257dc04ca67f46e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000700000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000000000056000000000000000000000000000000000000000000000000000000000000007a000000000000000000000000000000000000000000000000000000000000009e00000000000000000000000000000000000000000000000000000000000000bc00000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000000214f90211a073d5a532141f510e8379138dbe51d019605b9cfd5645bf13ec61837ea7affaf0a0357c5562da05b0718ec866e384c77946038dd94aaac4954ac762491b700d763ba003d19bde1d337a2e7f5f2509538566cf5b715802cfbd764c3a14d588e7733657a0b628139168484f3a436122cc49da2fc2594b519a6ec21919a79a67a1eeb6bdc6a0e94c1f1b491cd0c50b30071975f2352e74bfd4a3b53110ad6fbb1314329c6f17a047df1f7aafdb4289e77736ccd6fd1e6bf7042a997f875c4a83e4bb476904f277a0b8d5b3d3bd977c23664f8b07d1d72f141fcca2c9e5bf04b8789326ab2ce348d3a0af17db9818c2fbc1b29abdd57d370ecf8d72645e6a9676292975fe5ccba1fa2ba0508daa3e5402f6fcd8a6633157e0eb34c4a9daa8e421a654d1e2a3e03cfae081a0235ee480db5f15b8d2d4ebc1a492461a1094d9dd813bd21f9749ee319ec54d41a079745a87fcb34cf1ffa3e4eda1fb614b258c4c1fe78b98882a96b2793401e2b2a0841a5898bc99bb75328958f1befa4ebef880256385eed7d6b275bddc14e0c3f2a0f609170fd9996340d118184f61fc31d55292bd38f61b85a7cb9c48d57a6d56c9a0779c3e4d96f2a733d2fb3b7dc9a7c71fa85f537ce1dcc4c45c53767bbd5e4b13a0dbb9e34e852e4713a23b2e1f01ad627d1c3dfb8786de84c61c0fd2df345134b1a088f2c1650e77e3833b191bc522cbcf00ce387b902d262b18d4c1c5068d1f4f99800000000000000000000000000000000000000000000000000000000000000000000000000000000000000214f90211a08c195eaa3f02ef2312020d5accce3a9615e37e619a2e0253115bcd66e4a6a4eda0422b69103467b7aeaf7651708db04295711a46078a4a85e2fccaf13f51abe10aa089a3430d03925ea4274c66f068d4ace812223ff221cb0c4d1df02927965ee357a0d8415572dc6b012d286ae12b54d1b7475a4b43113c8bab6f347e671414d8a694a01716a85575c5a1b195a9e02121d07fb6eaf5bbfc6938d4537138681acd8315b8a0002570718e32a0fbdae8c5b723da01edda77a4852934d3c645389c6631211f13a038d1ae18cb7741a38f719bffde1a52a5aa9c10e1f93f82eaf6fe07f5c76618d5a0395e9af83245d13c06d732c880071ab81c77c99ade788d6d8ea38620116263b4a0d8a06b563bb6204f91f4ad7690251ce5b9d56915a575bbeb7a107ad3e22834f9a0332d6dda1e28dba6fbfe3b1ba558253b86e4b4029f7ed6a4b31fcfbd8b0442c2a035581d349cac8c51e073e854220e2a6fa42ee2acd4533dc5bd73b64f559da058a0ec3ac326de1aa73fde2e993d5b49236041fd29aadd04eaf29f40ea80cb2082a9a04e66fae57be8bf810555d3abc4a4509f85235591a9de163236049bca191c6b52a058952c2e44dea441f9e6bd5e05a7e4aeaa5524cce81480b179bc2501c4288f8ca0eefb90addf24bdb27a0f00a45379a739191e0e1a84e17d067443279f0384f792a07b1a77c5a70b5a7d976cbce5532b1e56d860e85b377b9ada811aa126a8647129800000000000000000000000000000000000000000000000000000000000000000000000000000000000000214f90211a0f240d420d56fb6a0661e5540708583c94c2386d33fae80f2c7a69c07e5aae5daa0ca7f9668066c0463a023e397a0c82624bdf86705d0668d2991e45054af25a473a04a8c7978af2109540dcdca32522bfffe4e7dd8f6f761f44d17e814896e7f2034a0795f64104d62039d80acd570e30c6bfe97fcb4ff233dbbbf9a381f838965d48ca06b5fb5597f42268961310fc7d19d7af593c180f4f5dbc38a66805eb6c8873423a0e26d58e9a874e9389473be106c8dd158dc68c8daf0f22122c5412ab3529325b4a0a53fd2943ee26da7f9bc9147f79898dda6cd459241d290c55f41cfbd5d5b4118a0d270439d97c561ae41a26b43968194d1c4382cc11eb2fa42960a79fc231f53aba020346c5baeb81a7173c82e4f355484d60de93de999a11ce43ebcf5504c84cc7ba048afb3f718e09f14b8a571454567f062a1290e08164ee60a0cf021c183ea2bd0a0a9c69dff9d9f59ed49721480f5787dff0b496522656c78a2179e1fe09c810734a0f265cdb2dc13ebedef646cca2ccbfe58a7520f41636be06ec259df9003b919e2a0a79f9f439b4d8f090c2a18eb2be24c620d65516f840e0f5fdfd407f369f97122a0cd1dd30f61aeaa4cdd56d7eee41b4aaaac7ec2170e0cd698ec89a466308ced1da0286dec0b6d1ed887531244b0bbb55475438dee2297a31d0b689a4f32efd2f9c1a0c10fcc2155109f8c7e38aa7d2ade7d43fddc0c8c0132c780ccf6f4b2654438cb800000000000000000000000000000000000000000000000000000000000000000000000000000000000000214f90211a0f8857da04245d26f3f516b2a273772aa3b8d2820a6eaa4c76d40bfdfb7d39a66a0e0d666157a6a87b08ae5a6b817120162096833b3eb5d2baabfd6d5dab57d32f7a02f43be085f0b7ff20cfdfe6c46a3f743f34f5404ea032ca39cdf3ff47fc63340a0c21722cdcd31961d1feb91ecb8c516f374dccdc269e866efee45791b4df32ef6a0f62d46830bc92166aaea8e98e3bd7899d398798488a6eb494364b06d20c9b192a0180aef44cf68c3c995151de73448b5c7764bbc9d02f22fcbd5e2c1b380b34b85a013099bb793e49eaff8bc0ac48e7beccd128db92801ef0c3b70054c210dc392d8a084dffe4f247cc3c55b55232c6d0ddfea1efa2f81058d10fae6f668c59af769f4a0a28b07977f3f15788973897fc8ddf0abb2eb1f483f17db8d7806e7075113b588a0bfa96e1ea8884331e00e1db303047675e150bc4b7e12da92ee313736c999f306a0d60c76a535369c5133162109ff0b7d31a86f761b960877844f5e8d2ea61e374ea09cf210245b4a003a67d902e1d292604dfd8ea670d238e196de1f8552c2190da1a0e9c50bdd39d17e552092fb4a8667014d4238ad36f9df2fce0e46a30d8367381aa033bbcc8f4e1225c046bdb1aa521a1f119c91b95a2ae54e30a5589e0c097b4222a07184dfd2a1cf08e5f807c9bbe3fb8769f75b3445adf6a54256514e4a0d2bae75a055ff247c29ccbd8e6a1509744452769eee32a11bbfd9a10fe4845a688af550ef8000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b4f901b1a09c3195b12388be99067461f2262c5c6214d4f8e94cc5eec24a9a71e61d54e508a0f1c3c5124e3da5472dc291a69182a7e7db617406920e84237b11c7fbedd72cb9a0515917a83738f64823fef4dbc34bc33917be7bacac5120b89620bf74e796daa5a00c8602aa039c10035f446c70897cba77990f4a831a1e8e952f3238d44284ff2c80a09e6078bc1f1587d4bcd868b4416fdbc7c02bce2bdb8047364ce7e180f933bbf280a05a9430e903c784e44574ce53e5b7fa47d81ad651971049a550873e07a1c92828a0fc4f725b4a71d1e4cd4a8f0286ad2df51be628bcb2049a9bb5bdfbc6bfb93d17a0952a6e1a50dba377c39f1a244b53277d5f3ac61238d0ad5c59516121dacfe110a0f21906129400d9b30465dbc6457f70c93a01ed8a50333c083a783c696c304b2aa0a7271c0e592b97be12ad1672c700a4819b3ba488453b95dd258af581d44233f9a0d6b11baa831e22794ca384b5d180a1b3ac220de4db35fd3eefa7ac5dd910404180a05498e34897d0b0ac7e5db59506647e5c3fb058441867bacb8bc43aa859f1372da0d7065509114cda842dbddfc4ea6b224d6775adc5925478a543f421f4276f7584800000000000000000000000000000000000000000000000000000000000000000000000000000000000000093f891808080a02b8398e26691ac598497bf3c74382e2c0998c0bb376a9304c48f1c5ea9aaa96280a0e2eaa62131b7b1dad47db69087287bd670e8ee1cc750cf1b6d2756a928b6cfd1808080808080a07267359abdab48f179835b127bdfae480fd4d30cd9c813d1ed19e325867a65fea0f587fb74233c82b99efce314a07b60772a5120f5e6c14c0d7a418e16a5f9f93f808080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000043f8419e20347ba1d6fc91e86af0e4566be03ddc880bd303d440f698ab6849ba0ccaa1a0f6a27ab46805b18c1bfcbbe45f450c70ff3ce88cb95b630d6eda2eaeebe8dda40000000000000000000000000000000000000000000000000000000000" + ); + } +} diff --git a/packages/protocol/script/layer1/RecallMessage.s.sol b/packages/protocol/script/layer1/RecallMessage.s.sol new file mode 100755 index 00000000000..a1ba0489bb8 --- /dev/null +++ b/packages/protocol/script/layer1/RecallMessage.s.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.24; + +import "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol"; +import "test/shared/DeployCapability.sol"; +import "test/shared/thirdparty/Multicall3.sol"; +import "../../contracts/shared/bridge/IBridge.sol"; + +contract RecallMessage is DeployCapability { + uint256 public privateKey = vm.envUint("PRIVATE_KEY"); + + modifier broadcast() { + require(privateKey != 0, "invalid private key"); + vm.startBroadcast(privateKey); + _; + vm.stopBroadcast(); + } + + function run() external broadcast { + IBridge.Message memory message = IBridge.Message({ + id: 1_636_356, + fee: 0, + gasLimit: 3_000_000, + from: 0x1D2D1bb9D180541E88a6a682aCf3f61c1605B190, + srcChainId: 17_000, + srcOwner: 0x1D2D1bb9D180541E88a6a682aCf3f61c1605B190, + destChainId: 167_009, + destOwner: 0x95F6077C7786a58FA070D98043b16DF2B1593D2b, + to: 0x95F6077C7786a58FA070D98043b16DF2B1593D2b, + value: 0, + data: hex"7f07c947000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000005c000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ca11bde05977b3631167028862be2a173976ca110000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000004e482ad56cb0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002e000000000000000000000000000000000000000000000000000000000000003a000000000000000000000000016700900000000000000000000000000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000243659cfe6000000000000000000000000637b1e6e71007d033b5d4385179037c90665a2030000000000000000000000000000000000000000000000000000000000000000000000000000000016700900000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000243659cfe600000000000000000000000050216f60163ef399e22026fa1300aea8eeba34620000000000000000000000000000000000000000000000000000000000000000000000000000000016700900000000000000000000000000000100020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000001063f4cf9eaaa67b5dc9750d96ec0bd885d10aee0000000000000000000000000000000000000000000000000000000000000000000000000000000016700900000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000001063f4cf9eaaa67b5dc9750d96ec0bd885d10aee000000000000000000000000000000000000000000000000000000000000000000000000000000001670090000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000064d8f4648f0000000000000000000000000000000000000000000000000000000000028c61627269646765645f6572633230000000000000000000000000000000000000000000000000000000000000001baf1ab3686ace2fd47e11ac627f3cc626aec0ff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }); + bytes32 msgHash = IBridge(0xA098b76a3Dd499D3F6D58D8AcCaFC8efBFd06807).hashMessage(message); + console2.logBytes32(msgHash); + + IBridge(0xA098b76a3Dd499D3F6D58D8AcCaFC8efBFd06807).recallMessage( + message, + hex"0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000028c6100000000000000000000000000000000000000000000000000000000002f37cfad974c804896f7f05cc122874fd81b03db2a999710bca239ced72009c8c16ca5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000114000000000000000000000000000000000000000000000000000000000000000090000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000036000000000000000000000000000000000000000000000000000000000000005a000000000000000000000000000000000000000000000000000000000000007e00000000000000000000000000000000000000000000000000000000000000a200000000000000000000000000000000000000000000000000000000000000c600000000000000000000000000000000000000000000000000000000000000e800000000000000000000000000000000000000000000000000000000000000f400000000000000000000000000000000000000000000000000000000000000fc00000000000000000000000000000000000000000000000000000000000000214f90211a0cecb0e44b97bcdaf60a197482e334ae4f3633fe17a97b0d1c0eda16ca45e7ff0a05fde0c2353bdac02754ec8ee9c4a729bba0286738303bf4dad107727983011a0a03bb013858512e188d0966a218d9164aad0508483ecc8f38515d871bc1e23bdf4a02d41702dfb15ecc6e9ccf8c648b6b213f7e05300968607ebac6a3d4a659d07dba0286999c3f6dc1b7ce8bc4cf5465cbf30bf8c2b2a0293f2a33cd0a408c259bce4a0d7fce3b82ca6f12e593b9157be08c2d0d2b92904e8ec3db6298cc15cb0cf5b11a080ea4d6241effdb9c800793f7e8d6920d725af89065b60a1be7736d9f72ef2fea0c99b68e19116d2a9c9c03f4b6645a2d0bcf221d10f6202054534027354673bbda0b77b08ed0e156a10ac55e8807ae6b900a6d952873fafab5b3b8c50018b4c5fbaa05e202d58c046a6755de374787cce81ffa058278f5aa124d072435d404513098ea0d1d7dca23eca1bd4f2c646dd2c3a3baf17491b3943f1dc6b74ac12be44897c72a002dded8b0e95c7653c042b6825718ef9db1f164cc87dbe1701e45942d37c6646a0196187b6b8ea10026ac46fce46b7d52e25f755f358961386b87536944ae19390a01dc105df9963ec131e61defab2e3c14278a93c9eac56aa799e752cbaae098077a0275c5bfeb6ae36c05b71acb48944bc558350b1d9ce5bdf8186a9b26a288481bfa094f585fc3cf9d3832736f898a57887c1fae7b7595b0b04f283d4dc61027815be800000000000000000000000000000000000000000000000000000000000000000000000000000000000000214f90211a05a8dcc4ff30bf551c561b1663bf300e24d7c6bb9406c70f03b1271720857059aa0c53cd7c86ce19fe5ea808470ce47410572cac37070acbff73c0f4148734b30eba0590512d52531c84809d7de52d6cdabd0ef5f015c96e4593d9bf9ec6b52a570aca02373e995475ec0ebf826acccc0729400a165170296b3992047cce6c89a52176da0bc20a3c57a84df93f7202a920d5f5edac7869350661a77ec8f8e22753696ec46a0dbb6586d9c699f14964d6816ac1d76759fbbd23484400c80f5cb120002ec73fba034199eb1fb0c17365f0a88741d3e70c354611cee0b61bc236f85bc7d4be6c418a0dfb6ab0b8fe0deec3567c9d4e81d9872b207999211f4bc3ebffd2e9fb7a14747a05a157448af5ae75a69922bc226fd9b2007fd056685ae8461e767a2620b2351eca0035b95c86f5a670b8f1f0fe87b69d2625c8f48e33522adc39e75c473a1bad501a037a8cd1bb2ecb4a724d4b7f6ef8bc86bf5a8cc18b1530ad8669e04d2c9e8d470a09a4c86b8ced401b4db29edb5205a1c604cb37c85c2646690875ea457cc6ab956a024155e9be87ce65cde5f53ff9c11156b804b549ab9a5e182a2eeadfe9e06a746a08c07bce5e64c7ed392cf75bf4491ff0d6044e094bda433025bdb88efc7ae6838a090520ddcd8860853e2df6c0545b60a888e77e7f9e510fc506add406f2cb82dd8a0c2c8a62adf845e39b3d310649c4b66e91b479832dc9a9caef86202575f57ae7e800000000000000000000000000000000000000000000000000000000000000000000000000000000000000214f90211a03e4795dd81fccdf878046e96c740ed79042b308a3015cb3cb202987bddf5a6d5a0857f3d8f4140f87b0315216134bd2a33775ec6f790e95bbd12c08e58fb9f544da0a7fa87955c731ceb6c1b92c0d95a661e8b8d4283786ffefcd59d74a46f5c7f16a0993a8c225929545acb269ed2049b551f6fc066252fe3edc335eeb4cb6f744fd3a007c67a0df5beaa07a4cb57a17a420bab4543b15fde2579d84af9c4e1504def7fa0fbb064b72a08220bb5d1b550b95cb29835edcaeb28389d9497e44cb10bbe2806a0baf971ee37e1d5a50448017291a66cb110263d60c4ea65c479a07b6ecefec524a04839f6727b4b239e62dfc40f44b113b703f20db5c57674b8a2958b3e81888f24a06927583819ccfb382eeae6cf16551900cc3305b180c856aacaccb77cb1d04c52a03f1a024b60d2a391d225ed2ba94195cdf14f362062986b2ea19a239d4c6bb52ea0b260ea4cef27798791bee66073edd640b45a977230a858e4117abe3530568bd4a057561b58c56d57b370cbfe3be9778eb45d1b56afd10573a3ba469da0287566d8a056771a5d06c89e3fcfcc6aaafcf1898dd79e9de7257a3d31763384610ffd67e7a0ea67ecbc545468045d6a2655a5627b1a3b83f23a96ce19e8c3e64647a7e5fc75a09457edcfca751f060368838fed4e7d206e4fbab64d932acc78eb8e8a6ad4a58ea057c666b6f9f6b310418892ae705069e955718480a4b96b4af17208b2537a7c4b800000000000000000000000000000000000000000000000000000000000000000000000000000000000000214f90211a0680bb261a889e25ff9abac500eb67eec68d9ae3c10a640bff63bab91eca93d91a008cf6b3c3b2940c067b26862e59b77994a5d06e78f6559a6cac8046adb3cb55aa0a6045e2d97f278fe6742b105ac75c41b43ee3f266cf730fa56ac13c2dd8dde10a0be8d71425f3cf85ae694fe76364f3f969f9a7c6e17885d130847464296c48b5da070e8cc901632351df717698dfe8a7b4893ce2c54e31cad83384e4d07f0674dcca07fa9e57eed7d7a6a948bc7160c19e69782cca6fabd608bc80b90d1d4d632e3a2a0c3af3c71f002d7f333e7db207341bb417376dfcb2ab2bb304756ccb59a6d0912a0b64424768a2377abad61aaec162636ec5b0380c484e394311882681c2c9e3193a0f5fb2bb7ba04ec408a56a5832958b3c33b4832d451a20bd3a7d6138192b1205ca01e07ec92fe65383417ccfa913413371af583251fa353e828fa21d9a34554dd6ca022f409ca424e727c13e8217e83106aef5655c4bc3deb4515dc73896787a2f64ea08bf35f6bf95f333735713aac68eda57503999a74d73ba81703f68ccbfb917dfca0fcdcaf7f164784c69ff1076334750bab86c6747f5b0940d5e2a26d298d3d1dc9a0fed880a0eecf4dffa3f59b31965b05b5b2d11182d04f3c39707cf4fd9dc3119ba058c873c88442047fa07f91ccbb5dc5e69b106acabadd323e12eb77389809b421a0d14173c3034170a15d6c757f6d2e70b2572c3ba01d4eb635d1fcdff01e5de3a9800000000000000000000000000000000000000000000000000000000000000000000000000000000000000214f90211a026afb07de86e7b28609468f447285e4522f3e2c211e1e79b5fdc895cf6a815bea02b8baf008746fb33b6489973919fe4535293dafc9c73f27e3aae42ef10fce293a006dc8cf46bfc508b5d9aaa3800a449f26d577313e8fa97f27e22a6aec0c48adea0c12b475ad72e9f2ed329b520ada188340abe071ca312207f1ce55893c1560b24a0cf8b40886515305649db5dc3eab7655ed058fdd3fa031005b17591491c49b56ba0191f0c128cc796607f4111f2e263c3ef3846de6f9162c0b6c772f3b8a83c1c64a06c6ef0fd53d91057d7c551c15c5ca2cda70b4b2ef3704c389ef5778dbc1d6d99a038f2d204e5a1d99da90cf22c2641a33f98d7a2fea98d7987ad4d654b2c86fea7a0b3780c0fc124c719745778fe5686eeaa3e6d881a9c176ba92c75b52eb8f13f9da023f78227cfe5d092c033dc5ebb716f9fde821e0c3fef0dcd1b7037e69e52f84ea016e368d8719f35a639846b02816643ab804ff51d24c2b781e75da3d74096b6bda0399d8f36e8955b667a96b6005fae71ece74d57fd8d95c95a00adbb3a0c9e7255a0307dcc0b9f46ca1e732fa089f887b2b8b7e41c83321a84ece4bec3f0ad8aeee9a05d28fc350ab8612529b62c1bc32b8750362707b704cdd427381e286c6b6e0296a01978ff505350144fc3a62b8c75b04835979ff834f4e073ec6b9c6f77bb99545da0f7f8cd4512b82d9fabadaa5287d98c952a92d8ea8da84e9700b306dc63c7cc4a8000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f4f901f1a053df7249a37519eec5ca8f6b47dbadea25dce521092a30ac8f91b9e01665c338a04026dd021d7d4dc1aa14b924b30ee1facf513fdd28c217d9c0f2d7148abb0aeea004be2889c32fee2ff26b45e8054ab7a615ae531994c5e7cc9ebe886219f0bc25a07564c544eda037c83c83f6ae65824b6f5d424fa1d44ac0aaf916e6099b3e3a08a0de1cd98994a6bee50ea717651335d489ad9b8efe71af2b63c062b8bedd076066a01770f3f1979f2b9fd6e9a4881d12a4db9c8ce31051e630469c4ea49bf3ca1a13a0d425971abbad096ba172427bd3dca132bf0722659636987df7ff546460c09795a08aa3526c39f7d3285da20e75ab0ce3aded11b56c0663680ae1f7132e11d7f3daa08d7d65e487bd1f8abd12d6760a41499b45e943e8e24672c922cd6305e5b5a3a0a06aa20accd5484803bcbacf8db26023022a7cd2fe95201aeefdff337e6def3958a06035d6b76441e946e719d65e482a1625c8d20e036fbfe47312ca12050fb60f6c80a01e569d93ade0b0950427bfae37b8f40ab83a1529f99e0689d5fb43ab741fcf73a082e6e9d4fdf7aa2667286a7396e8bb9cd78b4723912e609b6b382fb8081bfc19a0d3c5bc0ab950302d724a7c7164418031c31615fa8e5cc61bee2782fcb5b71edaa02f66305ae8245ddfd7ace77482a5da7628fb10625782a65cae6eaefd5f2f6891800000000000000000000000000000000000000000000000000000000000000000000000000000000000000093f891808080a00b58ecec9cc75156a7b0e28fef187f9fa36eed49d0f72e2d8a357602e7015eafa00c20c1087b3a297fea4bee443727659ba097f631cf18dd0339584d59ab8e19f38080808080a0a5eda2866f0db928404a936f8f62d9829c06a6570779280b9d7c53aa23115b328080a0fa70313be2a234a88ca80f3022f3dc16fe9e902f24c88a8a73b06fa007f4f126808080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000053f85180808080808080808080808080a00d710e4f049100beca5afe20afe9352366808ce40288be2ddcda0e628722c2dda0f7ffcd13aa70f8587db296d469707eb595ccd1e2be404eaab4910482e21467848080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000068f8669d20d6c66fdeafd58dd28952ea547647ffe9bdf58ad841cd73ee5a6b66a3b846f8440180a079d679e43f0f4865e4446db7c5cdca33958591ba6a496b6d2e89e20240ae9189a026e751b9fd68f5207c6d2b35f2871bc22c1b05e9d20368c10257dc04ca67f46e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000700000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000000000056000000000000000000000000000000000000000000000000000000000000007a000000000000000000000000000000000000000000000000000000000000009e00000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000ca00000000000000000000000000000000000000000000000000000000000000214f90211a0e71364a87a30ec93adcc31feab1f0f02f199c89a3af7ec47e7add6f32ea563bda05d9bd3c0a8230d96cea8a572530c3094760726d2e711640894aaed935ec035c3a0ddd5020b03087141002232897f4b570b7359714a0b116ab459e9508059ef29b8a0c778bc087ded638adcc27e46eeec8c99b33f6739febcfe7a1d191a1da94d2bdca088864caf5758fff2ecbff3d505c60a925b9ca94d0080c99beed3dbec96b55362a0d50d225b5fd76fc95296db75a1c20bd7c08f387a2c495882d94248ad3f759c86a096b9f5bd51a657e0fad007b6b87308c991551b96ebe4046be3baf28ed6a7cfcca08f19244d4d78e9d62abe0f64e17ac1e766a2175ae88d5a53a0e5314f2bb39bb5a0c8d846aface6f0cba3928fdbd69713d796368adbb52fb177fc4acc3a562f2720a02e33da21d58f5763e428b45f8da3b5b3590b1de0a31e7f6720935242318d3463a0825661ced5554494df2ce3f4c761f312945db637875ae3286fdfd1a99b1cebeba038246716a60c381d57ac695bd3b789190fc961e09ba7db3e309421ca1f908a5da0912e8ab13d83e2c7390231e996fda71fe769339f4a734963acc5002051dc4fa6a002ba9990909e4dc33f81ede285b5159344d3eb93f58ff3fa26b680777388ba47a0c93b17dc31d2676829d3ba0f5147ac59d2db51006aa5717b7b9e645301ae6295a02e35f9d8be5c3b97d6be7e5dd0920a842d1908cb0fd64e790f285575c1d138ff800000000000000000000000000000000000000000000000000000000000000000000000000000000000000214f90211a0648f8225c7e62a5c45a1b4b74647e7e72bd7f40aec5c966ab3b42b8c2bb57759a0483b7483319b7d06a6a99dbc4be46186ff0e184903f18522acd6f0f70c3d5df2a02bb99ee031c6ead9ee0ce285ebde18c7e1e9ec47adeb469b04d8df1ad3516ecaa010fcec5ab5fcf322e2fd3ed60ccd774a117ce6fc222013b26f34ec733a6dbaa9a0ebf6f787355941dd447c3716760cbad0f6846236ddd06297d6dfc063628ca1d2a0a647cb2c3a603d66c18eea529f5c3b9028088288040b5c79e3a1e4a5fe6919dda01bb5219ce3335534421d1c4e2afa2b497dc1fa53984db8fc5505da3bc500be6fa0795d3e3c5817bc60f2310a52a51ee95457a2659879dd82334c6979ae7734f7eaa0c30653810e47b39aa2dc6e6ea9747e2420ebf1d26f57cdcbd572fd0f44a43d63a0feb0f4102a9971c4292f87c6c2c97f61c75e153b0bd26cae45dc9d4c6d0cca13a024143644ffb119ca87860dcd2fd763cac0f19075b3d1d92bdc5fcd98aaa6f365a06f298c65ed66a1e19b68615d95e2ad106f9ec0e48f9405068b1000d22881beeda0fc2f4a0b20c5bd9c0361a88c715eac7c063d70dfa33d8d3aab03d4ab7d20e02aa026ce4773527bbb6b2a875626273af926a544365c945b183f63b72eb59f6edceda01666963425a92a8a3a626aeb8655c869b1c8a4b7d3f47554d16a2fd699c81de9a06fee192920f4726a985211cb1828b160a0f286fb0bef6a20de0e116af652bb20800000000000000000000000000000000000000000000000000000000000000000000000000000000000000214f90211a03b097b76daa2e86c378c2147100b5e614d2959188a9c78410d812544ba5e7e52a0508615c798b1fed6a0317a3e9f49bb4009d6991f31ced8516d8c719d8036e43da0bd56fc62dc887f241ec8c6795df0faa814a37b4011554bf7aa758b0ec3fe40faa00bd567833c7d84c24bef628d1ca6b6b1029c4f3521302f72b84f5df7eab54c53a036bf469079cca62406f3783201a9fc881f28c6cc1ebafc09f0543c2792fddf1ca08fc6c5cf939fd8402dfc2a9108941ddf85d421992eb3b3cc259436b78935031ba0cb99b226a161df2a08db225e261f09a6296c304746b594d46eb6a2b672b3ff4fa0df399125017fbff8cf54fc73064c51a2899da9b2580208eaa034476371ce37a6a05ecb2c49c7b892184a16fd19fd87e6377acb85919e824f75e646003f360a721da05c15c1a7d1af50a704fd687d240cc8936f539a342b5c932f52fffe0a11df0d94a01053d7ff4619165986fe4e0941a530ffedfaa9a174a65eebb23a1da9d8cbf90aa0277eece6324d0a817a48c1c3828d411cbe3865e0b851461c445c1755d28d2d35a09e6ba59efcbec18b5318ee9c504c0824997cf76249cd3d83fd94bb02e2bd4cd1a07764910ebe95860292a9a77c2733239443dd4a1f832222587951a458c9a36c99a0119ccd4a467bcf92f97cdd9ec34d164b746e0ecc5f9e5547f5f7a0ec463ff5c5a05069af5a8d61a1ae559183c0b57f82980b54a073c1776e8521436eab7dcdb6cf800000000000000000000000000000000000000000000000000000000000000000000000000000000000000214f90211a0f5dee140cf2e3f9db3b798bb1c994b4d2f1bfd84425e76fc4a0dd8e382138fd8a0719a3fcdad0cca25b148b6cfde97c3ce9a967e96d74e870278a19778e6bde6dda015bbc28f0cd69348da426b9aa8168ba4ae98ebfed7cc6ee49e06ac6e62eb1f2ea0609709aec2d6126ff5d0401fe423a30fbd7cf465c7937b52f137bc9702c9643fa0e81fe9bf73a06bcc09fd4891e51d9f8a81ff07cc534aad3266ced2d0637cf993a09d236bc6f186564c6b71a07f41869e1c15337b5dec2a9b9a8249b38ca0d3e67ca012a123e046fcbdb3feb5447136c672ed02b28f74f344e58aad55257378a6d9a5a04895855e89f1d255a8781e825cf4c33c995bc3684bccd230760a22d90ce53328a088c2533f9dba3b7a579fe70ba46237d341333f288f10c06f153ae22d125c0d24a08b8dc4eba080d964fdbb97912b2c5c24272260e843bec71c56359751037c18c3a0590c668fce52ee3f2fb79e169b57df8402f1418c7343e97185fc274f78413844a04a0b5ab822824e6058417d06dfc7c4bbe112e2a9c8b56f17ccebe95b7cad7822a0e497c7503b3174367c45ee915013196e049a8fb0a2c20755951c9dbebccd3742a048f8423c1bc71eb66c2a35b57f7bba85009082ac693c250bba9b934c95da9b85a0288d0c933d308342c3f53ff12e9291a22b5bd514d69bfee62cc68817254098b6a05629b011231c887c440f9fdf2cae5ef0a725ee70a402c997c0b0d6a76c3bad3e8000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f4f901f1a0153313480880a363ce7dd1fba276a146043aa5f52f779e6b7896a1b1901e8118a004eca05220a439b17c07bef242ee9ccb4070735a9864baef6a78ff659d82d0caa08fe3ca62ad6c75751cfff9adfc6d0b182d6ca9d170f15152174620ccb923c5bca0d27e0b56336aa55d3cac753b30d038e29f6a4b1e324c2913472d6298d6c03453a018a84cbdf3b9d93754ea7699e8291add1631fbc4594a578e3672b71f66e94210a0a600ac22f62a91df319b17e50201326ecd8f674526f14516768aab5f25cb4cc2a0a856dbc45e17ade7ca8d0e8f1e53838ffbc6f1f97b74941fef281f6e168f312da0250d4394918bd20e7d743e61de75643c531d1a92e68973cada38308543db059da0246194f8903a15d7ab2a107344f31e2d3ea95547a187e0480a51ef9b37ef1f8580a013e4588468e215aac1234ffb0e8976ba5cc9e784519e1a57fb24fd3282289414a0e8e7d8d11e76e92eb36f70cbdccbb945b1b684b0c3942ed9f5d043d25f6e833fa0a84cb82f33a5e37a57a1ca81fb964519fcfa8281f6c522e112d1823adf46665da0d2964badc3466a3537f9291589b44adb7b02c6dad562a7754a9e2fac6ce15fc8a0eab78294fa5dac627de0119eea0c6e07634de49595a95e5830c185d054610574a08e98e6fe6102ab70e1c81754c5bc226aab47f3703cee98bb0372f3f872162d2b800000000000000000000000000000000000000000000000000000000000000000000000000000000000000073f87180808080a0de494e8e473c5acb5d26435ab04a6cc2c346fc1c45d18d77e9a159aace89a34880a05b4c328fdbaf2b3e7e9571e9f0cb8a2d1cf921d659d3a650d205699a41db938e8080808080a0598c9264044a8e848ad7c61c59a393079cb4eb68788e834bde37002761ad182a80808080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000043f8419e200191a0fdae0c222b0dcd673d75171ba4eae286073e851b05792ec35133a1a00ecbf53020c6abfdad937d293169f929be7712c5576f125eaffe33d891b9014e0000000000000000000000000000000000000000000000000000000000" + ); + } +} diff --git a/packages/relayer/pkg/mock/event_repository.go b/packages/relayer/pkg/mock/event_repository.go index f3593bbd7e1..0288419b8c3 100644 --- a/packages/relayer/pkg/mock/event_repository.go +++ b/packages/relayer/pkg/mock/event_repository.go @@ -200,7 +200,7 @@ func (r *EventRepository) LatestChainDataSyncedEvent( srcChainId uint64, syncedChainId uint64, ) (uint64, error) { - return 5, nil + return 3019062, nil } // DeleteAllAfterBlockID is used when a reorg is detected diff --git a/packages/relayer/pkg/proof/encoded_signal_proof.go b/packages/relayer/pkg/proof/encoded_signal_proof.go index 479f8306b83..f85d13821f6 100644 --- a/packages/relayer/pkg/proof/encoded_signal_proof.go +++ b/packages/relayer/pkg/proof/encoded_signal_proof.go @@ -10,6 +10,8 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/pkg/errors" + + "log/slog" ) type HopParams struct { @@ -56,6 +58,11 @@ func (p *Prover) abiEncodeSignalProofWithHops(ctx context.Context, return nil, errors.Wrap(err, "hop p.getEncodedMerkleProof") } + slog.Info("hop proof", "hop.BlockNumber", hop.BlockNumber) + slog.Info("hop proof", "block.NumberU64()", block.NumberU64()) + slog.Info("hop proof", "hop.ChainID.Uint64()", hop.ChainID.Uint64()) + slog.Info("hop proof", "block.Root()", block.Root()) + hopProofs = append(hopProofs, encoding.HopProof{ BlockID: block.NumberU64(), ChainID: hop.ChainID.Uint64(), @@ -87,6 +94,10 @@ func (p *Prover) getProof( ) (*StorageProof, error) { var ethProof StorageProof + slog.Info("getProof", "signalServiceAddress", signalServiceAddress.Hex()) + slog.Info("getProof", "key", key) + slog.Info("getProof", "blockNumber", blockNumber) + err := c.CallContext(ctx, ðProof, "eth_getProof", diff --git a/packages/relayer/processor/process_message.go b/packages/relayer/processor/process_message.go index 4d87ce5f4eb..21dcfe11a1e 100644 --- a/packages/relayer/processor/process_message.go +++ b/packages/relayer/processor/process_message.go @@ -374,6 +374,7 @@ func (p *Processor) generateEncodedSignalProof(ctx context.Context, ctx, hops, ) + slog.Info("encodedSignalProof is", "encodedSignalProof", common.Bytes2Hex(encodedSignalProof)) if err != nil { slog.Error("error encoding hop proof", diff --git a/packages/relayer/processor/process_message_test.go b/packages/relayer/processor/process_message_test.go index 704f541b3a5..d7d91019318 100644 --- a/packages/relayer/processor/process_message_test.go +++ b/packages/relayer/processor/process_message_test.go @@ -3,8 +3,17 @@ package processor import ( "context" "encoding/json" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/rpc" + "github.com/taikoxyz/taiko-mono/packages/relayer/bindings/erc20vault" + "github.com/taikoxyz/taiko-mono/packages/relayer/bindings/signalservice" + "github.com/taikoxyz/taiko-mono/packages/relayer/pkg/encoding" + "github.com/taikoxyz/taiko-mono/packages/relayer/pkg/proof" + "log/slog" "math/big" "testing" + "time" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" @@ -47,6 +56,86 @@ func Test_sendProcessMessageCall(t *testing.T) { assert.Equal(t, err, errUnprocessable) } +func Test_generateEncodedSignalProof(t *testing.T) { + // Test data is from this + // https://holesky.etherscan.io/tx/0x086729ca21c2db5714560943a6522362c837c9cf6424dfcc7b8f15f132b7f934 + // https://relayer.hekla.taiko.xyz/events?address=0x1D2D1bb9D180541E88a6a682aCf3f61c1605B190&event=MessageSent + privateKey, _ := crypto.HexToECDSA(dummyEcdsaKey) + srcRpcClient, err := rpc.Dial("https://l1rpc.hekla.taiko.xyz") + assert.Nil(t, err) + srcEthClient, err := ethclient.Dial("https://l1rpc.hekla.taiko.xyz") + assert.Nil(t, err) + destEthClient, err := ethclient.Dial("https://rpc.hekla.taiko.xyz") + assert.Nil(t, err) + prover, err := proof.New(srcEthClient, encoding.CACHE_NOTHING) + assert.Nil(t, err) + destBridge, err := bridge.NewBridge(common.HexToAddress("0x1670090000000000000000000000000000000001"), destEthClient) + assert.Nil(t, err) + destERC20Vault, err := erc20vault.NewERC20Vault( + common.HexToAddress("0x1670090000000000000000000000000000000002"), + destEthClient, + ) + assert.Nil(t, err) + srcSignalService, err := signalservice.NewSignalService( + common.HexToAddress("0x6Fc2fe9D9dd0251ec5E0727e826Afbb0Db2CBe0D"), + srcEthClient, + ) + assert.Nil(t, err) + p := &Processor{ + eventRepo: &mock.EventRepository{}, + destBridge: destBridge, + srcEthClient: srcEthClient, + destEthClient: destEthClient, + destERC20Vault: destERC20Vault, + srcSignalService: srcSignalService, + srcSignalServiceAddress: common.HexToAddress("0x6Fc2fe9D9dd0251ec5E0727e826Afbb0Db2CBe0D"), + ecdsaKey: privateKey, + prover: prover, + srcCaller: srcRpcClient, + profitableOnly: false, + headerSyncIntervalSeconds: 1, + confTimeoutInSeconds: 900, + confirmations: 1, + queue: &mock.Queue{}, + backOffRetryInterval: 1 * time.Second, + backOffMaxRetries: 1, + ethClientTimeout: 10 * time.Second, + srcChainId: big.NewInt(17000), + destChainId: big.NewInt(167009), + txmgr: &mock.TxManager{}, + cfg: &Config{ + DestBridgeAddress: common.HexToAddress("0x1670090000000000000000000000000000000001"), + }, + maxMessageRetries: 5, + destQuotaManager: &mock.QuotaManager{}, + processingTxHashes: make(map[common.Hash]bool, 0), + } + sentMsg := &bridge.BridgeMessageSent{ + MsgHash: common.HexToHash("0x0ECBF53020C6ABFDAD937D293169F929BE7712C5576F125EAFFE33D891B9014E"), + Message: bridge.IBridgeMessage{ + Id: 1636356, + Fee: 0, + GasLimit: 3000000, + From: common.HexToAddress("0x1d2d1bb9d180541e88a6a682acf3f61c1605b190"), + SrcChainId: 17000, + SrcOwner: common.HexToAddress("0x1d2d1bb9d180541e88a6a682acf3f61c1605b190"), + DestChainId: 167009, + DestOwner: common.HexToAddress("0x95f6077c7786a58fa070d98043b16df2b1593d2b"), + To: common.HexToAddress("0x95f6077c7786a58fa070d98043b16df2b1593d2b"), + Value: big.NewInt(0), + Data: common.Hex2Bytes("7f07c947000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000005c000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ca11bde05977b3631167028862be2a173976ca110000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000004e482ad56cb0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002e000000000000000000000000000000000000000000000000000000000000003a000000000000000000000000016700900000000000000000000000000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000243659cfe6000000000000000000000000637b1e6e71007d033b5d4385179037c90665a2030000000000000000000000000000000000000000000000000000000000000000000000000000000016700900000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000243659cfe600000000000000000000000050216f60163ef399e22026fa1300aea8eeba34620000000000000000000000000000000000000000000000000000000000000000000000000000000016700900000000000000000000000000000100020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000001063f4cf9eaaa67b5dc9750d96ec0bd885d10aee0000000000000000000000000000000000000000000000000000000000000000000000000000000016700900000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000001063f4cf9eaaa67b5dc9750d96ec0bd885d10aee000000000000000000000000000000000000000000000000000000000000000000000000000000001670090000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000064d8f4648f0000000000000000000000000000000000000000000000000000000000028c61627269646765645f6572633230000000000000000000000000000000000000000000000000000000000000001baf1ab3686ace2fd47e11ac627f3cc626aec0ff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"), + }, + Raw: types.Log{ + Address: common.HexToAddress("0xA098b76a3Dd499D3F6D58D8AcCaFC8efBFd06807"), + // update LatestChainDataSyncedEvent in pkg/mock/event_repository.go to the same value + BlockNumber: 3019062, + }, + } + bytes, err := p.generateEncodedSignalProof(context.Background(), sentMsg) + assert.Nil(t, err) + slog.Info("value is", "value", common.Bytes2Hex(bytes)) +} + func Test_ProcessMessage_messageUnprocessable(t *testing.T) { p := newTestProcessor(true) body := &queue.QueueMessageSentBody{