From dbe30bd7d6ca31cec4b76a93742b9c3ff653ee95 Mon Sep 17 00:00:00 2001 From: d1onys1us <13951458+d1onys1us@users.noreply.github.com> Date: Mon, 4 Mar 2024 20:29:20 -0500 Subject: [PATCH] chore(repo,protocol): fmt and clean up foundry.toml (#16314) --- .vscode/extensions.json | 5 ++++- .vscode/settings.json | 9 ++++++--- packages/protocol/README.md | 2 -- packages/protocol/foundry.toml | 34 +++++++++++++++++--------------- packages/protocol/remappings.txt | 6 ------ 5 files changed, 28 insertions(+), 28 deletions(-) delete mode 100644 packages/protocol/remappings.txt diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 7d5d7da3d93..f776f85dfd5 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,3 +1,6 @@ { - "recommendations": ["NomicFoundation.hardhat-solidity"] + "recommendations": [ + "NomicFoundation.hardhat-solidity", + "tamasfe.even-better-toml" + ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index de287ccf615..4f74d269f8f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,11 +6,14 @@ "[solidity]": { "editor.defaultFormatter": "NomicFoundation.hardhat-solidity" }, + "[toml]": { + "editor.defaultFormatter": "tamasfe.even-better-toml" + }, + "solidity.compileUsingRemoteVersion": "v0.8.24+commit.e11b9ed9", "solidity.formatter": "forge", + "i18n-ally.keystyle": "nested", "i18n-ally.localesPaths": [ "packages/bridge-ui/src/i18n", "packages/guardian-prover-health-check-ui/src/i18n" - ], - "i18n-ally.keystyle": "nested", - "solidity.compileUsingRemoteVersion": "v0.8.24+commit.e11b9ed9" + ] } diff --git a/packages/protocol/README.md b/packages/protocol/README.md index 1286e93b9b2..b7425581a41 100644 --- a/packages/protocol/README.md +++ b/packages/protocol/README.md @@ -68,8 +68,6 @@ This project also integrates with Foundry for building and testing contracts. - To compile using foundry: `forge build` or `pnpm compile` - To run foundry tests: `forge test --gas-report -vvv` or `pnpm test:foundry` -Note that compiling with foundry uses dependencies inside the `lib` dir (instead of `node_modules`). - ## Generating and Running the L2 Genesis Block The generation of the L2 genesis block and obtaining its hash involves a series of steps, including constructing the genesis JSON, followed by the actual generation and retrieval of the genesis block hash. A test can be executed to comprehend this process. diff --git a/packages/protocol/foundry.toml b/packages/protocol/foundry.toml index c6ddae12e86..9d30ec43e5d 100644 --- a/packages/protocol/foundry.toml +++ b/packages/protocol/foundry.toml @@ -1,23 +1,29 @@ -# See more config options https://github.com/foundry-rs/foundry/tree/master/config [profile.default] -solc_version = "0.8.24" src = "contracts" out = "out" test = "test" script = "script" -libs = ["lib"] -gas_price = 10000000000 # gas price is 10 Gwei +gas_price = 10_000_000_000 # 10 Gwei +gas_limit = "18446744073709551615" # u64::MAX optimizer = true optimizer_runs = 200 ffi = true -gas_limit = "18446744073709551615" -memory_limit = 2073741824 +memory_limit = 2_073_741_824 +solc_version = "0.8.24" evm_version = "cancun" +remappings = [ + "@openzeppelin/contracts-upgradeable/=node_modules/@openzeppelin/contracts-upgradeable/", + "@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/", + "solady/=node_modules/solady/", + "forge-std/=node_modules/forge-std/", + "ds-test/=node_modules/ds-test/src/", + "p256-verifier/=node_modules/p256-verifier/", +] # Do not change the block_gas_limit value, TaikoL2.t.sol depends on it. -block_gas_limit = 80000000 #80M # For mainnet_mock tokenomics test we need a huge value to run lots of iterations. -# Use the above 30M for TaikoL2.t.sol related tests, only use this number with mainnet simulation. +# Use 30M for TaikoL2.t.sol related tests, only use this number with mainnet simulation. +block_gas_limit = 80_000_000 fs_permissions = [ { access = "read", path = "./out" }, @@ -26,17 +32,13 @@ fs_permissions = [ { access = "read", path = "./genesis" }, ] -# 2394: transient storage warning +# 2394: Transient storage warning # 3860: Contract initcode size is xxx bytes and exceeds 49152 bytes # 5574: Contract code size is xxx bytes and exceeds 24576 byte -ignored_error_codes = [ 2394, 3860, 5574] - -fuzz = { runs = 200 } +ignored_error_codes = [2394, 3860, 5574] -# Workaround as a fixed fuzz seed. -# Bug is confirmed, will be fixed soon: -# https://github.com/foundry-rs/foundry/issues/5913 -seed = 13623721389213 +[fuzz] +runs = 200 [fmt] bracket_spacing = true diff --git a/packages/protocol/remappings.txt b/packages/protocol/remappings.txt deleted file mode 100644 index f99d72faca0..00000000000 --- a/packages/protocol/remappings.txt +++ /dev/null @@ -1,6 +0,0 @@ -@openzeppelin/contracts-upgradeable/=node_modules/@openzeppelin/contracts-upgradeable/ -@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/ -solady/=node_modules/solady/ -forge-std/=node_modules/forge-std/ -ds-test/=node_modules/ds-test/src/ -p256-verifier/=node_modules/p256-verifier/