Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure of Solidity script on Nova while pass on other EVM chains #2773

Open
abhi3700 opened this issue May 17, 2024 · 13 comments · Fixed by #2833
Open

Failure of Solidity script on Nova while pass on other EVM chains #2773

abhi3700 opened this issue May 17, 2024 · 13 comments · Fixed by #2833

Comments

@abhi3700
Copy link
Contributor

Found an issue while running a Foundry script on Nova of Devnet (version: 2024-may-06).
The foundry script has 32 txs: (16: CREATE, 16: CALL).

Public

Result of running the script sending transactions to Nova Devnet (public).

No manual gas limit set.

Script
Command:

$ source .env
$ forge script ./script/lz/LZSetup.s.sol:LZSetupScript --private-key ${DEPLOYER_PRIVATE_KEY} --rpc-url ${NOVA_RPC_URL} --broadcast

Initially, when I sent 32 txs using a foundry script, it got stuck (also in some cases failed due to OutOfGas error) & then exited after long wait. And then I found from the PolkadotJS explorer that it's waiting in Nova pool:
image
And then on re-running the script, more txs got stuck in the same pool.

Local

I decided to try it on local Devnet Nova to see the result.

A. No gas limit set

Run LZSetup script having 32 txs (16: CREATE, 16: CALL), without any gas-price, gas-limit flags in CLI command or in the code.

Terminal output:
❯ forge script ./script/lz/LZSetup.s.sol:LZSetupScript --private-key ${DEPLOYER_PRIVATE_KEY} --rpc-url ${NOVA_RPC_URL} --legacy --broadcast
[⠔] Compiling...
[⠑] Compiling 1 files with 0.8.24
[⠘] Solc 0.8.24 finished in 7.31s
Compiler run successful!
Script ran successfully.

== Logs ==
  LZ Infra addresses written to  ./lzsetup_addresses_nova.txt

## Setting up 1 EVM.

==========================

Chain 490000

Estimated gas price: 0.5 gwei

Estimated total gas used for script: 44996613

Estimated amount required: 0.0224983065 ETH

==========================
##
Sending transactions [0 - 31].
⠒ [00:00:00] [#########################################################################################################>--------------------------------------------------------------] 20/32 txes (0.0s)##
Waiting for receipts.
⠚ [00:00:49] [####################################################################################################################################################################] 32/32 receipts (0.0s)
##### 490000
✅  [Success]Hash: 0x310ae9cd88f4a24d785cef3679bfb67c7cd8a1aafa2905e89d08a469b1ca9a3e
Contract Address: 0xD45E290062Bd0D1C640D59C350cA03CC291b37FA
Block: 677
Paid: 0.0024027835 ETH (4805567 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x39e4a0f386028d1c2be12cf4735b585c338626c61baa583b416c596859be36f5
Contract Address: 0x6eA3524AD29729b10F324fD2aF967beed9cc4E68
Block: 677
Paid: 0.0003030225 ETH (606045 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x69fd6c94c40c2d9de78cc0c7936311947a5bb72189300f06b3173bde1d944e9b
Block: 677
Paid: 0.0000342535 ETH (68507 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0xc0478a2e9558ed13ad206b4984aa3743c6d1f8a46a5b8bc7dd4f5ebea9e15f87
Contract Address: 0x71d5a92A9056aB2Ee81811aF045439e059Dd6FBc
Block: 677
Paid: 0.0003469685 ETH (693937 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0xbf56e5ee06c1d44226c33bc44c4402ef5be012601aede9fb243610ea12d1a802
Contract Address: 0xaDB5683bF6699D6F86f296957af5971648e855A6
Block: 677
Paid: 0.000736339 ETH (1472678 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x0033ed12cf0481c12347fff951446c157b490be2b1f2226754e06ad112611841
Contract Address: 0x651D52054c8ac4b19191d7427C2633797567D39c
Block: 679
Paid: 0.0020693855 ETH (4138771 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x44b851a5dcb536dc7571b119d65cdbb755126c235430f6a601949ba5b84d6ce2
Contract Address: 0x07aa061c3d7E291348Ea2Df3C33ccFe61c926AcB
Block: 679
Paid: 0.001084459 ETH (2168918 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0xac9ee0288d5a1c59442d4ebf93ce2c78ec9e2b895d10089fc76539b510cf3371
Block: 679
Paid: 0.000056742 ETH (113484 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0xfe0b92041b0d0b4c3328ffae3546dd7d8ed784d3a3391ee8fa7e90d8cb435e3c
Contract Address: 0xf2D374B77db32284D79FCbf72b0d97d16D031cdf
Block: 680
Paid: 0.001269175 ETH (2538350 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0xcac91e318d3b12521d8abc3bedc0891efd9ddc3978e1ea2f392293eecb6f7f4f
Contract Address: 0x7b21801C4B7219BDeb3494AC98e948abBD25b2e9
Block: 680
Paid: 0.000203909 ETH (407818 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0xabecd45742fdbc959740099c1dcb05fdc24ce50ede185af6554428fc645fcc4f
Contract Address: 0xE07fd4CC631b88aD64d3782A7eCDC1D4c8382b70
Block: 680
Paid: 0.00014932 ETH (298640 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x549e979f763e73a2907bd845cab9e21b18fadfd1b94de0222b0da5f0bd77c579
Contract Address: 0xc2A5734B4021f2dD0c27f949Ef84Eb5De96360E5
Block: 680
Paid: 0.0020513405 ETH (4102681 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x72ade09188a7d69b1386b7c8c813b401023e21fdcf9253547d12c84faf454be1
Contract Address: 0xA758c15e87Da64bac82badd9e03F30D7E18d7677
Block: 681
Paid: 0.0012669655 ETH (2533931 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x331cf4b05cbb2ea5876c0be7240716dba6df9dccad922656e3b072b3dc77649f
Contract Address: 0xEb7b83063a68d8a25a2c9aE5d9f3535a2e78A8E9
Block: 681
Paid: 0.0006541705 ETH (1308341 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0xe6454627f9bab3ea185e3417f03e36f256291c7134a0b34f20db2550639333c4
Block: 681
Paid: 0.000079273 ETH (158546 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0xb0e7ddb8bdb1fd1f184c5605dfe31aa757d70cc6c9f0e040f35861f4eff2c9b7
Contract Address: 0x6CAa59f27B0b3b5Adc07a2b3EcB7142B3C74f424
Block: 681
Paid: 0.001655623 ETH (3311246 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x47415515897a75eb4f0494a9b046a31a7ed0f7b68e04786fdf74a77146df6259
Block: 681
Paid: 0.000030446 ETH (60892 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x33af945c70b7b792ce0c3e51a86bfc426d4655a1bd4f88de539b7f575be92736
Contract Address: 0x74daA94Fe6Cf3D1A2481f4B9A8183B3189EFB43F
Block: 684
Paid: 0.000440396 ETH (880792 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x63491cc5f70e7d5b0536b48591fb1b73cebb09c3730cbb72662b662fb7b842aa
Contract Address: 0xF090c0b7aF977DCf4decab59a5eeDe1514423332
Block: 684
Paid: 0.001384583 ETH (2769166 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0xbfc095dc6797e66220967be6cdfd2c3733dd64482bcb2403500309e4546ec3f3
Contract Address: 0x67931E165e1bd36AbB4b204f1393c36fb6712a7A
Block: 684
Paid: 0.0005431225 ETH (1086245 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0xa7f414e8e71f9d12fac2fe6c46f38dfd2f9124ee6219607f245f8fa55cb3e9f3
Block: 684
Paid: 0.0001572305 ETH (314461 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x56bbbf216134f8950d39a443fd5ad75657c755ae9b317cd7d096b38732678838
Block: 684
Paid: 0.000036898 ETH (73796 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x23ac3b50714fd58eff240662403fdd2a96b7f7c2458413978d90be612fa4d069
Block: 684
Paid: 0.0000536235 ETH (107247 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0xcfcc34ecb2e8ffe583c36a8440c95ea14aebd755ec5278555a5a27df891190c9
Block: 684
Paid: 0.00005357 ETH (107140 gas * 0.5 gwei)


Transactions saved to: /Users/abhi3700/F/coding/github_repos/subspace/subspace-evm-contracts/broadcast/LZSetup.s.sol/490000/run-latest.json

Sensitive values saved to: /Users/abhi3700/F/coding/github_repos/subspace/subspace-evm-contracts/cache/LZSetup.s.sol/490000/run-latest.json

Error: 
Transaction Failure: 0x843b014790b513712d0dc0f9eaf19e16ee60bf9bfbd9fb45d931cb5daf24c339
Transaction Failure: 0xbca187297c8fcb4eab9004abffa146df66f2382815fe52919c54148272b49372
Transaction Failure: 0x6c7f83199ccf152c0da86b4eb0d54905c42fd6d37976dc02642101d7eec0c463
Transaction Failure: 0x095677df2a0036aa5dcb5553937ac39ee0eb78952af29ea577b4c8b99d508343
Transaction Failure: 0xe015968bfe4e5f2a8ee926c1732d343ed72ca211943d8d499c483cc6cdb660ca
Transaction Failure: 0x591c2cc9e4f9dfa219595dbc5778aeb61b5d3defd5e83de925038e692ef25b40
Transaction Failure: 0xe87c204bfe74503d33df8a767bab5bcb176d47a5554ef7d75ba8f98d83243fdd
Transaction Failure: 0xdc66435dad5353661b8d735ba9263a63de9bdaf7b65d9b7614bc8abc439b5b16

8/32 txs failed. All the failed txs are of CALL type.

Attached herewith the entire broadcasted txs details:
run-latest.json

And then on Nova PolkadotJS explorer, manually located each failed txs by its block number & tx-index from corresponding tx-hash: 0x843b014790b513712d0dc0f9eaf19e16ee60bf9bfbd9fb45d931cb5daf24c339 like this:

❯ cast tx 0x843b014790b513712d0dc0f9eaf19e16ee60bf9bfbd9fb45d931cb5daf24c339 --rpc-url $NOVA_RPC_URL

blockHash            0x8698c9631724d3c09b8a5e611d4e0c0ac3d06508be4a0b7fb8d98c7bcd8294ac
blockNumber          679
from                 0xf24FF3a9CF04c71Dbc94D0b566f7A27B94566cac
gas                  107764
gasPrice             500000000
hash                 0x843b014790b513712d0dc0f9eaf19e16ee60bf9bfbd9fb45d931cb5daf24c339
input                0xe8964e81000000000000000000000000651d52054c8ac4b19191d7427c2633797567d39c
nonce                42
r                    0x8b68788cb60ef3548919e4ac5186c408ebbf2125fdd024bd9a00484183ca378c
s                    0x57f87cd9a20b8e4390946ede93b40726f5323a67a4aa79daebdd7c4255784a01
to                   0xD45E290062Bd0D1C640D59C350cA03CC291b37FA
transactionIndex     3
v                    980036
value                0
creates              null

Found that all of them failed due to OutOfGas error except the last one that failed due to Reverted error.

image

image


Please note that I have tried running the same script on ETH Sepolia testnet and it ran successfully there ✅ .
Script. This script is different than the Nova one just in terms of LayerZero (LZ) parameters (with values of type: uint32).

Terminal output:
forge script ./script/lz/LZSetupSepolia.s.sol:LZSetupScript --private-key ${DEPLOYER_PRIVATE_KEY} --rpc-url ${SEPOLIA_RPC_URL} --broadcast  --verify --verifier blockscout --verifier-url $ETHSEPOLIA_VERIFIER_URL
[⠒] Compiling...
No files changed, compilation skipped
Script ran successfully.

== Logs ==
  LZ Infra addresses written to  ./lzsetup_addresses_sepolia.txt

## Setting up 1 EVM.

==========================

Chain 11155111

Estimated gas price: 192.083706936 gwei

Estimated total gas used for script: 45019827

Estimated amount required: 8.647575255777420072 ETH

==========================
##
Sending transactions [0 - 31].
⠙ [00:00:14] [#######################################################################################################################] 32/32 txes (0.0s)##
Waiting for receipts.
⠚ [00:00:24] [###################################################################################################################] 32/32 receipts (0.0s)
##### sepolia
✅  [Success]Hash: 0x235488c1cba11154b397200e7ccecd0a2fbe7813951758f1660f35674cbdab6b
Contract Address: 0xA29c2e7a6F79f357f925c61f8d715f27fF32Be13
Block: 5908417
Paid: 0.440419130724571005 ETH (4805555 gas * 91.647922191 gwei)


##### sepolia
✅  [Success]Hash: 0xf3fa759f7c8f0322d0d7940f8db21276e1e19fd6cf1afe917688d3533580923b
Contract Address: 0xa061b093584133a598d4910266cF5af3D9F10eEC
Block: 5908417
Paid: 0.055542765004244595 ETH (606045 gas * 91.647922191 gwei)


##### sepolia
✅  [Success]Hash: 0xfddd9158d486ede7b8e3b98dfbc309d466ad98aa912731fa4bf3d8499a135240
Block: 5908417
Paid: 0.006279623980605129 ETH (68519 gas * 91.647922191 gwei)


##### sepolia
✅  [Success]Hash: 0x4dcb254016d387f1e1a2a82c5b0756e21e22c7e2d8d930865710d8d1cf50a878
Contract Address: 0x4Fb140e851470747A028826127a4651C346bB1d7
Block: 5908417
Paid: 0.063597884181455967 ETH (693937 gas * 91.647922191 gwei)


##### sepolia
✅  [Success]Hash: 0x94bd24209eccdf3d0fd3e96016adc2e28090b8e413d2b5d2233b73037a5194f3
Contract Address: 0x53D41d49dD4bF6AE0Ebd21D69ABbAC2034373De9
Block: 5908417
Paid: 0.13496897853146379 ETH (1472690 gas * 91.647922191 gwei)


##### sepolia
✅  [Success]Hash: 0x6831561334abf2d36c4def744d985850f7710b5f1ea4d20a5593c79bd69cd243
Contract Address: 0x10FF3Eb1855620C7B6055B15A2D5Aa8b4857D9b7
Block: 5908417
Paid: 0.379310862349433553 ETH (4138783 gas * 91.647922191 gwei)


##### sepolia
✅  [Success]Hash: 0x141a2ee2016745cc5e0c8b1bac223e01af0fabdc27aa6d65a3acfcb17ce2a90d
Contract Address: 0xed7F1b2165206396FE68853ad703CCe3A5fac287
Block: 5908417
Paid: 0.19877792787772563 ETH (2168930 gas * 91.647922191 gwei)


##### sepolia
✅  [Success]Hash: 0x3de9ac46bfa0c251f6c7ed5aef04ae59922eb055e6b5bb274728bb494fe4210e
Block: 5908417
Paid: 0.007148812874664573 ETH (78003 gas * 91.647922191 gwei)


##### sepolia
✅  [Success]Hash: 0x55d548a0b9b5f2058f003c4d49397c6ab6aba1a3d17e9cfe115646b8215fcf46
Block: 5908417
Paid: 0.00715037088934182 ETH (78020 gas * 91.647922191 gwei)


##### sepolia
✅  [Success]Hash: 0x1cad9a755270a400d2da55730d619b645beaccbf76848851ab1e7aaf7bd96854
Block: 5908417
Paid: 0.007157427779350527 ETH (78097 gas * 91.647922191 gwei)


##### sepolia
✅  [Success]Hash: 0xcd3c30bfc04172187dbff425a2dfa377b790d4cb945992f0330168208ae4b060
Contract Address: 0x6B9c0DC56746930FC91dF448eA8a54E1A231501F
Block: 5908418
Paid: 0.2516036743778652 ETH (2538350 gas * 99.120954312 gwei)


##### sepolia
✅  [Success]Hash: 0xf68111b5d9943a8b1a271b674f08daf335285da3b5145927ea49c4e3284bc7bf
Contract Address: 0x8d08752f75d34d90fad547aDA67e5D7f0a7d7C85
Block: 5908418
Paid: 0.040423309345611216 ETH (407818 gas * 99.120954312 gwei)


##### sepolia
✅  [Success]Hash: 0xbc53a3ed249acf6eb6c9f0ccef4fe3ec4d9981a27d86a33e090dfd1097b37eee
Contract Address: 0x8cDa124f07AE6EEDf1132992D0D02C893DAdB778
Block: 5908418
Paid: 0.02960148179573568 ETH (298640 gas * 99.120954312 gwei)


##### sepolia
✅  [Success]Hash: 0x0371321a2c08b0f5e23171527382d3541a7069d574da6d23caf4c9e8b1b7f19f
Contract Address: 0xDfE9248b6bb41f6Bc1efc8221096b7D8fB50e3eA
Block: 5908418
Paid: 0.406660466506258728 ETH (4102669 gas * 99.120954312 gwei)


##### sepolia
✅  [Success]Hash: 0xa4a56c14ad7318b851ae424545569b2bb7a6771c86518b5d24478eab839aef23
Contract Address: 0x46eEDB3d85dbB1BcCF378D67BfAfBE9218337253
Block: 5908418
Paid: 0.251164469429308728 ETH (2533919 gas * 99.120954312 gwei)


##### sepolia
✅  [Success]Hash: 0x45e77c067b4e24fef1457e9a58c584022d58614d70152a7355eb4a1485cad140
Contract Address: 0x0A5CF11494bf5f1953f957cE19741db77B1fB8c4
Block: 5908418
Paid: 0.129684008485516392 ETH (1308341 gas * 99.120954312 gwei)


##### sepolia
✅  [Success]Hash: 0x7c027fa79505916a0b192da643fea65a4699d87eca1e5883ef98f48b95c5eaec
Block: 5908418
Paid: 0.015715230822350352 ETH (158546 gas * 99.120954312 gwei)


##### sepolia
✅  [Success]Hash: 0x5375efbb8f582cc9ef7da88bafb8eaaf57b6c69adbee10431fe558000c34ec83
Contract Address: 0x3faa5679622c01Fa5c2Ae1f63e9Cb6353D5B80AA
Block: 5908418
Paid: 0.328212674030341008 ETH (3311234 gas * 99.120954312 gwei)


##### sepolia
✅  [Success]Hash: 0xc3d543887ce802d449295783a1dc459f71c8b1ec88882322ae6de0dc6adb317c
Block: 5908418
Paid: 0.005069838571150176 ETH (51148 gas * 99.120954312 gwei)


##### sepolia
✅  [Success]Hash: 0x5afe0f8e0aa22ed047dec45ddf2522a371095fa3e184d6921062a76e3d08b8ad
Contract Address: 0x1B2dEc5C9dd3Fca285f0e64503242A6e0D0cEb28
Block: 5908418
Paid: 0.087304943590375104 ETH (880792 gas * 99.120954312 gwei)


##### sepolia
✅  [Success]Hash: 0x41126366b307c7ed635146c49ea3537f2cb46a4bc423d2c6939b64f9c0230d8a
Block: 5908418
Paid: 0.003009411293866632 ETH (30361 gas * 99.120954312 gwei)


##### sepolia
✅  [Success]Hash: 0x7c11e4c44ba8e3d706218f96ec4f47b22bec19c872b95f6ff7a4ce8de6fb9d4c
Block: 5908418
Paid: 0.002987208200100744 ETH (30137 gas * 99.120954312 gwei)


##### sepolia
✅  [Success]Hash: 0x80870e26face7881203376c1c648a5ad73a83a6f62883649a452b8b97c817516
Contract Address: 0x690Aaf2045F9D604798B6CF0895a046b7D89C5fd
Block: 5908418
Paid: 0.274482376568343792 ETH (2769166 gas * 99.120954312 gwei)


##### sepolia
✅  [Success]Hash: 0x6534b8bc0d0d7e1096651d8b02b8237ad10374fd31c3d94abf75c39bc74e0fee
Contract Address: 0xE03d7e81b49e2498dED206403F1591095E1d484d
Block: 5908419
Paid: 0.120848092919820015 ETH (1086245 gas * 111.253071747 gwei)


##### sepolia
✅  [Success]Hash: 0x005f8f22bb4cf631421e59d1bb6dedad8e3fe6e5d3474779610150caef937f64
Block: 5908419
Paid: 0.034986087231494331 ETH (314473 gas * 111.253071747 gwei)


##### sepolia
✅  [Success]Hash: 0x2e4fe11e4e020680ab16e25e4097a308ba91c8ed238d0742441c783ef8e46219
Block: 5908419
Paid: 0.00337430566608651 ETH (30330 gas * 111.253071747 gwei)


##### sepolia
✅  [Success]Hash: 0x6f6b8255560230b5939914fad8226b885db0a4986685fe5885a4194984cdaf70
Block: 5908419
Paid: 0.008211366719502576 ETH (73808 gas * 111.253071747 gwei)


##### sepolia
✅  [Success]Hash: 0x73a26dbe60944f26135abd1a0ed91b47b060039d0367986655dd4a38d1028db7
Block: 5908419
Paid: 0.005631296732617899 ETH (50617 gas * 111.253071747 gwei)


##### sepolia
✅  [Success]Hash: 0x73ea23f402e9837d4c3aa8abdc448a1ad53aa4f8a11831bb9827fff11b58afe0
Block: 5908419
Paid: 0.011932893222511473 ETH (107259 gas * 111.253071747 gwei)


##### sepolia
✅  [Success]Hash: 0x42d11313957af127d434a2a9b6d46f033ce6b64db3e48b0332659e9d970c3b7f
Block: 5908419
Paid: 0.011920989143834544 ETH (107152 gas * 111.253071747 gwei)


##### sepolia
✅  [Success]Hash: 0xdca48e0f40f2f5eb76d9b299c1564bac372ebb862dfa073e50266a26d225e1e0
Block: 5908419
Paid: 0.006303932804400261 ETH (56663 gas * 111.253071747 gwei)


##### sepolia
✅  [Success]Hash: 0x9fccfcbe777501230f9753a50b9445659be7b53998d2d41f90f95d58270efb87
Block: 5908419
Paid: 0.007023962684746845 ETH (63135 gas * 111.253071747 gwei)



==========================

ONCHAIN EXECUTION COMPLETE & SUCCESSFUL.
Total Paid: 3.336505804334694795 ETH (34499382 gas * avg 100.197789802 gwei)
##
Start verification for (17) contracts
Start verifying contract `0xA29c2e7a6F79f357f925c61f8d715f27fF32Be13` deployed on sepolia

Submitting verification for [lib/LayerZero-v2/protocol/contracts/EndpointV2.sol:EndpointV2] 0xA29c2e7a6F79f357f925c61f8d715f27fF32Be13.
Contract source code already verified
Start verifying contract `0x93bbc2CAFB28Deb30f6Bd6aeCbc7A0B89345f485` deployed on sepolia

Submitting verification for [lib/LayerZero-v2/protocol/contracts/messagelib/BlockedMessageLib.sol:BlockedMessageLib] 0x93bbc2CAFB28Deb30f6Bd6aeCbc7A0B89345f485.
Submitted contract for verification:
    Response: `OK`
    GUID: `93bbc2cafb28deb30f6bd6aecbc7a0b89345f4856644c90f`
    URL: https://sepolia.etherscan.io/address/0x93bbc2cafb28deb30f6bd6aecbc7a0b89345f485
Contract verification status:
Response: `OK`
Details: `Pass - Verified`
Contract successfully verified
Start verifying contract `0xa061b093584133a598d4910266cF5af3D9F10eEC` deployed on sepolia

Submitting verification for [lib/LayerZero-v2/protocol/contracts/EndpointV2View.sol:EndpointV2View] 0xa061b093584133a598d4910266cF5af3D9F10eEC.
Submitted contract for verification:
    Response: `OK`
    GUID: `a061b093584133a598d4910266cf5af3d9f10eec6644c912`
    URL: https://sepolia.etherscan.io/address/0xa061b093584133a598d4910266cf5af3d9f10eec
Contract verification status:
Response: `OK`
Details: `Pass - Verified`
Contract successfully verified
Start verifying contract `0x4Fb140e851470747A028826127a4651C346bB1d7` deployed on sepolia

Submitting verification for [lib/LayerZero-v2/messagelib/contracts/Treasury.sol:Treasury] 0x4Fb140e851470747A028826127a4651C346bB1d7.
Submitted contract for verification:
    Response: `OK`
    GUID: `4fb140e851470747a028826127a4651c346bb1d76644c915`
    URL: https://sepolia.etherscan.io/address/0x4fb140e851470747a028826127a4651c346bb1d7
Contract verification status:
Response: `OK`
Details: `Pass - Verified`
Contract successfully verified
Start verifying contract `0x53D41d49dD4bF6AE0Ebd21D69ABbAC2034373De9` deployed on sepolia

Submitting verification for [lib/LayerZero-v2/protocol/contracts/messagelib/SimpleMessageLib.sol:SimpleMessageLib] 0x53D41d49dD4bF6AE0Ebd21D69ABbAC2034373De9.
Submitted contract for verification:
    Response: `OK`
    GUID: `53d41d49dd4bf6ae0ebd21d69abbac2034373de96644c91d`
    URL: https://sepolia.etherscan.io/address/0x53d41d49dd4bf6ae0ebd21d69abbac2034373de9
Contract verification status:
Response: `OK`
Details: `Pending in queue`
Contract verification status:
Response: `OK`
Details: `Pass - Verified`
Contract successfully verified
Start verifying contract `0x10FF3Eb1855620C7B6055B15A2D5Aa8b4857D9b7` deployed on sepolia

Submitting verification for [lib/LayerZero-v2/messagelib/contracts/uln/uln302/SendUln302.sol:SendUln302] 0x10FF3Eb1855620C7B6055B15A2D5Aa8b4857D9b7.
Submitted contract for verification:
    Response: `OK`
    GUID: `10ff3eb1855620c7b6055b15a2d5aa8b4857d9b76644c92f`
    URL: https://sepolia.etherscan.io/address/0x10ff3eb1855620c7b6055b15a2d5aa8b4857d9b7
Contract verification status:
Response: `OK`
Details: `Pending in queue`
Contract verification status:
Response: `OK`
Details: `Pass - Verified`
Contract successfully verified
Start verifying contract `0xed7F1b2165206396FE68853ad703CCe3A5fac287` deployed on sepolia

Submitting verification for [lib/LayerZero-v2/messagelib/contracts/uln/uln302/ReceiveUln302.sol:ReceiveUln302] 0xed7F1b2165206396FE68853ad703CCe3A5fac287.
Submitted contract for verification:
    Response: `OK`
    GUID: `ed7f1b2165206396fe68853ad703cce3a5fac2876644c942`
    URL: https://sepolia.etherscan.io/address/0xed7f1b2165206396fe68853ad703cce3a5fac287
Contract verification status:
Response: `OK`
Details: `Pending in queue`
Contract verification status:
Response: `OK`
Details: `Pass - Verified`
Contract successfully verified
Start verifying contract `0x6B9c0DC56746930FC91dF448eA8a54E1A231501F` deployed on sepolia

Submitting verification for [lib/LayerZero-v2/messagelib/test/mocks/EndpointV1.sol:EndpointV1] 0x6B9c0DC56746930FC91dF448eA8a54E1A231501F.
Submitted contract for verification:
    Response: `OK`
    GUID: `6b9c0dc56746930fc91df448ea8a54e1a231501f6644c954`
    URL: https://sepolia.etherscan.io/address/0x6b9c0dc56746930fc91df448ea8a54e1a231501f
Contract verification status:
Response: `OK`
Details: `Pending in queue`
Contract verification status:
Response: `OK`
Details: `Pass - Verified`
Contract successfully verified
Start verifying contract `0x8d08752f75d34d90fad547aDA67e5D7f0a7d7C85` deployed on sepolia

Submitting verification for [lib/LayerZero-v2/messagelib/contracts/uln/uln301/TreasuryFeeHandler.sol:TreasuryFeeHandler] 0x8d08752f75d34d90fad547aDA67e5D7f0a7d7C85.
Submitted contract for verification:
    Response: `OK`
    GUID: `8d08752f75d34d90fad547ada67e5d7f0a7d7c856644c967`
    URL: https://sepolia.etherscan.io/address/0x8d08752f75d34d90fad547ada67e5d7f0a7d7c85
Contract verification status:
Response: `OK`
Details: `Pass - Verified`
Contract successfully verified
Start verifying contract `0x8cDa124f07AE6EEDf1132992D0D02C893DAdB778` deployed on sepolia

Submitting verification for [lib/LayerZero-v2/messagelib/contracts/uln/uln301/mocks/NonceContractMock.sol:NonceContractMock] 0x8cDa124f07AE6EEDf1132992D0D02C893DAdB778.
Submitted contract for verification:
    Response: `OK`
    GUID: `8cda124f07ae6eedf1132992d0d02c893dadb7786644c969`
    URL: https://sepolia.etherscan.io/address/0x8cda124f07ae6eedf1132992d0d02c893dadb778
Contract verification status:
Response: `OK`
Details: `Pass - Verified`
Contract successfully verified
Start verifying contract `0xDfE9248b6bb41f6Bc1efc8221096b7D8fB50e3eA` deployed on sepolia

Submitting verification for [lib/LayerZero-v2/messagelib/contracts/uln/uln301/SendUln301.sol:SendUln301] 0xDfE9248b6bb41f6Bc1efc8221096b7D8fB50e3eA.
Submitted contract for verification:
    Response: `OK`
    GUID: `dfe9248b6bb41f6bc1efc8221096b7d8fb50e3ea6644c96c`
    URL: https://sepolia.etherscan.io/address/0xdfe9248b6bb41f6bc1efc8221096b7d8fb50e3ea
Contract verification status:
Response: `OK`
Details: `Pending in queue`
Contract verification status:
Response: `OK`
Details: `Pass - Verified`
Contract successfully verified
Start verifying contract `0x46eEDB3d85dbB1BcCF378D67BfAfBE9218337253` deployed on sepolia

Submitting verification for [lib/LayerZero-v2/messagelib/contracts/uln/uln301/ReceiveUln301.sol:ReceiveUln301] 0x46eEDB3d85dbB1BcCF378D67BfAfBE9218337253.
Submitted contract for verification:
    Response: `OK`
    GUID: `46eedb3d85dbb1bccf378d67bfafbe92183372536644c97f`
    URL: https://sepolia.etherscan.io/address/0x46eedb3d85dbb1bccf378d67bfafbe9218337253
Contract verification status:
Response: `OK`
Details: `Pending in queue`
Contract verification status:
Response: `OK`
Details: `Pass - Verified`
Contract successfully verified
Start verifying contract `0x0A5CF11494bf5f1953f957cE19741db77B1fB8c4` deployed on sepolia

Submitting verification for [lib/LayerZero-v2/messagelib/contracts/PriceFeed.sol:PriceFeed] 0x0A5CF11494bf5f1953f957cE19741db77B1fB8c4.
Submitted contract for verification:
    Response: `OK`
    GUID: `0a5cf11494bf5f1953f957ce19741db77b1fb8c46644c990`
    URL: https://sepolia.etherscan.io/address/0x0a5cf11494bf5f1953f957ce19741db77b1fb8c4
Contract verification status:
Response: `OK`
Details: `Pass - Verified`
Contract successfully verified
Start verifying contract `0x3faa5679622c01Fa5c2Ae1f63e9Cb6353D5B80AA` deployed on sepolia

Submitting verification for [lib/LayerZero-v2/messagelib/contracts/uln/dvn/DVN.sol:DVN] 0x3faa5679622c01Fa5c2Ae1f63e9Cb6353D5B80AA.
Submitted contract for verification:
    Response: `OK`
    GUID: `3faa5679622c01fa5c2ae1f63e9cb6353d5b80aa6644c993`
    URL: https://sepolia.etherscan.io/address/0x3faa5679622c01fa5c2ae1f63e9cb6353d5b80aa
Contract verification status:
Response: `OK`
Details: `Pending in queue`
Contract verification status:
Response: `OK`
Details: `Pass - Verified`
Contract successfully verified
Start verifying contract `0x1B2dEc5C9dd3Fca285f0e64503242A6e0D0cEb28` deployed on sepolia

Submitting verification for [lib/LayerZero-v2/messagelib/contracts/uln/dvn/DVNFeeLib.sol:DVNFeeLib] 0x1B2dEc5C9dd3Fca285f0e64503242A6e0D0cEb28.
Submitted contract for verification:
    Response: `OK`
    GUID: `1b2dec5c9dd3fca285f0e64503242a6e0d0ceb286644c9a5`
    URL: https://sepolia.etherscan.io/address/0x1b2dec5c9dd3fca285f0e64503242a6e0d0ceb28
Contract verification status:
Response: `OK`
Details: `Pass - Verified`
Contract successfully verified
Start verifying contract `0x690Aaf2045F9D604798B6CF0895a046b7D89C5fd` deployed on sepolia

Submitting verification for [lib/LayerZero-v2/messagelib/contracts/Executor.sol:Executor] 0x690Aaf2045F9D604798B6CF0895a046b7D89C5fd.
Submitted contract for verification:
    Response: `OK`
    GUID: `690aaf2045f9d604798b6cf0895a046b7d89c5fd6644c9a7`
    URL: https://sepolia.etherscan.io/address/0x690aaf2045f9d604798b6cf0895a046b7d89c5fd
Contract verification status:
Response: `OK`
Details: `Pending in queue`
Contract verification status:
Response: `OK`
Details: `Pass - Verified`
Contract successfully verified
Start verifying contract `0xE03d7e81b49e2498dED206403F1591095E1d484d` deployed on sepolia

Submitting verification for [lib/LayerZero-v2/messagelib/contracts/ExecutorFeeLib.sol:ExecutorFeeLib] 0xE03d7e81b49e2498dED206403F1591095E1d484d.
Submitted contract for verification:
    Response: `OK`
    GUID: `e03d7e81b49e2498ded206403f1591095e1d484d6644c9b9`
    URL: https://sepolia.etherscan.io/address/0xe03d7e81b49e2498ded206403f1591095e1d484d
Contract verification status:
Response: `OK`
Details: `Pending in queue`
Contract verification status:
Response: `OK`
Details: `Pass - Verified`
Contract successfully verified
All (17) contracts were verified!

Transactions saved to: /Users/abhi3700/F/coding/github_repos/subspace/subspace-evm-contracts/broadcast/LZSetupSepolia.s.sol/11155111/run-latest.json

Sensitive values saved to: /Users/abhi3700/F/coding/github_repos/subspace/subspace-evm-contracts/cache/LZSetupSepolia.s.sol/11155111/run-latest.json

All txs ran successfully along with verification.
Sharing the broadcast details here:
run-latest.json


B. Manual gas limit set

Run LZSetup script having 32 txs (16: CREATE, 16: CALL) without any gas-price, gas-limit flags in CLI command, but with same 100,000 (sufficient enough) as gas-limit set in the code like .setReceiveLibrary{gas: 100000}(...) corresponding to suspected functions (as error previously found for these functions). 2 errors: OutOfGas, Reverted` found in this case.

Terminal output:
forge script ./script/lz/LZSetupNova.s.sol:LZSetupScript --private-key ${DEPLOYER_PRIVATE_KEY} --rpc-url ${NOVA_RPC_URL} --legacy --broadcast                                                                                                ⏎
[⠒] Compiling...
No files changed, compilation skipped
Script ran successfully.

== Logs ==
  LZ Infra addresses written to  ./lzsetup_addresses_nova.txt

## Setting up 1 EVM.
Gas limit was set in script to 100000
Gas limit was set in script to 100000
Gas limit was set in script to 100000
Gas limit was set in script to 100000
Gas limit was set in script to 100000
Gas limit was set in script to 100000
Gas limit was set in script to 100000
Gas limit was set in script to 100000
Gas limit was set in script to 100000

==========================

Chain 490000

Estimated gas price: 0.5 gwei

Estimated total gas used for script: 45202705

Estimated amount required: 0.0226013525 ETH

==========================
##
Sending transactions [0 - 31].
⠒ [00:00:00] [###############################################################################################################################>----------------------------------------------------------------------------] 20/32 txes (0.0s)##
Waiting for receipts.
⠚ [00:00:56] [########################################################################################################################################################################################################] 32/32 receipts (0.0s)
##### 490000
✅  [Success]Hash: 0xf287202cd345a325c72d1fa2a675764bf3c543cd75ad73c9f25ad462291433de
Contract Address: 0x3ed62137c5DB927cb137c26455969116BF0c23Cb
Block: 99
Paid: 0.0024027835 ETH (4805567 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x7a11e04292470eb267032ec0b9b835065d17d76f5e76c9ccece2022c6c6d13b4
Contract Address: 0x962c0940d72E7Db6c9a5F81f1cA87D8DB2B82A23
Block: 99
Paid: 0.0003030225 ETH (606045 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x935c7671d23bc6b6dbc7abcde2007f541a202bd53146d0cbae81dba1653d86bd
Block: 99
Paid: 0.0000342595 ETH (68519 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0xd950fca060532947451e5fc0ce7a5ca2a915b9a0b3ac574ae28c389b1591df6c
Contract Address: 0xeAB4eEBa1FF8504c124D031F6844AD98d07C318f
Block: 99
Paid: 0.0003469685 ETH (693937 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x63c192a09ad0108e92dc7899f60d145de6b051a980e789ba4dbd72d729115641
Contract Address: 0x21cb3940e6Ba5284E1750F1109131a8E8062b9f1
Block: 99
Paid: 0.000736345 ETH (1472690 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x6024068b66927ec03af882a0fdf587af0ac87c3f8b2bb28125a4a8db1b3c0c52
Contract Address: 0x3469E1DaC06611030AEce8209F07501E9A7aCC69
Block: 100
Paid: 0.0020693915 ETH (4138783 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x58fc10b627f235ed65221d6e1777673a60f58b37b78e9cea67dba1ed5a15fa19
Contract Address: 0x7d4567B7257cf869B01a47E8cf0EDB3814bDb963
Block: 100
Paid: 0.001084465 ETH (2168930 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0xddbf71a992ae29d4122eacc18158f765ca7e9e99067c6f4b3ed3ea9b785ac823
Contract Address: 0x527FC4060Ac7Bf9Cd19608EDEeE8f09063A16cd4
Block: 101
Paid: 0.001269175 ETH (2538350 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0xefa73519d1df76d84638ea2c78f7f52c3a65e4da22b8c80c109a63f6eeb4debc
Contract Address: 0x3649E46eCD6A0bd187f0046C4C35a7B31C92bA1E
Block: 101
Paid: 0.000203909 ETH (407818 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x04cb309baa937e15e40c4848fbed206a51c06eeb66edd71c3af2b946f3212fb3
Contract Address: 0xb6F2B9415fc599130084b7F20B84738aCBB15930
Block: 101
Paid: 0.00014932 ETH (298640 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x2f641a715d730c0500baed08faebe00326d30076459212c9289f7bff399962a8
Contract Address: 0x598efcBD0B5b4Fd0142bEAae1a38f6Bd4d8a218d
Block: 101
Paid: 0.0020513345 ETH (4102669 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x7bb2e6403e220f6dc62c79134f7b626d1224ad36294f787f36600910e8f8c784
Contract Address: 0x746DFE0F96789e62CECeeA3CA2a9b5556b3AaD6c
Block: 102
Paid: 0.0012669655 ETH (2533931 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0xcd0af310832db3db8f3c6071b10c75724fefdd0fbc163aa51b6fed54a39e8133
Contract Address: 0x294c664f6D63bd1521231a2EeFC26d805ce00a08
Block: 102
Paid: 0.0006541705 ETH (1308341 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x5d4a746a68a4752c42274fd98eebb96528435e0aba26dec7631dc32a879ad0fb
Block: 102
Paid: 0.000079273 ETH (158546 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x4c5b16e00391d9066704092b2d1ecd3482bd27d0e1727ca6253a9364c3131b04
Contract Address: 0xEC69d4f48f4f1740976968FAb9828d645Ad1d77f
Block: 102
Paid: 0.001655623 ETH (3311246 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0xa3874ab7410694db8025cbe1baa87352df182dbc75a30fe49622be95851d56f4
Block: 102
Paid: 0.000030446 ETH (60892 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x64a1b5e13e2a47d3ab1906d2da03704c25044d375faa30c74de71a63d2c1a756
Contract Address: 0x91edC788F9989225BA7891e112AcD51C1e5B6056
Block: 104
Paid: 0.000440396 ETH (880792 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x61bd847d7ca96e940c7337a5fd7cc115d8604df8ff109777f75f94b66491f214
Block: 104
Paid: 0.000030124 ETH (60248 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x6ff157704bd335cc5b6c81a88165a6874da6baf08881c8b6e536850b7315f65e
Block: 104
Paid: 0.000030124 ETH (60248 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x72f1964773e38f4ec5d3d6b87a601b39a8f54158fcc3bcf64ac19caf1fb34c40
Contract Address: 0xab7785d56697E65c2683c8121Aac93D3A028Ba95
Block: 104
Paid: 0.001384583 ETH (2769166 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x7145874a80650284b73bf344ab449153203bf7135a84754924f370f52daa2cd6
Contract Address: 0xb5F73112516ebeB89c7EF67a507513b441Ac28fA
Block: 104
Paid: 0.0005431225 ETH (1086245 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x29130345889df1846833bca081d8242e2ee0ea73614a6fb17c1a4fd2cf570f02
Block: 104
Paid: 0.0001572365 ETH (314473 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x5295f45344f4cc4a8ea444465b216a2a2d1d725fb2290fdbde63c869a58e8f22
Block: 104
Paid: 0.000026868 ETH (53736 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x7f94d5265039377243a4164db88ef7f23e8f995826aca1684be6da848a974e57
Block: 104
Paid: 0.000036898 ETH (73796 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0xe074c6074d558e408d80fb0bc2f7d39fcc1fefe5fd3c483c0e524b508b0cebd8
Block: 104
Paid: 0.000039292 ETH (78584 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x872be0f87cd509b699e4cda0d3041d8108b58b19e15165aac7deb2af5e6a8924
Block: 104
Paid: 0.0000536235 ETH (107247 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x4fdf45f95d79dc72f79ca8b5e47d494080caf84a0619baa778a1573dfa5d4b23
Block: 104
Paid: 0.00005357 ETH (107140 gas * 0.5 gwei)


Transactions saved to: /Users/abhi3700/F/coding/github_repos/subspace/subspace-evm-contracts/broadcast/LZSetup.s.sol/490000/run-latest.json

Sensitive values saved to: /Users/abhi3700/F/coding/github_repos/subspace/subspace-evm-contracts/cache/LZSetup.s.sol/490000/run-latest.json

Error: 
Transaction Failure: 0x4b37d621a6216bd2b493c32a02f80c1e6cc9511a79937ae9e50bb0dcf178b252
Transaction Failure: 0x15b14354cbf18bfa9049a83dd2a23f50c6472208bd4834657a729487310bc0ae
Transaction Failure: 0x9066351a92d27a494bbe8764636da2d133fb89c74f7bfdd956660571a8aeabe0
Transaction Failure: 0x11458507ba5d4de307ba8854ba0da8ab17af2445486075261f500a15b7e9d8ee
Transaction Failure: 0xedbc41f109b5cbdaa647c97d597cf8bbbd671b70972b5ed4b2a783087eae3258

5/32 txs failed. All the failed txs are of CALL type.

Sharing the entire broadcast details here:
run-latest.json

Just like above, searched for the failed txs to find out the failure reason from Nova PolkadotJS Explorer. Found that the 1st 3 txs failed with OutOfGas error, whereas the last 2 just Reverted.

@vedhavyas
Copy link
Contributor

vedhavyas commented May 17, 2024

@abhi3700 I have a hunch on this. Can you set the gas_limit from 100,000 to 1,25,000 instead and give it a try ?

As for the Reverted error, is it possible for the client to pinpoint which point it failed ?

@abhi3700
Copy link
Contributor Author

@abhi3700 I have a hunch on this. Can you set the gas_limit from 100,000 to 1,25,000 instead and give it a try ?

Here is the result:

Terminal output:
❯ forge script ./script/lz/LZSetupNova.s.sol:LZSetupScript --private-key ${DEPLOYER_PRIVATE_KEY} --rpc-url ${NOVA_RPC_URL} --legacy --broadcast ⏎
[⠒] Compiling...
No files changed, compilation skipped
Script ran successfully.

== Logs ==
  LZ Infra addresses written to  ./lzsetup_addresses_nova.txt

## Setting up 1 EVM.
Gas limit was set in script to 125000
Gas limit was set in script to 125000
Gas limit was set in script to 125000
Gas limit was set in script to 125000
Gas limit was set in script to 125000
Gas limit was set in script to 125000
Gas limit was set in script to 125000
Gas limit was set in script to 125000
Gas limit was set in script to 125000

==========================

Chain 490000

Estimated gas price: 0.5 gwei

Estimated total gas used for script: 45427721

Estimated amount required: 0.0227138605 ETH

==========================
##
Sending transactions [0 - 31].
⠒ [00:00:00] [######################################################################>------------------------------------------] 20/32 txes (0.0s)##
Waiting for receipts.
⠙ [00:01:03] [#########################################################################################################>---] 31/32 receipts (6.7s)
##### 490000
✅  [Success]Hash: 0xd3e355135aa33a33ea0c24cdefb248855dacbf94232ccdaf10d74545ae4c5da5
Contract Address: 0xb91C2eeaA0c475115069a6ED4bc601337a22788E
Block: 5571
Paid: 0.0024027835 ETH (4805567 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x4422dba3b0fe6966fba607a6fb13307891435516f85b558f830706ec5bf538b0
Contract Address: 0xad856F238CBeafd064b80D12EadAea3981fB21B5
Block: 5571
Paid: 0.0003030225 ETH (606045 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0xd3270a1f85a5b6320714ed26958160d86212683052835ab12575c232bba7232d
Block: 5571
Paid: 0.0000342595 ETH (68519 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0xff37f3d8c2f26e66d9014d3da45b66516e152df5c2a8d3bf306425c0b96442de
Contract Address: 0x6eA3524AD29729b10F324fD2aF967beed9cc4E68
Block: 5571
Paid: 0.0003469685 ETH (693937 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0xa03d5eb5f68f70e19a04c02e6d80efd914e0c2f11ab7523ce066697a35eb4b7b
Contract Address: 0x115f277e8fcE437B1F513A293057D2E396Ac2EC1
Block: 5571
Paid: 0.000736345 ETH (1472690 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x1012b4abd567eab94d740ff49c3ef3d54b29f29f4f9bec1757f62bb92613cca2
Contract Address: 0x71d5a92A9056aB2Ee81811aF045439e059Dd6FBc
Block: 5572
Paid: 0.0020693915 ETH (4138783 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x45ffcc0d127fcda253289d0b9265496560f9935686ba0b5d0870e22ce42bddb3
Contract Address: 0xaDB5683bF6699D6F86f296957af5971648e855A6
Block: 5572
Paid: 0.001084465 ETH (2168930 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x23272a449a58b575b5cb6d383bfe158bdffd641b2a61442ea60f0d987236af51
Block: 5572
Paid: 0.000056742 ETH (113484 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x8506b0e4ea9cd3df18a2828099c70b40fcc7d28d38e9ae9a7d598871512a6322
Contract Address: 0xC530e4cD4933357da902577E78cC7C65C5759e0C
Block: 5573
Paid: 0.001269175 ETH (2538350 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x054b587e679082e62d4b00f8c149d41246e1ecb28665a6f9990f8489a548215e
Contract Address: 0xcd13A508cF33C8aB8920b74B7280829c86F42e5f
Block: 5573
Paid: 0.000203909 ETH (407818 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0xb7afbf5ee0df78d9eaefd88dfbc145aad4e63a2dbb7142a0c99dd75ee6fa1985
Contract Address: 0xf2D374B77db32284D79FCbf72b0d97d16D031cdf
Block: 5573
Paid: 0.00014932 ETH (298640 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0xe1d07bfcd5cee9f12275e0ded51927b5170f1993642d7aa63ec2c83a8808b15e
Contract Address: 0x7b21801C4B7219BDeb3494AC98e948abBD25b2e9
Block: 5573
Paid: 0.0020513405 ETH (4102681 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0xe52094f80e76d2b65e5507f90af1899877eb1a349e2683cd37b8290b2b0f1e52
Contract Address: 0xE07fd4CC631b88aD64d3782A7eCDC1D4c8382b70
Block: 5575
Paid: 0.0012669655 ETH (2533931 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x7f99e2cf1c8302ec3dd990d40b0a9aa8d8c6b981270838f817b19e41eb999bca
Contract Address: 0xc2A5734B4021f2dD0c27f949Ef84Eb5De96360E5
Block: 5575
Paid: 0.0006541705 ETH (1308341 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x5275ccaffa75f5ab9957621c74dcce81d20903108bb7ff23f913e3ea8737da2b
Block: 5575
Paid: 0.000079273 ETH (158546 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x4522d26eb41fa09ae0121abde7e20a44e3c4abc38989bb20458111bcd2b9c916
Contract Address: 0xEb7b83063a68d8a25a2c9aE5d9f3535a2e78A8E9
Block: 5575
Paid: 0.001655623 ETH (3311246 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x2c9ea770f8151412a0a20799158c5f35ea60290134ceeae14a3b914ecf2f78fb
Block: 5575
Paid: 0.000030446 ETH (60892 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x142c103191780c933cc0bd98079df6798d93ba97f43a038f0408255c2f2c59d2
Contract Address: 0x6CAa59f27B0b3b5Adc07a2b3EcB7142B3C74f424
Block: 5576
Paid: 0.000440396 ETH (880792 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0xcbad67cebbf6dadd8229ec8208a8c39dac686ed5810c4217c4ffa7b9090433e8
Block: 5576
Paid: 0.000030124 ETH (60248 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x4edf7555e27e29e550a7946f618e85c9305cf0d6f241d89884ba0272b0905912
Block: 5576
Paid: 0.000030124 ETH (60248 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x22edf67247ad4f84c3810c211de835a6b9cac9005215306257b2517183b118f2
Contract Address: 0x7dEC25311108Fa879c419b15D74272D81f359170
Block: 5576
Paid: 0.001384583 ETH (2769166 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0xc836953877ed1dc118b3f0201864ff83afca53367ed90a4fe7b692be9660268a
Contract Address: 0xc294b1A62E82d3f135A8F9b2f9cAEAA23fbD6Cf5
Block: 5576
Paid: 0.0005431225 ETH (1086245 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x433b28838264fa13f9e29eb80750ac5d568eb90926c483fafa6fe2eea1019715
Block: 5576
Paid: 0.0001572365 ETH (314473 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0xc47d2f0dd5497674816fb824bf59c12e5774b276d1661be596a35985acd5892f
Block: 5576
Paid: 0.000026868 ETH (53736 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x6b7586eaec59d5b09944e4581e8fd9c9878188b2a5327bb0466a586b87c9fff1
Block: 5576
Paid: 0.000036898 ETH (73796 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x7c738b97d3aaaac5b4785c056982433c1e2029eaee17613083b4391506b3ebec
Block: 5576
Paid: 0.000039292 ETH (78584 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0x148c2709deaad3c2a7ed7ea339225e083dfdd94f975279683fae075fe1ce9902
Block: 5576
Paid: 0.0000536235 ETH (107247 gas * 0.5 gwei)


##### 490000
✅  [Success]Hash: 0xf00d1d5eeb0ffb07611a38515c4b23301f4491b17316470f7e4a36daf81102f9
Block: 5576
Paid: 0.00005357 ETH (107140 gas * 0.5 gwei)


Transactions saved to: /Users/abhi3700/F/coding/github_repos/subspace/subspace-evm-contracts/broadcast/LZSetupNova.s.sol/490000/run-latest.json

Sensitive values saved to: /Users/abhi3700/F/coding/github_repos/subspace/subspace-evm-contracts/cache/LZSetupNova.s.sol/490000/run-latest.json

Error: 
Transaction Failure: 0xb476d2e8105afb35e6bf013492370157d634258e7db2f23ae40ece90b0be8cf0
Transaction Failure: 0x3a8e338afecc04ce10bae07b4797fba5499c2511207bce31596d266a67db93e2
Transaction Failure: 0xc42b04d565ad5683c59a5b8ba6c1567485b6a8d913c065157f000cdb24ab517f
Transaction Failure: 0x738f2bcc091193ea239ae3e227388d2df3b5f3f539d481e9128267a101171532

1st 2 txs faced OutOfGas error:
image

And the 2nd 2 txs faced Reverted error:
image

As for the Reverted error, is it possible for the client to pinpoint which point it failed ?
It doesn't show any trace to where is the problem, simply shows like this for a tx:

Transaction Failure: 0xc42b04d565ad5683c59a5b8ba6c1567485b6a8d913c065157f000cdb24ab517f

@vedhavyas
Copy link
Contributor

@abhi3700 have you tried deploying to Moonbeam testnet ?
We use the same EVM so worth trying there to further poinpoint the problem

@abhi3700
Copy link
Contributor Author

Yesterday, I had the same thought & asked @dastansam to try on Moonbeam as he was already debugging around this.

Here is the result he got:

Error: 
Transaction Failure: 0x2b7ab99dd75fb2d3f2f9e75a14d12f9ab1f08f29726b47622948f308e4d483ae
Transaction Failure: 0x89b23ecb1a643551e4a1337b9da4c4563332e65018c6531d8c710f2d306797e7
Transaction Failure: 0x6c0ea9ccce90e5ae102afbf9a8a917ac801c1d58ad22348071624769f0170320
Transaction Failure: 0x5be443f1ac5398e4dbf4d886ef46a207ebe68db3553b22e67bd662f5ab6c2a80
Transaction Failure: 0x202060bd75e067fdd24f667c63e4e71146b9cd75f6ab2885115af4b9e0fbb9ea
Transaction Failure: 0xee3c67740b874e39ebe785c1d45b15fcb9421499fefa213c6ea89cdbd0831fcf
Transaction Failure: 0x7c58c216843f3be6c0266cb4b7a2b72fd261cab25e1f5ff5ef4886ba583cdcc3
Transaction Failure: 0x5cdec4f0718598bcf2cbd0b3e51dfa23c7e7dc9037ba756ed653a7cd5b5cbfc4
Transaction Failure: 0x1b17c9fd6748e80973210c28574a07647566d00913ed94eb0c650e8614209785
Transaction Failure: 0xc48194a919843e8f70294e4b58f9036f1726db21ac8e67f28c13427e68227d7a
Transaction Failure: 0x771ffb0f9d3341ac2e2ccc1f7059de3aec4a13111c5bca2cfe35287548680281
Transaction Failure: 0x67996e3413112502811aa22aab8e57e21ae4966179f29ae076ad3af890df1f63
Transaction Failure: 0xb003248583e12e4406274595fbefd39524c999670a4ff35c4b2ca9c45aaf5126
Transaction Failure: 0x63398c441e98a42dad4aab6a53f2b1ab7163b1603ffe48c969132cfddd6a50e3
Transaction Failure: 0x7277216efd278291ee64aa68baa65f84de83c708ebd1c34cbb9c142857122a5c
Transaction Failure: 0x29207d03c04778197c7889c49a4a7e89285f9c81451bcb41500efa438554e098

Let me try myself & share the result here in few mins.

@abhi3700
Copy link
Contributor Author

It succeeded on Moonbeam Alpha testnet 🎉 .

I observed that the txs were being added into different blocks. It seemed like they don't wait for txs that takes more time. Simply just produce blocks with whatever txs available. Interesting! 🤔

Terminal output:
❯ forge script script/lz/LZSetupMoonbeam.s.sol:LZSetupScript --rpc-url $MOONBEAM_TESTNET_RPC_URL --private-key $DEPLOYER_PRIVATE_KEY --broadcast        
[⠊] Compiling...
No files changed, compilation skipped
EIP-3855 is not supported in one or more of the RPCs used.
Unsupported Chain IDs: 1287.
Contracts deployed with a Solidity version equal or higher than 0.8.20 might not work properly.
For more information, please see https://eips.ethereum.org/EIPS/eip-3855
Script ran successfully.

== Logs ==
  LZ Infra addresses written to  ./lzsetup_addresses_moonbeam.txt

## Setting up 1 EVM.

==========================

Chain 1287

Estimated gas price: 0.25 gwei

Estimated total gas used for script: 66904452

Estimated amount required: 0.016726113 ETH

==========================
##
Sending transactions [0 - 0].
⠁ [00:00:03] [####>--------------------------------------------------------------------------------------------------------------------------------] 1/32 txes (101.9s)##
Waiting for receipts.
⠉ [00:00:25] [####################################################################################################################################] 1/1 receipts (0.0s)
##### moonbase
✅  [Success]Hash: 0x5fd4e08ba7d4bbe0fb01344d01071ef5f15c997f93c23efd3dd73eb09191ca3b
Contract Address: 0x6fa280F2b9C5c4fCDfFDDcED15BbA558208Be1b6
Block: 7237307
Paid: 0.001311840075 ETH (8072862 gas * 0.1625 gwei)

##
Sending transactions [1 - 1].
⠉ [00:00:30] [########>----------------------------------------------------------------------------------------------------------------------------] 2/32 txes (747.5s)##
Waiting for receipts.
⠉ [00:00:21] [####################################################################################################################################] 1/1 receipts (0.0s)
##### moonbase
✅  [Success]Hash: 0x3344409b21574146d747fbdf338c62c054b60341ab7b51f18c439579dba1f879
Contract Address: 0x715867f2bD91673b01443c17E07750E42C18948d
Block: 7237311
Paid: 0.000158976675 ETH (978318 gas * 0.1625 gwei)

##
Sending transactions [2 - 2].
⠙ [00:00:54] [############>------------------------------------------------------------------------------------------------------------------------] 3/32 txes (691.5s)##
Waiting for receipts.
⠉ [00:00:15] [####################################################################################################################################] 1/1 receipts (0.0s)
##### moonbase
✅  [Success]Hash: 0x0606293707021e1476d5881b36d75df324b69a84f9d1d9651d73a9db98d59d60
Block: 7237314
Paid: 0.0000137982 ETH (84912 gas * 0.1625 gwei)

##
Sending transactions [3 - 3].
⠚ [00:01:11] [################>--------------------------------------------------------------------------------------------------------------------] 4/32 txes (495.9s)##
Waiting for receipts.
⠉ [00:00:22] [####################################################################################################################################] 1/1 receipts (0.0s)
##### moonbase
✅  [Success]Hash: 0xd5641c3ec0c41b5e6ec1bbf8b21b90fca74aa0152d791429dec175d8f3dfcc7c
Contract Address: 0xd06D8026fb9de67416d02699aB882cd2FB684552
Block: 7237317
Paid: 0.00018306405 ETH (1126548 gas * 0.1625 gwei)

##
Sending transactions [4 - 4].
⠒ [00:01:35] [####################>----------------------------------------------------------------------------------------------------------------] 5/32 txes (650.7s)##
Waiting for receipts.
⠉ [00:00:22] [####################################################################################################################################] 1/1 receipts (0.0s)
##### moonbase
✅  [Success]Hash: 0x39b555937cea5f24c83065797f4db29837029a58cb9b5614b4207a8ead308ebf
Contract Address: 0xEa10E800B23313bA572C930AD1B2914538bacAd3
Block: 7237318
Paid: 0.0003970551 ETH (2443416 gas * 0.1625 gwei)

##
Sending transactions [5 - 5].
⠂ [00:02:00] [########################>------------------------------------------------------------------------------------------------------------] 6/32 txes (646.5s)##
Waiting for receipts.
⠉ [00:00:15] [####################################################################################################################################] 1/1 receipts (0.0s)
##### moonbase
✅  [Success]Hash: 0xb09334562c72698ac8f678bd5a7f1d9305da30ed6c4fe2fef106b473f6861728
Contract Address: 0xB357C5421e834c57Ba6EFd4E6A52f780106c42dB
Block: 7237321
Paid: 0.00113014395 ETH (6954732 gas * 0.1625 gwei)

##
Sending transactions [6 - 6].
⠂ [00:02:18] [#############################>-------------------------------------------------------------------------------------------------------] 7/32 txes (459.7s)##
Waiting for receipts.
⠉ [00:00:22] [####################################################################################################################################] 1/1 receipts (0.0s)
##### moonbase
✅  [Success]Hash: 0xe47438e28071f93a13ae44517bf76a7330d7c259242f4cf2b8133b7385d22ec6
Contract Address: 0xb072BeF71163DE808845500EC290B3FDF4A09c6B
Block: 7237324
Paid: 0.000544791 ETH (3352560 gas * 0.1625 gwei)

##
Sending transactions [7 - 7].
⠒ [00:02:42] [#################################>---------------------------------------------------------------------------------------------------] 8/32 txes (581.4s)##
Waiting for receipts.
⠉ [00:00:15] [####################################################################################################################################] 1/1 receipts (0.0s)
##### moonbase
✅  [Success]Hash: 0x935041a4ed9343d232e50e93238baf82f068e156b72b7262780b2ea110ec6a7f
Block: 7237327
Paid: 0.0000738478 ETH (454448 gas * 0.1625 gwei)

##
Sending transactions [8 - 8].
⠲ [00:03:00] [#####################################>-----------------------------------------------------------------------------------------------] 9/32 txes (417.1s)##
Waiting for receipts.
⠉ [00:00:22] [####################################################################################################################################] 1/1 receipts (0.0s)
##### moonbase
✅  [Success]Hash: 0x1d0a46e263b55ee6ec7009f2ad74776bbc452e48315013b2008c01e22b756ddb
Block: 7237331
Paid: 0.000106197 ETH (653520 gas * 0.1625 gwei)

##
Sending transactions [9 - 9].
⠴ [00:03:24] [#########################################>------------------------------------------------------------------------------------------] 10/32 txes (526.3s)##
Waiting for receipts.
⠉ [00:00:15] [####################################################################################################################################] 1/1 receipts (0.0s)
##### moonbase
✅  [Success]Hash: 0x0d31d6ee4b69e1c265504379d10b752d65b1da9836cf4349dccd88f56c645143
Block: 7237334
Paid: 0.0000809094 ETH (497904 gas * 0.1625 gwei)

##
Sending transactions [10 - 10].
⠤ [00:03:42] [#############################################>--------------------------------------------------------------------------------------] 11/32 txes (383.6s)##
Waiting for receipts.
⠉ [00:00:15] [####################################################################################################################################] 1/1 receipts (0.0s)
##### moonbase
✅  [Success]Hash: 0xea9cbb0078b0e5a167ef209de8e12245195724f326aae01312bf9bd575d2cf72
Contract Address: 0x2197983815Fbeb83D84e68C2D30E7457F673D96C
Block: 7237335
Paid: 0.000691396875 ETH (4254750 gas * 0.1625 gwei)

##
Sending transactions [11 - 11].
⠄ [00:03:59] [#################################################>----------------------------------------------------------------------------------] 12/32 txes (351.3s)##
Waiting for receipts.
⠉ [00:00:22] [####################################################################################################################################] 1/1 receipts (0.0s)
##### moonbase
✅  [Success]Hash: 0x33241320965b170f000b66dc46aa74f63117d46a0c670cb7127faf20f0b608b0
Contract Address: 0x4E0C31c3e9e494FEb99b5d98406E00d2796FC4BB
Block: 7237338
Paid: 0.000103902825 ETH (639402 gas * 0.1625 gwei)

##
Sending transactions [12 - 12].
⠄ [00:04:24] [#####################################################>------------------------------------------------------------------------------] 13/32 txes (456.4s)##
Waiting for receipts.
⠉ [00:00:15] [####################################################################################################################################] 1/1 receipts (0.0s)
##### moonbase
✅  [Success]Hash: 0x58ec41314ca146c5b0c2fdf363a3851e1ffe1c26e1b7c4eeb82b27cae14aca60
Contract Address: 0x49C9C06818a783bDc269DDb213FAf28FB2BC42e6
Block: 7237341
Paid: 0.000073808475 ETH (454206 gas * 0.1625 gwei)

##
Sending transactions [13 - 13].
⠤ [00:04:42] [#########################################################>--------------------------------------------------------------------------] 14/32 txes (340.4s)##
Waiting for receipts.
⠉ [00:00:15] [####################################################################################################################################] 1/1 receipts (0.0s)
##### moonbase
✅  [Success]Hash: 0x81b1c80ca2e13caf095b9545f56235b9fea05c8715dc72d0e665d935a5019944
Contract Address: 0xc6Eca502Ceb598A32A2E95e18523EBFAEC45275F
Block: 7237344
Paid: 0.001121163225 ETH (6899466 gas * 0.1625 gwei)

##
Sending transactions [14 - 14].
⠠ [00:05:00] [#############################################################>----------------------------------------------------------------------] 15/32 txes (303.4s)##
Waiting for receipts.
⠉ [00:00:22] [####################################################################################################################################] 1/1 receipts (0.0s)
##### moonbase
✅  [Success]Hash: 0x800bedd4d18b119fc00cf6585c11762cf6f5d623127b12a1c4ace567dc4f122e
Contract Address: 0x23db08fcD36E727faDd768133448ADC0090bB121
Block: 7237346
Paid: 0.000647088 ETH (3982080 gas * 0.1625 gwei)

##
Sending transactions [15 - 15].
⠠ [00:05:24] [##################################################################>-----------------------------------------------------------------] 16/32 txes (384.5s)##
Waiting for receipts.
⠉ [00:00:15] [####################################################################################################################################] 1/1 receipts (0.0s)
##### moonbase
✅  [Success]Hash: 0xa1124aa5b1007a1016c82a85ae0f3727195e835d6b74249767b6736b278352c0
Contract Address: 0x15f4bF5029Af55514bDD7C38A072CbCC58E245d9
Block: 7237349
Paid: 0.00035221095 ETH (2167452 gas * 0.1625 gwei)

##
Sending transactions [16 - 16].
⠤ [00:05:42] [######################################################################>-------------------------------------------------------------] 17/32 txes (272.8s)##
Waiting for receipts.
⠉ [00:00:15] [####################################################################################################################################] 1/1 receipts (0.0s)
##### moonbase
✅  [Success]Hash: 0x56bb1dc74f961a4acdb1f8bb3952798e5840dca2561b62a7c6307a72ed436b31
Block: 7237352
Paid: 0.0000413946 ETH (254736 gas * 0.1625 gwei)

##
Sending transactions [17 - 17].
⠦ [00:06:00] [##########################################################################>---------------------------------------------------------] 18/32 txes (254.2s)##
Waiting for receipts.
⠉ [00:00:15] [####################################################################################################################################] 1/1 receipts (0.0s)
##### moonbase
✅  [Success]Hash: 0xa63e5f4b364d600b94737b11291af4b07e553b88ae3ea8b5745f58b6eedc3713
Contract Address: 0xfb196763838604824409e606968b35432A22FA63
Block: 7237355
Paid: 0.000899678325 ETH (5536482 gas * 0.1625 gwei)

##
Sending transactions [18 - 18].
⠖ [00:06:17] [##############################################################################>-----------------------------------------------------] 19/32 txes (227.5s)##
Waiting for receipts.
⠉ [00:00:22] [####################################################################################################################################] 1/1 receipts (0.0s)
##### moonbase
✅  [Success]Hash: 0xb4049f1a3146c9fb926236da456d7f5a4708531bc97a0539d68ac393e4bbd766
Block: 7237358
Paid: 0.000039663 ETH (244080 gas * 0.1625 gwei)

##
Sending transactions [19 - 19].
⠒ [00:06:42] [##################################################################################>-------------------------------------------------] 20/32 txes (284.7s)##
Waiting for receipts.
⠉ [00:00:15] [####################################################################################################################################] 1/1 receipts (0.0s)
##### moonbase
✅  [Success]Hash: 0xc5fd3d4c69c9cc46f7907a871369881a1253db6716bfda2d86d3a1aef4e1fdbf
Contract Address: 0xB41E81ac988cB517a98721fc17e84f934CA3aE97
Block: 7237361
Paid: 0.000234272025 ETH (1441674 gas * 0.1625 gwei)

##
Sending transactions [20 - 20].
⠐ [00:07:00] [######################################################################################>---------------------------------------------] 21/32 txes (204.8s)##
Waiting for receipts.
⠉ [00:00:22] [####################################################################################################################################] 1/1 receipts (0.0s)
##### moonbase
✅  [Success]Hash: 0x6025c442f3919f7b1b0d21203d3a7caf061f22037eb5199a2249467fa05e3e77
Block: 7237364
Paid: 0.0000392444 ETH (241504 gas * 0.1625 gwei)

##
Sending transactions [21 - 21].
⠐ [00:07:24] [##########################################################################################>-----------------------------------------] 22/32 txes (241.6s)##
Waiting for receipts.
⠉ [00:00:15] [####################################################################################################################################] 1/1 receipts (0.0s)
##### moonbase
✅  [Success]Hash: 0xb1492af7ab9d88b1ef69ba3f701ab46f62fb53148dd02e57527593109ba23ebb
Block: 7237367
Paid: 0.0000392444 ETH (241504 gas * 0.1625 gwei)

##
Sending transactions [22 - 22].
⠒ [00:07:42] [##############################################################################################>-------------------------------------] 23/32 txes (168.2s)##
Waiting for receipts.
⠉ [00:00:22] [####################################################################################################################################] 1/1 receipts (0.0s)
##### moonbase
✅  [Success]Hash: 0x8a8ecbc3535f8790437e6a1ce15e6269a2cf95c6b9381b77f00c2e26c8f20ed8
Contract Address: 0x89DeC12E8331DB21B6af0595c3525244c578c39f
Block: 7237371
Paid: 0.000754559325 ETH (4643442 gas * 0.1625 gwei)

##
Sending transactions [23 - 23].
⠓ [00:08:07] [###################################################################################################>--------------------------------] 24/32 txes (195.6s)##
Waiting for receipts.
⠉ [00:00:15] [####################################################################################################################################] 1/1 receipts (0.0s)
##### moonbase
✅  [Success]Hash: 0xc71c62a8ba44238ca61880edd576a214ee5ad070fd2fcc45fa1734935d481e31
Contract Address: 0x3F18aE7c1B8C04093588CFD6eF2b476ADf9cA605
Block: 7237374
Paid: 0.00029083275 ETH (1789740 gas * 0.1625 gwei)

##
Sending transactions [24 - 24].
⠋ [00:08:25] [#######################################################################################################>----------------------------] 25/32 txes (126.6s)##
Waiting for receipts.
⠉ [00:00:15] [####################################################################################################################################] 1/1 receipts (0.0s)
##### moonbase
✅  [Success]Hash: 0x929dd8c1c8c8943a30b97e6dba3d3266620a64b28a01bc274fa6d1cf18bb34fd
Block: 7237377
Paid: 0.0000940966 ETH (579056 gas * 0.1625 gwei)

##
Sending transactions [25 - 25].
⠉ [00:08:42] [###########################################################################################################>------------------------] 26/32 txes (104.3s)##
Waiting for receipts.
⠉ [00:00:15] [####################################################################################################################################] 1/1 receipts (0.0s)
##### moonbase
✅  [Success]Hash: 0xb8e52dae48994a4316459072a8d38021dd8323a54cf58104331ba2d23c97b0fd
Block: 7237380
Paid: 0.0000350116 ETH (215456 gas * 0.1625 gwei)

##
Sending transactions [26 - 26].
⠈ [00:08:59] [################################################################################################################>--------------------] 27/32 txes (87.1s)##
Waiting for receipts.
⠉ [00:00:15] [####################################################################################################################################] 1/1 receipts (0.0s)
##### moonbase
✅  [Success]Hash: 0xe49e15ae4cb65ce178426f863f67dc4b5d8810dd671f80f8a357ae214356420c
Block: 7237383
Paid: 0.000035815 ETH (220400 gas * 0.1625 gwei)

##
Sending transactions [27 - 27].
⠈ [00:09:17] [####################################################################################################################>----------------] 28/32 txes (69.9s)##
Waiting for receipts.
⠉ [00:00:15] [####################################################################################################################################] 1/1 receipts (0.0s)
##### moonbase
✅  [Success]Hash: 0xb7c3e366ca1baceaebe1933a88bdd4010a665aedfeb9fe6d2591feb46367b719
Block: 7237386
Paid: 0.0000511628 ETH (314848 gas * 0.1625 gwei)

##
Sending transactions [28 - 28].
⠁ [00:09:34] [########################################################################################################################>------------] 29/32 txes (52.2s)##
Waiting for receipts.
⠉ [00:00:23] [####################################################################################################################################] 1/1 receipts (0.0s)
##### moonbase
✅  [Success]Hash: 0xda1bf0259f69e98332b059a810c85bf352e6bd1740fd77c853f844612a3dab88
Block: 7237390
Paid: 0.0000528164 ETH (325024 gas * 0.1625 gwei)

##
Sending transactions [29 - 29].
⠁ [00:10:00] [############################################################################################################################>--------] 30/32 txes (49.9s)##
Waiting for receipts.
⠉ [00:00:15] [####################################################################################################################################] 1/1 receipts (0.0s)
##### moonbase
✅  [Success]Hash: 0x016786fd6cac1e4fc1853867bce48499da52699990fd2f38b47c0c8e4987f795
Block: 7237393
Paid: 0.0000275288 ETH (169408 gas * 0.1625 gwei)

##
Sending transactions [30 - 30].
⠉ [00:10:17] [################################################################################################################################>----] 31/32 txes (18.4s)##
Waiting for receipts.
⠉ [00:00:15] [####################################################################################################################################] 1/1 receipts (0.0s)
##### moonbase
✅  [Success]Hash: 0x85aa7a03f6955fefe2dd5c29accddc53dcbc71a4efe5b8d23349cc8e28460c82
Block: 7237396
Paid: 0.0001065246 ETH (655536 gas * 0.1625 gwei)

##
Sending transactions [31 - 31].
⠙ [00:10:35] [######################################################################################################################################] 32/32 txes (0.0s)##
Waiting for receipts.
⠉ [00:00:15] [####################################################################################################################################] 1/1 receipts (0.0s)
##### moonbase
✅  [Success]Hash: 0x7ac5525827d56c213321d2f96ded1a94123ea121fb5bebbe87f0eb5b4d4f8d9f
Block: 7237399
Paid: 0.0000820066 ETH (504656 gas * 0.1625 gwei)



==========================

ONCHAIN EXECUTION COMPLETE & SUCCESSFUL.
Total Paid: 0.009814044825 ETH (60394122 gas * avg 0.1625 gwei)

Transactions saved to: /Users/abhi3700/F/coding/github_repos/subspace/subspace-evm-contracts/broadcast/LZSetupMoonbeam.s.sol/1287/run-latest.json

Sensitive values saved to: /Users/abhi3700/F/coding/github_repos/subspace/subspace-evm-contracts/cache/LZSetupMoonbeam.s.sol/1287/run-latest.json

Sharing the broadcast details here as well for you @vedhavyas.
run-1716976266.json

cc @dastansam

@dastansam
Copy link
Member

dastansam commented May 29, 2024

@abhi3700 have you tried deploying to Moonbeam testnet ? We use the same EVM so worth trying there to further poinpoint the problem

these are my observations/findings for the last couple of days:

  1. Frontier EVM chains
    UPDATE: moonbeam alpha testnet does not have this issue, it seems
    They all fail with the same number of txs, and it is certainly due to execution of all txs in one block. Almost all of the txs fail with OutOfGas error:
Error: 
Transaction Failure: 0x842ca90bab428e29c21e8f64a0c41c5612eb3c13644f51fd82aca35047aca1bf
....

I say certainly, because when you send any of those failed txs separately in a different block they get mined successfully:

Failed tx details
    {
      "hash": "0x842ca90bab428e29c21e8f64a0c41c5612eb3c13644f51fd82aca35047aca1bf",
      "transactionType": "CALL",
      "contractName": "EndpointV2",
      "contractAddress": "0xc01ee7f10ea4af4673cfff62710e1d7792aba8f3",
      "function": "registerLibrary(address)",
      "arguments": [
        "0x21cb3940e6Ba5284E1750F1109131a8E8062b9f1"
      ],
      "transaction": {
        "from": "0xf24ff3a9cf04c71dbc94d0b566f7a27b94566cac",
        "to": "0xc01ee7f10ea4af4673cfff62710e1d7792aba8f3",
        "gas": "0x33450",
        "value": "0x0",
        "input": "0xe8964e8100000000000000000000000021cb3940e6ba5284e1750f1109131a8e8062b9f1",
        "nonce": "0x9",
        "chainId": "0x2a"
      },
      "additionalContracts": [],
      "isFixedGasLimit": true
    },
Replaying failed tx
> cast send 0xc01ee7f10ea4af4673cfff62710e1d7792aba8f3 "registerLibrary(address)" 0x21cb3940e6Ba5284E1750F1109131a8E8062b9f1 --rpc-url ws://localhost:9944 --from 0xf24ff3a9cf04c71dbc94d0b566f7a27b94566cac --value 0 --chain-id 42 --private-key 0x5fb92d6e98884f76de468fa3f6278f8807c48bebc13595d45af5bdc4da702133

blockHash               0x98fbca8cf27d797865500c0f38a30d75ed4f03787c10e3f2f97d23eb3de84b39
blockNumber             100
contractAddress         
cumulativeGasUsed       435666
effectiveGasPrice       500000000
from                    0xf24FF3a9CF04c71Dbc94D0b566f7A27B94566cac
gasUsed                 435666
logs                    [{"address":"0xc01ee7f10ea4af4673cfff62710e1d7792aba8f3","topics":["0x6b374d56679ca9463f27c85c6311e2bb7fde69bf201d3da39d53f10bd9d78af5"],"data":"0x00000000000000000000000021cb3940e6ba5284e1750f1109131a8e8062b9f1","blockHash":"0x98fbca8cf27d797865500c0f38a30d75ed4f03787c10e3f2f97d23eb3de84b39","blockNumber":"0x64","transactionHash":"0xd3ff6970c9828535f45bb284b7d6fcd036a944668f8baf9b2e0c299250a526c3","transactionIndex":"0x0","logIndex":"0x0","removed":false}]
logsBloom               0x00000000000000000000000000000400000000000200000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000
root                    
status                  1 (success)
transactionHash         0xd3ff6970c9828535f45bb284b7d6fcd036a944668f8baf9b2e0c299250a526c3
transactionIndex        0
type                    2
blobGasPrice            
blobGasUsed             
to                      0xc01Ee7f10EA4aF4673cFff62710E1D7792aBa8f3
  1. Nova

In Nova, I was able to successfully send all txs with setting the GAS_LIMIT to 210_000:

> forge script ./script/lz/LZSetupNova.s.sol:LZSetupScript --private-key 0x5fb92d6e98884f76de468fa3f6278f8807c48bebc13595d45af5bdc4da702133 --rpc-url http://127.0.0.1:61800 --broadcast
[⠒] Compiling...
No files changed, compilation skipped
Script ran successfully.

== Logs ==
  LZ Infra addresses written to  ./lzsetup_addresses_nova.txt

## Setting up 1 EVM.
Gas limit was set in script to 210000
Gas limit was set in script to 210000
Gas limit was set in script to 210000
Gas limit was set in script to 210000
Gas limit was set in script to 210000
Gas limit was set in script to 210000
Gas limit was set in script to 210000
Gas limit was set in script to 210000
Gas limit was set in script to 210000

/ --snip--/

ONCHAIN EXECUTION COMPLETE & SUCCESSFUL.
Total Paid: 0.030804118285755878 ETH (34652604 gas * avg 0.835164371 gwei)

Without changing it, the 3-4 transactions fails. 2 with Reverted and 2 with OutOfGas errors. Difference between the Frontier chains is that, even after replaying the failing tx, it still fails and the only way to get it included is to set the gas limit to 210_000 or higher, it seems:

Failed tx with `OutOfGas`
Error: 
Transaction Failure: 0xade0ffe971779ddcddb9da0a707e397996fc389d3a69ec443ed85a32b2cfa852
Transaction Failure: 0x1c807698cb42cd5c43d7a8b6e165ce551409a40f6858c1f13d27b3e87d2ad3b5
Transaction Failure: 0x0bef6e15648d8246d0c2c10894a25696a844dee599a55c8dd90ef2bbf43e646e
Transaction Failure: 0x6f865f6af1097954f40d52efb857550f667bed5de0ad65a7a895e97c51769951
Transaction Failure: 0x721e76d08e3d9eb2a3732ba1763ff91e597d31154aad648d838c368337866ad3
    {
      "hash": "0xade0ffe971779ddcddb9da0a707e397996fc389d3a69ec443ed85a32b2cfa852",
      "transactionType": "CALL",
      "contractName": "EndpointV2",
      "contractAddress": "0xb91c2eeaa0c475115069a6ed4bc601337a22788e",
      "function": "registerLibrary(address)",
      "arguments": [
        "0xaDB5683bF6699D6F86f296957af5971648e855A6"
      ],
      "transaction": {
        "from": "0xf24ff3a9cf04c71dbc94d0b566f7a27b94566cac",
        "to": "0xb91c2eeaa0c475115069a6ed4bc601337a22788e",
        "gas": "0x186a0",
        "value": "0x0",
        "input": "0xe8964e81000000000000000000000000adb5683bf6699d6f86f296957af5971648e855a6",
        "nonce": "0x29",
        "chainId": "0x77a10"
      },
      "additionalContracts": [],
      "isFixedGasLimit": true
    },
Replaying tx
> cast send 0xb91c2eeaa0c475115069a6ed4bc601337a22788e "registerLibrary(address)" 0xaDB5683bF6699D6F86f296957af5971648e855A6 --rpc-url ws://localhost:61800 --from 0xf24ff3a9cf04c71dbc94d0b566f7a27b94566cac --value 0 --chain-id 490000 --private-key 0x5fb92d6e98884f76de468fa3f6278f8807c48bebc13595d45af5bdc4da702133

blockHash               0xa533e283370c81f175961b6faebe42f9f9841489c1c8f30bc07b7dcc91358b98
blockNumber             98
contractAddress         
cumulativeGasUsed       80987
effectiveGasPrice       500000000
from                    0xf24FF3a9CF04c71Dbc94D0b566f7A27B94566cac
gasUsed                 80987
logs                    []
logsBloom               0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
root                    
status                  0 (failed)
transactionHash         0x15b4b2f392e5afe65cd7efa4b3d70e95992c0dd14e3b0ad98612f3b9de5448f8
transactionIndex        0
type                    2
blobGasPrice            
blobGasUsed             
to                      0xb91C2eeaA0c475115069a6ED4bc601337a22788E

@dastansam
Copy link
Member

dastansam commented May 29, 2024

it feels like this is an expected behaviour and doesn't really mean that our EVM is improperly configured. Foundry by default simulates all the transactions and then broadcasts only the ones that don't fail the simulation. This has its limitations, as described here and here. This is why forge script has introduced --skip-simulation flag, so that each tx's gas is estimated from the RPC before submission.

Add command line parameter --skip-simulation that the user can set to disable on chain simulation.
When skipping simulation the gas costs will be estimated through the rpc-provider individually before each transaction submission.

And now, if I run the same script with --skip-simulation everything works as expected.

> forge script ./script/lz/LZSetupNova.s.sol:LZSetupScript --private-key 0x5fb92d6e98884f76de468fa3f6278f8807c48bebc13595d45af5bdc4da702133 --rpc-url http://127.0.0.1:49388 --broadcast  --skip-simulation

==========================

ONCHAIN EXECUTION COMPLETE & SUCCESSFUL.
Total Paid: 0.019180714 ETH (38361428 gas * avg 0.5 gwei)

Transactions saved to:

cc @vedhavyas please correct me if I am wrong

@dastansam
Copy link
Member

dastansam commented May 29, 2024

it feels like this is an expected behaviour and doesn't really mean that our EVM is improperly configured. Foundry by default simulates all the transactions and then broadcasts only the ones that don't fail the simulation. This has its limitations, as described here and here. This is why forge script has introduced --skip-simulation flag, so that each tx's gas is estimated from the RPC before submission.

Add command line parameter --skip-simulation that the user can set to disable on chain simulation.
When skipping simulation the gas costs will be estimated through the rpc-provider individually before each transaction submission.

And now, if I run the same script with --skip-simulation everything works as expected.

> forge script ./script/lz/LZSetupNova.s.sol:LZSetupScript --private-key 0x5fb92d6e98884f76de468fa3f6278f8807c48bebc13595d45af5bdc4da702133 --rpc-url http://127.0.0.1:49388 --broadcast  --skip-simulation

==========================

ONCHAIN EXECUTION COMPLETE & SUCCESSFUL.
Total Paid: 0.019180714 ETH (38361428 gas * avg 0.5 gwei)

Transactions saved to:

cc @vedhavyas please correct me if I am wrong

moreover, foundry overrides gas estimation/calculation for specific chains, i.e it doesn't rely on simulation for gas limit, rather queries RPC for it. This is the reason our script doesn't fail on Moonbase alpha testnet or Moonbeam.

so, basically, Frontier chains struggle with gas estimation via foundry simulation, not with estimateRpc() call. Script works fine and every tx is succesfull if we disable foundry simulation.

@abhi3700
Copy link
Contributor Author

If that's true, then we have to ensure that fix is merged with foundry's main. Otherwise, it would be difficult for use to persuade developers to use a particular version of foundry.

@dastansam
Copy link
Member

If that's true, then we have to ensure that fix is merged with foundry's main. Otherwise, it would be difficult for use to persuade developers to use a particular version of foundry.

every relatively new version of foundry should have --skip-simulation flag. Or do you mean if we add Nova to the list of chains to that requires querying RPC for gas estimate?

@abhi3700
Copy link
Contributor Author

abhi3700 commented May 29, 2024

do you mean if we add Nova to the list of chains to that requires querying RPC for gas estimate?

I meant this in the code as you shared on Slack:

/// True if the network calculates gas costs differently.
pub fn has_different_gas_calc(chain_id: u64) -> bool {
    if let Some(chain) = Chain::from(chain_id).named() {
        return matches!(
            chain,
            NamedChain::Arbitrum |
                NamedChain::ArbitrumTestnet |
                NamedChain::ArbitrumGoerli |
                NamedChain::ArbitrumSepolia |
                NamedChain::Moonbeam |
                NamedChain::Moonriver |
                NamedChain::Moonbase |
                NamedChain::MoonbeamDev
        ) || chain == 490000
    }

@vedhavyas
Copy link
Contributor

@dastansam did the previous fix not work ?

@dastansam
Copy link
Member

@dastansam did the previous fix not work ?

the previous fix will make this issue completely about foundry, i.e everything works if we use skip-simulation flag. So I want to keep it open until we decide if we keep using that flag or propose some changes to foundry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants