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

fix(protocol): tstore is not suppported on L2 now #15802

Merged
merged 23 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
43737d7
tstore not suppported on L2 now
dantaik Feb 15, 2024
37a58b2
Update foundry.toml
dantaik Feb 15, 2024
81c57b7
Update OwnerUUPSUpgradable.sol
dantaik Feb 15, 2024
9846a13
Update OwnerUUPSUpgradable.sol
dantaik Feb 15, 2024
4e12106
Update OwnerUUPSUpgradable.sol
dantaik Feb 15, 2024
d91c769
removed --evm-version cancun from foundry
dantaik Feb 15, 2024
16f0058
Update OwnerUUPSUpgradable.sol
dantaik Feb 15, 2024
c42e3df
Update OwnerUUPSUpgradable.sol
dantaik Feb 15, 2024
3634195
Update OwnerUUPSUpgradable.sol
dantaik Feb 15, 2024
562ea25
Update OwnerUUPSUpgradable.sol
dantaik Feb 15, 2024
8e53b15
Update taikoL2.ts
dantaik Feb 15, 2024
4eada50
Update test_deploy_on_l1.sh
dantaik Feb 15, 2024
f9e7e6e
Merge branch 'main' into reentrance
dantaik Feb 15, 2024
8d72475
Merge branch 'main' into reentrance
dantaik Feb 15, 2024
a77c85e
chore(protocol): update OwnerUUPSUpgradable.sol (#15810)
dantaik Feb 15, 2024
f8842ff
Revert "removed --evm-version cancun from foundry"
dantaik Feb 15, 2024
68207a3
Revert "Update foundry.toml"
dantaik Feb 15, 2024
16e7778
Update generate_genesis.test.sh
dantaik Feb 15, 2024
af0f459
Update test_deploy_on_l1.sh
dantaik Feb 15, 2024
d92ad39
Revert "Update test_deploy_on_l1.sh"
dantaik Feb 15, 2024
2765afe
Merge branch 'reentrance' of https://github.com/taikoxyz/taiko-mono i…
dantaik Feb 15, 2024
2094cfe
Make the use of transient storage in the bridge conditional on chainid
Brechtpd Feb 15, 2024
bc50c15
Merge remote-tracking branch 'origin/reentrance' into reentrance
Brechtpd Feb 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions packages/protocol/contracts/common/OwnerUUPSUpgradable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ abstract contract OwnerUUPSUpgradable is UUPSUpgradeable, OwnableUpgradeable {
bytes32 private constant _REENTRY_SLOT =
0xa5054f728453d3dbe953bdc43e4d0cb97e662ea32d7958190f3dc2da31d9721a;

uint8 private _reentryDeprecated; // slot 1
uint8 private _reentry; // slot 1
dantaik marked this conversation as resolved.
Show resolved Hide resolved
uint8 private _paused;
uint256[49] private __gap;

Expand Down Expand Up @@ -88,21 +88,23 @@ abstract contract OwnerUUPSUpgradable is UUPSUpgradeable, OwnableUpgradeable {
_paused = _FALSE;
}

function _inNonReentrant() internal view returns (bool) {
return _loadReentryLock() == _TRUE;
}

// Stores the reentry lock
function _storeReentryLock(uint8 reentry) private {
assembly {
tstore(_REENTRY_SLOT, reentry)
}
function _storeReentryLock(uint8 reentry) internal virtual {
dantaik marked this conversation as resolved.
Show resolved Hide resolved
_reentry = reentry;
// assembly {
// tstore(_REENTRY_SLOT, reentry)
// }
}

// Loads the reentry lock
function _loadReentryLock() private view returns (uint8 reentry) {
assembly {
reentry := tload(_REENTRY_SLOT)
}
function _loadReentryLock() internal view virtual returns (uint8 reentry) {
reentry = _reentry;
// assembly {
// reentry := tload(_REENTRY_SLOT)
// }
}

function _inNonReentrant() internal view returns (bool) {
return _loadReentryLock() == _TRUE;
}
}
1 change: 0 additions & 1 deletion packages/protocol/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ optimizer_runs = 200
ffi = true
gas_limit = '18446744073709551615'
memory_limit = 2073741824
evm_version = 'cancun'

# Do not change the block_gas_limit value, TaikoL2.t.sol depends on it.
block_gas_limit = 80000000 #80M
Expand Down
1 change: 1 addition & 0 deletions packages/protocol/genesis/generate_genesis.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,6 @@ forge test \
--fork-url http://localhost:18545 \
--fork-retry-backoff 120 \
--no-storage-caching \
--evm-version cancun \
--match-path genesis/*.g.sol \
--block-gas-limit 1000000000
8 changes: 4 additions & 4 deletions packages/protocol/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
"scripts": {
"buildMerkle": "ts-node ./utils/airdrop/buildMerkleTree.ts ./utils/airdrop/airdrop_db/example_claimList.json",
"clean": "rm -rf abis cache* && forge clean",
"compile": "forge build --build-info --extra-output storage-layout",
"compile": "forge build --evm-version cancun --build-info --extra-output storage-layout",
"test:deploy": "./script/download_solc.sh && ./script/test_deploy_on_l1.sh",
"eslint": "pnpm exec eslint --ignore-path .eslintignore --ext .js,.ts .",
"eslint:fix": "pnpm exec eslint --ignore-path .eslintignore --ext .js,.ts . --fix",
"fmt:sol": "forge fmt",
"generate:genesis": "ts-node ./utils/generate_genesis/main.ts",
"lint:sol": "forge fmt && pnpm solhint 'contracts/**/*.sol' --fix",
"snapshot": "forge snapshot --match-path 'test/**/*.t.sol'",
"test": "forge test -vvv --match-path test/*.t.sol",
"snapshot": "forge snapshot --evm-version cancun --match-path 'test/**/*.t.sol'",
"test": "forge test -vvv --evm-version cancun --match-path test/*.t.sol",
"test:coverage": "mkdir -p coverage && forge coverage --report lcov && lcov --remove ./lcov.info -o ./coverage/lcov.info 'test/' 'script/' 'contracts/thirdparty/' && genhtml coverage/lcov.info --branch-coverage --output-dir coverage --ignore-errors category && open coverage/index.html",
"test:genesis": "pnpm compile && FOUNDRY_PROFILE=genesis ./genesis/generate_genesis.test.sh",
"export:simconf": "forge test --match-test 'test_simulation' -vv > simulation/out/simconf_$(date +%s).txt"
"export:simconf": "forge test --evm-version cancun --match-test 'test_simulation' -vv > simulation/out/simconf_$(date +%s).txt"
},
"keywords": [
"ZKP",
Expand Down
Loading