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

feat(protocol): add more protocol/tokenomics tests #12988

Merged
merged 66 commits into from
Feb 6, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
bd967bf
wip
cyberhorsey Jan 19, 2023
fcf37e7
merge main
cyberhorsey Jan 19, 2023
fcca784
Merge branch 'main' into prover_tests
cyberhorsey Jan 20, 2023
9dba09f
wip
cyberhorsey Jan 20, 2023
f5c9a96
wip: verification largely working
cyberhorsey Jan 21, 2023
44d5371
Merge branch 'main' into prover_tests
cyberhorsey Jan 21, 2023
197ac8e
test to make sure _rewardProvers issues 1 wei when owner has no tko b…
cyberhorsey Jan 21, 2023
f64d08f
send TKO to the prover for tests
cyberhorsey Jan 21, 2023
6873409
Merge branch 'prover_tests' of github.com:taikochain/taiko-mono into …
cyberhorsey Jan 21, 2023
c763aed
Merge branch 'main' into prover_tests
dantaik Jan 24, 2023
b9e9176
wip
cyberhorsey Jan 24, 2023
f6b0a2d
Merge branch 'prover_tests' of github.com:taikochain/taiko-mono into …
cyberhorsey Jan 24, 2023
098df43
tests pass. need refactor + addtl coverage but commit, propose, prove…
cyberhorsey Jan 24, 2023
61f5efb
rm getblockprovers
cyberhorsey Jan 24, 2023
e929e80
add sleep delay utils method, rename some variables
cyberhorsey Jan 24, 2023
1b6383c
helpers
cyberhorsey Jan 24, 2023
def8ae0
clean up tests
cyberhorsey Jan 24, 2023
3f17e2e
rm +1
cyberhorsey Jan 24, 2023
38e9a77
wip
cyberhorsey Jan 24, 2023
365288b
lower blocks so test runs faster, disable auto verification, comment …
cyberhorsey Jan 25, 2023
04792f1
remove async event nature of tests
cyberhorsey Jan 25, 2023
5942f88
Merge branch 'main' into prover_tests
cyberhorsey Jan 25, 2023
cf12914
add multiple proposer/prover test, addtl utils methods
cyberhorsey Jan 26, 2023
4422317
Merge branch 'prover_tests' of github.com:taikochain/taiko-mono into …
cyberhorsey Jan 26, 2023
2036417
merge main
cyberhorsey Jan 26, 2023
59072c0
Update protocol.yml
RogerLamTd Jan 26, 2023
fed052f
Update packages/protocol/test/tokenomics/proofReward.test.ts
cyberhorsey Jan 26, 2023
1730126
test names
cyberhorsey Jan 26, 2023
55787ce
Merge branch 'prover_tests' of github.com:taikochain/taiko-mono into …
cyberhorsey Jan 26, 2023
29bb42c
switch to event emitters
cyberhorsey Jan 26, 2023
ee8cf23
refactor listeners to utils methods
cyberhorsey Jan 26, 2023
6fa8eae
bubble up errors from eventhandlers to main thread
cyberhorsey Jan 26, 2023
07173db
refactor tests to root utils folder so we can reuse this code for Tai…
cyberhorsey Jan 27, 2023
a5dcb69
add taikol1 integration tests and begin refactorign them for more reu…
cyberhorsey Jan 27, 2023
33c8c28
Update packages/protocol/test/tokenomics/proofReward.test.ts
dantaik Jan 30, 2023
0e7ad12
Update packages/protocol/test/tokenomics/blockFee.test.ts
dantaik Jan 30, 2023
01e92d3
Merge branch 'main' into prover_tests
cyberhorsey Jan 30, 2023
1e54971
Merge branch 'main' into prover_tests
cyberhorsey Jan 30, 2023
829ffb9
Merge branch 'prover_tests' of github.com:taikochain/taiko-mono into …
cyberhorsey Jan 30, 2023
b849452
add circuits in to evidence
cyberhorsey Jan 30, 2023
3553849
.
cyberhorsey Jan 30, 2023
9f90310
change logging
cyberhorsey Jan 31, 2023
8fd36e5
forkchoice tests
cyberhorsey Jan 31, 2023
b3f6e51
small change
cyberhorsey Jan 31, 2023
bf3d85f
add channels, much cleaner than events i think?
cyberhorsey Jan 31, 2023
f301a44
simplify tests and refactor to use channels
cyberhorsey Jan 31, 2023
925a1de
Merge branch 'main' into prover_tests
cyberhorsey Jan 31, 2023
5c90d63
fix taikoL1 test for uncle delay
cyberhorsey Jan 31, 2023
fbd23fa
Merge branch 'prover_tests' of github.com:taikochain/taiko-mono into …
cyberhorsey Jan 31, 2023
729d21b
resolve merge conflicts
cyberhorsey Jan 31, 2023
69fc388
Merge branch 'main' into prover_tests
cyberhorsey Feb 1, 2023
0c85966
blockfee uses channel too
cyberhorsey Feb 1, 2023
bc2ff33
libproving + blockfee
cyberhorsey Feb 1, 2023
c4dafbc
Merge branch 'prover_tests' of github.com:taikochain/taiko-mono into …
cyberhorsey Feb 1, 2023
e607137
Merge branch 'main' into prover_tests
cyberhorsey Feb 2, 2023
ab92e88
Merge branch 'main' into prover_tests
dantaik Feb 2, 2023
c3a56e6
comments
cyberhorsey Feb 2, 2023
88aa015
try finally in proposer
cyberhorsey Feb 2, 2023
005d5f5
Merge branch 'prover_tests' of github.com:taikochain/taiko-mono into …
cyberhorsey Feb 2, 2023
08ef465
reusable integration fixture, test for latestSyncedHeader bug regress…
cyberhorsey Feb 2, 2023
de2b215
add test:all script so all tests can be run before pushing to verify …
cyberhorsey Feb 2, 2023
ba94085
propose/verify halt tests, refactor, halt utils method
cyberhorsey Feb 2, 2023
cdc70d8
chan/config to integrations fixture
cyberhorsey Feb 2, 2023
6de3a2c
add proposer/prover to fixture for re-use
cyberhorsey Feb 2, 2023
a064c56
test fix
cyberhorsey Feb 3, 2023
b965a57
test check maxnum
cyberhorsey Feb 3, 2023
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
Prev Previous commit
Next Next commit
merge main
  • Loading branch information
cyberhorsey committed Jan 26, 2023
commit 2036417f51b27bce9080edb3f941b5f0ee19f222
2 changes: 1 addition & 1 deletion packages/protocol/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ typechain
abis
abi
deployments/*.json

bin
yarn.lock
yarn-debug.log*
yarn-error.log*
Expand Down
68 changes: 33 additions & 35 deletions packages/protocol/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,41 @@

## [0.1.0](https://github.com/taikoxyz/taiko-mono/compare/protocol-v0.0.1...protocol-v0.1.0) (2023-01-19)


### Features

* **bridge:** add getMessageStatusSlot function ([#12940](https://github.com/taikoxyz/taiko-mono/issues/12940)) ([9837fa3](https://github.com/taikoxyz/taiko-mono/commit/9837fa3dceb5d702b2247879af52988be4da333d))
* **bridge:** bridge transactions ([#411](https://github.com/taikoxyz/taiko-mono/issues/411)) ([19dd7ab](https://github.com/taikoxyz/taiko-mono/commit/19dd7abd4a2f5bc83e43d31938e43501472ff108))
* **bridge:** implement the bridge relayer ([#191](https://github.com/taikoxyz/taiko-mono/issues/191)) ([9f49e4c](https://github.com/taikoxyz/taiko-mono/commit/9f49e4c87304853c9d94693434d23a6b8258eac6))
* **deployment:** fund L1 bridge ([#400](https://github.com/taikoxyz/taiko-mono/issues/400)) ([e7ef53e](https://github.com/taikoxyz/taiko-mono/commit/e7ef53e27cb906d7128a3e512e7082e4176786e4))
* **docs:** autocommit changes to solidity docs and omit private state vars and functions ([#490](https://github.com/taikoxyz/taiko-mono/issues/490)) ([dbf8db9](https://github.com/taikoxyz/taiko-mono/commit/dbf8db97635e4fa7c1808c55e62c20f5e987935d))
* **genesis:** support deterministic L2 pre-deployed contract addresses ([#358](https://github.com/taikoxyz/taiko-mono/issues/358)) ([cd34f17](https://github.com/taikoxyz/taiko-mono/commit/cd34f17382400f0ee3bfa85c8ef6a1f5acdb749a))
* migrate to nextra ([#12947](https://github.com/taikoxyz/taiko-mono/issues/12947)) ([ac11959](https://github.com/taikoxyz/taiko-mono/commit/ac1195940d1ab450e95367e6008162de1d22f0ab))
* **protocol:** add `TaikoL1.getBlockProvers` ([#340](https://github.com/taikoxyz/taiko-mono/issues/340)) ([c54f810](https://github.com/taikoxyz/taiko-mono/commit/c54f810d3251f97fcc1e061478044b93bfc0cf28))
* **protocol:** allow empty L2 blocks ([#406](https://github.com/taikoxyz/taiko-mono/issues/406)) ([6d1abf7](https://github.com/taikoxyz/taiko-mono/commit/6d1abf7bd8565bf0377a42b823a6ad98959c340a))
* **protocol:** allow whitelisting proposers ([#375](https://github.com/taikoxyz/taiko-mono/issues/375)) ([80b99a4](https://github.com/taikoxyz/taiko-mono/commit/80b99a4afe6f68f9bca6d7b07e584e57c2ea7f0b))
* **protocol:** enhance ZKP handling & change proofs order ([#288](https://github.com/taikoxyz/taiko-mono/issues/288)) ([5fdfdfa](https://github.com/taikoxyz/taiko-mono/commit/5fdfdfad4207792411f5e92dcee5c603dbeaeee3))
* **protocol:** expose getUncleProofDelay function ([#7058](https://github.com/taikoxyz/taiko-mono/issues/7058)) ([dd0f011](https://github.com/taikoxyz/taiko-mono/commit/dd0f01179ab328d0d8ebb20a07204df821b36a77))
* **protocol:** implement & simulate tokenomics ([#376](https://github.com/taikoxyz/taiko-mono/issues/376)) ([191eb11](https://github.com/taikoxyz/taiko-mono/commit/191eb110990d60b49883eb3f3d7841c33421d067))
* **protocol:** invalidBlock must from golden touch address with 0 gasprice ([#482](https://github.com/taikoxyz/taiko-mono/issues/482)) ([ecb9cc5](https://github.com/taikoxyz/taiko-mono/commit/ecb9cc543513e61ae9efbdfb17cacda87ce3f70d))
* **protocol:** preprocess variables for test ([#445](https://github.com/taikoxyz/taiko-mono/issues/445)) ([31584b4](https://github.com/taikoxyz/taiko-mono/commit/31584b47c11749711dcb3c61dc74581991141de3))
* **protocol:** whitelist provers & temporarily disable coverage check ([#296](https://github.com/taikoxyz/taiko-mono/issues/296)) ([06ceee2](https://github.com/taikoxyz/taiko-mono/commit/06ceee2599d01802683cca6b57e3fb6710946cd1))
* **ui:** Template / initial repo for UI ([#304](https://github.com/taikoxyz/taiko-mono/issues/304)) ([a396511](https://github.com/taikoxyz/taiko-mono/commit/a39651133d4c3bd8b6eea5db93daec7698600707))

- **bridge:** add getMessageStatusSlot function ([#12940](https://github.com/taikoxyz/taiko-mono/issues/12940)) ([9837fa3](https://github.com/taikoxyz/taiko-mono/commit/9837fa3dceb5d702b2247879af52988be4da333d))
- **bridge:** bridge transactions ([#411](https://github.com/taikoxyz/taiko-mono/issues/411)) ([19dd7ab](https://github.com/taikoxyz/taiko-mono/commit/19dd7abd4a2f5bc83e43d31938e43501472ff108))
- **bridge:** implement the bridge relayer ([#191](https://github.com/taikoxyz/taiko-mono/issues/191)) ([9f49e4c](https://github.com/taikoxyz/taiko-mono/commit/9f49e4c87304853c9d94693434d23a6b8258eac6))
- **deployment:** fund L1 bridge ([#400](https://github.com/taikoxyz/taiko-mono/issues/400)) ([e7ef53e](https://github.com/taikoxyz/taiko-mono/commit/e7ef53e27cb906d7128a3e512e7082e4176786e4))
- **docs:** autocommit changes to solidity docs and omit private state vars and functions ([#490](https://github.com/taikoxyz/taiko-mono/issues/490)) ([dbf8db9](https://github.com/taikoxyz/taiko-mono/commit/dbf8db97635e4fa7c1808c55e62c20f5e987935d))
- **genesis:** support deterministic L2 pre-deployed contract addresses ([#358](https://github.com/taikoxyz/taiko-mono/issues/358)) ([cd34f17](https://github.com/taikoxyz/taiko-mono/commit/cd34f17382400f0ee3bfa85c8ef6a1f5acdb749a))
- migrate to nextra ([#12947](https://github.com/taikoxyz/taiko-mono/issues/12947)) ([ac11959](https://github.com/taikoxyz/taiko-mono/commit/ac1195940d1ab450e95367e6008162de1d22f0ab))
- **protocol:** add `TaikoL1.getBlockProvers` ([#340](https://github.com/taikoxyz/taiko-mono/issues/340)) ([c54f810](https://github.com/taikoxyz/taiko-mono/commit/c54f810d3251f97fcc1e061478044b93bfc0cf28))
- **protocol:** allow empty L2 blocks ([#406](https://github.com/taikoxyz/taiko-mono/issues/406)) ([6d1abf7](https://github.com/taikoxyz/taiko-mono/commit/6d1abf7bd8565bf0377a42b823a6ad98959c340a))
- **protocol:** allow whitelisting proposers ([#375](https://github.com/taikoxyz/taiko-mono/issues/375)) ([80b99a4](https://github.com/taikoxyz/taiko-mono/commit/80b99a4afe6f68f9bca6d7b07e584e57c2ea7f0b))
- **protocol:** enhance ZKP handling & change proofs order ([#288](https://github.com/taikoxyz/taiko-mono/issues/288)) ([5fdfdfa](https://github.com/taikoxyz/taiko-mono/commit/5fdfdfad4207792411f5e92dcee5c603dbeaeee3))
- **protocol:** expose getUncleProofDelay function ([#7058](https://github.com/taikoxyz/taiko-mono/issues/7058)) ([dd0f011](https://github.com/taikoxyz/taiko-mono/commit/dd0f01179ab328d0d8ebb20a07204df821b36a77))
- **protocol:** implement & simulate tokenomics ([#376](https://github.com/taikoxyz/taiko-mono/issues/376)) ([191eb11](https://github.com/taikoxyz/taiko-mono/commit/191eb110990d60b49883eb3f3d7841c33421d067))
- **protocol:** invalidBlock must from golden touch address with 0 gasprice ([#482](https://github.com/taikoxyz/taiko-mono/issues/482)) ([ecb9cc5](https://github.com/taikoxyz/taiko-mono/commit/ecb9cc543513e61ae9efbdfb17cacda87ce3f70d))
- **protocol:** preprocess variables for test ([#445](https://github.com/taikoxyz/taiko-mono/issues/445)) ([31584b4](https://github.com/taikoxyz/taiko-mono/commit/31584b47c11749711dcb3c61dc74581991141de3))
- **protocol:** whitelist provers & temporarily disable coverage check ([#296](https://github.com/taikoxyz/taiko-mono/issues/296)) ([06ceee2](https://github.com/taikoxyz/taiko-mono/commit/06ceee2599d01802683cca6b57e3fb6710946cd1))
- **ui:** Template / initial repo for UI ([#304](https://github.com/taikoxyz/taiko-mono/issues/304)) ([a396511](https://github.com/taikoxyz/taiko-mono/commit/a39651133d4c3bd8b6eea5db93daec7698600707))

### Bug Fixes

* **bridge:** Token Vault sendEther messages with processing fees are impossible to send ([#277](https://github.com/taikoxyz/taiko-mono/issues/277)) ([10d9bbc](https://github.com/taikoxyz/taiko-mono/commit/10d9bbc63ca624cc80c729942301eac334c960df))
* **pnpm:** conflict with eslint command and use pnpm instead of npm ([#273](https://github.com/taikoxyz/taiko-mono/issues/273)) ([134cd5a](https://github.com/taikoxyz/taiko-mono/commit/134cd5a75fcf3e78feac5762985d09658404735e))
* **preprocess:** fix hardhat preprocessor configs ([#368](https://github.com/taikoxyz/taiko-mono/issues/368)) ([8bdbb3e](https://github.com/taikoxyz/taiko-mono/commit/8bdbb3e3f5f30d11e4f9213690db316f2148568c))
* **protocol:** Add EtherTransferred event to EtherVault [#12971](https://github.com/taikoxyz/taiko-mono/issues/12971) ([5791f3a](https://github.com/taikoxyz/taiko-mono/commit/5791f3af85df462cc5aabbdf2b14d957d49c9f00))
* **protocol:** fix `BlockVerified` event ([#381](https://github.com/taikoxyz/taiko-mono/issues/381)) ([fe479c8](https://github.com/taikoxyz/taiko-mono/commit/fe479c8ff22b0da59ec75cc9e0dea04e38ebbb92))
* **protocol:** fix `TokenVault.sendERC20` ([#420](https://github.com/taikoxyz/taiko-mono/issues/420)) ([d42b953](https://github.com/taikoxyz/taiko-mono/commit/d42b953c51e66948d7a6563042f7a521ee2d557a))
* **protocol:** fix an occantional error in `test:tokenomics` ([#12950](https://github.com/taikoxyz/taiko-mono/issues/12950)) ([005364c](https://github.com/taikoxyz/taiko-mono/commit/005364c11c327f6dcaad7872c5064eb81e52f35b))
* **protocol:** Fix bug in getProposedBlock ([#11679](https://github.com/taikoxyz/taiko-mono/issues/11679)) ([a6a596c](https://github.com/taikoxyz/taiko-mono/commit/a6a596cf10ecfa517a781e8c487b2d74f05a9526))
* **protocol:** let `LibZKP.verify` return `true` ([#12676](https://github.com/taikoxyz/taiko-mono/issues/12676)) ([d0f17a6](https://github.com/taikoxyz/taiko-mono/commit/d0f17a6dc8921df49a63831d91170a7c11476bd9))
* **protocol:** Remove enableDestChain functionality ([#12341](https://github.com/taikoxyz/taiko-mono/issues/12341)) ([362d083](https://github.com/taikoxyz/taiko-mono/commit/362d083497cc74b3bcd05a406beeff2101a422ef))
* **protocol:** update avg proof time and avg block time ([#391](https://github.com/taikoxyz/taiko-mono/issues/391)) ([3681483](https://github.com/taikoxyz/taiko-mono/commit/3681483efe97c38a488563594c003dabfa23b2de))
* **test:** fix the occasional `noNetwork` error in integration tests ([#7562](https://github.com/taikoxyz/taiko-mono/issues/7562)) ([a8e82d5](https://github.com/taikoxyz/taiko-mono/commit/a8e82d5c2d65d293d17953ff357816483eb25e00))
* **test:** fix two occasional errors when running bridge tests ([#305](https://github.com/taikoxyz/taiko-mono/issues/305)) ([fb91e0d](https://github.com/taikoxyz/taiko-mono/commit/fb91e0d482df9a510e582dcf267aadd8892fcebd))
* **test:** Fixed integration test case ([#483](https://github.com/taikoxyz/taiko-mono/issues/483)) ([4b0893e](https://github.com/taikoxyz/taiko-mono/commit/4b0893e3b0a723cd9115fd0c03e4ec4d1e0d1a38))
* **test:** making tests type-safe ([#318](https://github.com/taikoxyz/taiko-mono/issues/318)) ([66ec7cc](https://github.com/taikoxyz/taiko-mono/commit/66ec7cc143af58dda8fde0d6adc30a4758685d1e))
* **tests:** cleanup tests to prepare for tokenomics testing ([#11316](https://github.com/taikoxyz/taiko-mono/issues/11316)) ([d63fae3](https://github.com/taikoxyz/taiko-mono/commit/d63fae30f1e3415d6f377adeab90c062fed5ad42))
- **bridge:** Token Vault sendEther messages with processing fees are impossible to send ([#277](https://github.com/taikoxyz/taiko-mono/issues/277)) ([10d9bbc](https://github.com/taikoxyz/taiko-mono/commit/10d9bbc63ca624cc80c729942301eac334c960df))
- **pnpm:** conflict with eslint command and use pnpm instead of npm ([#273](https://github.com/taikoxyz/taiko-mono/issues/273)) ([134cd5a](https://github.com/taikoxyz/taiko-mono/commit/134cd5a75fcf3e78feac5762985d09658404735e))
- **preprocess:** fix hardhat preprocessor configs ([#368](https://github.com/taikoxyz/taiko-mono/issues/368)) ([8bdbb3e](https://github.com/taikoxyz/taiko-mono/commit/8bdbb3e3f5f30d11e4f9213690db316f2148568c))
- **protocol:** Add EtherTransferred event to EtherVault [#12971](https://github.com/taikoxyz/taiko-mono/issues/12971) ([5791f3a](https://github.com/taikoxyz/taiko-mono/commit/5791f3af85df462cc5aabbdf2b14d957d49c9f00))
- **protocol:** fix `BlockVerified` event ([#381](https://github.com/taikoxyz/taiko-mono/issues/381)) ([fe479c8](https://github.com/taikoxyz/taiko-mono/commit/fe479c8ff22b0da59ec75cc9e0dea04e38ebbb92))
- **protocol:** fix `TokenVault.sendERC20` ([#420](https://github.com/taikoxyz/taiko-mono/issues/420)) ([d42b953](https://github.com/taikoxyz/taiko-mono/commit/d42b953c51e66948d7a6563042f7a521ee2d557a))
- **protocol:** fix an occantional error in `test:tokenomics` ([#12950](https://github.com/taikoxyz/taiko-mono/issues/12950)) ([005364c](https://github.com/taikoxyz/taiko-mono/commit/005364c11c327f6dcaad7872c5064eb81e52f35b))
- **protocol:** Fix bug in getProposedBlock ([#11679](https://github.com/taikoxyz/taiko-mono/issues/11679)) ([a6a596c](https://github.com/taikoxyz/taiko-mono/commit/a6a596cf10ecfa517a781e8c487b2d74f05a9526))
- **protocol:** let `LibZKP.verify` return `true` ([#12676](https://github.com/taikoxyz/taiko-mono/issues/12676)) ([d0f17a6](https://github.com/taikoxyz/taiko-mono/commit/d0f17a6dc8921df49a63831d91170a7c11476bd9))
- **protocol:** Remove enableDestChain functionality ([#12341](https://github.com/taikoxyz/taiko-mono/issues/12341)) ([362d083](https://github.com/taikoxyz/taiko-mono/commit/362d083497cc74b3bcd05a406beeff2101a422ef))
- **protocol:** update avg proof time and avg block time ([#391](https://github.com/taikoxyz/taiko-mono/issues/391)) ([3681483](https://github.com/taikoxyz/taiko-mono/commit/3681483efe97c38a488563594c003dabfa23b2de))
- **test:** fix the occasional `noNetwork` error in integration tests ([#7562](https://github.com/taikoxyz/taiko-mono/issues/7562)) ([a8e82d5](https://github.com/taikoxyz/taiko-mono/commit/a8e82d5c2d65d293d17953ff357816483eb25e00))
- **test:** fix two occasional errors when running bridge tests ([#305](https://github.com/taikoxyz/taiko-mono/issues/305)) ([fb91e0d](https://github.com/taikoxyz/taiko-mono/commit/fb91e0d482df9a510e582dcf267aadd8892fcebd))
- **test:** Fixed integration test case ([#483](https://github.com/taikoxyz/taiko-mono/issues/483)) ([4b0893e](https://github.com/taikoxyz/taiko-mono/commit/4b0893e3b0a723cd9115fd0c03e4ec4d1e0d1a38))
- **test:** making tests type-safe ([#318](https://github.com/taikoxyz/taiko-mono/issues/318)) ([66ec7cc](https://github.com/taikoxyz/taiko-mono/commit/66ec7cc143af58dda8fde0d6adc30a4758685d1e))
- **tests:** cleanup tests to prepare for tokenomics testing ([#11316](https://github.com/taikoxyz/taiko-mono/issues/11316)) ([d63fae3](https://github.com/taikoxyz/taiko-mono/commit/d63fae30f1e3415d6f377adeab90c062fed5ad42))
19 changes: 12 additions & 7 deletions packages/protocol/contracts/L1/ProofVerifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,19 @@

pragma solidity ^0.8.9;

import "../thirdparty/LibMerkleTrie.sol";
import "../common/EssentialContract.sol";
import "../libs/LibZKP.sol";
import "../thirdparty/LibMerkleTrie.sol";

/// @author dantaik <[email protected]>
interface IProofVerifier {
function verifyZKP(
bytes memory verificationKey,
string memory verifierId,
bytes calldata zkproof,
bytes32 blockHash,
address prover,
bytes32 txListHash
) external pure returns (bool verified);
) external view returns (bool verified);

function verifyMKP(
bytes memory key,
Expand All @@ -27,17 +28,21 @@ interface IProofVerifier {
) external pure returns (bool verified);
}

contract ProofVerifier is IProofVerifier {
contract ProofVerifier is IProofVerifier, EssentialContract {
function init(address addressManager) external initializer {
EssentialContract._init(addressManager);
}

function verifyZKP(
bytes memory verificationKey,
string memory verifierId,
bytes calldata zkproof,
bytes32 blockHash,
address prover,
bytes32 txListHash
) external pure returns (bool) {
) external view returns (bool) {
return
LibZKP.verify({
verificationKey: verificationKey,
plonkVerifier: resolve(verifierId, false),
zkproof: zkproof,
blockHash: blockHash,
prover: prover,
Expand Down
8 changes: 4 additions & 4 deletions packages/protocol/contracts/L1/TaikoL1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -241,15 +241,15 @@ contract TaikoL1 is EssentialContract, IHeaderSync, TaikoEvents {

function getSyncedHeader(
uint256 number
) public view override returns (bytes32 header) {
header = state.getL2BlockHash(number);
require(header != 0, "L1:number");
) public view override returns (bytes32) {
return state.getL2BlockHash(number, getConfig().blockHashHistory);
}

function getLatestSyncedHeader() public view override returns (bytes32) {
return
state.getL2BlockHash(
state.latestVerifiedHeight % getConfig().blockHashHistory
state.latestVerifiedHeight,
getConfig().blockHashHistory
);
}

Expand Down
3 changes: 1 addition & 2 deletions packages/protocol/contracts/L1/libs/LibProposing.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

pragma solidity ^0.8.9;

import "../../common/ConfigManager.sol";
import "../../libs/LibTxDecoder.sol";
import "../TkoToken.sol";
import "./LibUtils.sol";
Expand Down Expand Up @@ -89,7 +88,7 @@ library LibProposing {
meta.txListHash == txList.hashTxList(),
"L1:txList"
);
// require(4 < 0 + 4)

require(
state.nextBlockId <
state.latestVerifiedId + config.maxNumBlocks,
Expand Down
7 changes: 3 additions & 4 deletions packages/protocol/contracts/L1/libs/LibProving.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ pragma solidity ^0.8.9;

import {IProofVerifier} from "../ProofVerifier.sol";
import "../../common/AddressResolver.sol";
import "../../common/ConfigManager.sol";
import "../../libs/LibAnchorSignature.sol";
import "../../libs/LibBlockHeader.sol";
import "../../libs/LibReceiptDecoder.sol";
Expand Down Expand Up @@ -258,9 +257,9 @@ library LibProving {
} else {
require(
proofVerifier.verifyZKP({
verificationKey: ConfigManager(
resolver.resolve("config_manager", false)
).getValue(string(abi.encodePacked("zk_vkey_", i))),
verifierId: string(
abi.encodePacked("plonk_verifier_", i)
),
zkproof: evidence.proofs[i],
blockHash: blockHash,
prover: evidence.prover,
Expand Down
11 changes: 8 additions & 3 deletions packages/protocol/contracts/L1/libs/LibUtils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,15 @@ library LibUtils {

function getL2BlockHash(
TaikoData.State storage state,
uint256 number
uint256 number,
uint256 blockHashHistory
) internal view returns (bytes32) {
require(number <= state.latestVerifiedHeight, "L1:id");
return state.l2Hashes[number];
require(
number + blockHashHistory > state.latestVerifiedHeight &&
number <= state.latestVerifiedHeight,
"L1:number"
);
return state.l2Hashes[number % blockHashHistory];
}

function getStateVariables(
Expand Down
4 changes: 3 additions & 1 deletion packages/protocol/contracts/L1/libs/LibVerifying.sol
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ library LibVerifying {
}

uint64 latestL2Height = state.latestVerifiedHeight;
bytes32 latestL2Hash = state.l2Hashes[latestL2Height];
bytes32 latestL2Hash = state.l2Hashes[
latestL2Height % config.blockHashHistory
];
uint64 processed = 0;

for (
Expand Down
18 changes: 17 additions & 1 deletion packages/protocol/contracts/bridge/Bridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import "../common/EssentialContract.sol";
import "./IBridge.sol";
import "./libs/LibBridgeData.sol";
import "./libs/LibBridgeProcess.sol";
import "./libs/LibBridgeRelease.sol";
import "./libs/LibBridgeRetry.sol";
import "./libs/LibBridgeSend.sol";
import "./libs/LibBridgeStatus.sol";
Expand Down Expand Up @@ -65,6 +66,19 @@ contract Bridge is EssentialContract, IBridge {
});
}

function releaseEther(
IBridge.Message calldata message,
bytes calldata proof
) external nonReentrant {
return
LibBridgeRelease.releaseEther({
state: state,
resolver: AddressResolver(this),
message: message,
proof: proof
});
}

function processMessage(
Message calldata message,
bytes calldata proof
Expand Down Expand Up @@ -142,7 +156,9 @@ contract Bridge is EssentialContract, IBridge {
LibBridgeSend.isDestChainEnabled(AddressResolver(this), _chainId);
}

function hashMessage(Message memory message) public pure returns (bytes32) {
function hashMessage(
Message calldata message
) public pure override returns (bytes32) {
return LibBridgeData.hashMessage(message);
}

Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.