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

refactor(protocol): optimize core protocol and bridge implementation #14310

Merged
merged 148 commits into from
Aug 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
148 commits
Select commit Hold shift + click to select a range
d96e4bd
feat(protocol): alpha-4 with staking-based tokenomics (#13981)
dantaik Jun 28, 2023
c7fee73
refactor(protocol): add very minor update (#14066)
dantaik Jun 28, 2023
4cb7367
refactor(protocol): optimize ProverPool (#14069)
dantaik Jun 30, 2023
dc2e975
Merge branch 'main' into alpha-4
dantaik Jun 30, 2023
46c0e66
fix(protocol): Fix alpha-4 ability to build protocol and run tests (#…
cyberhorsey Jun 30, 2023
dee55c9
feat(eventindexer): Alpha 4 event indexing (#14078)
cyberhorsey Jul 1, 2023
5c40c12
feat(relayer): Alpha 4 event sub (#14081)
cyberhorsey Jul 1, 2023
81176e3
Merge branch 'main' into alpha-4
davidtaikocha Jul 1, 2023
8e398f4
chore(protocol): delete ProverPool2 and deprecated documents (#14082)
dantaik Jul 1, 2023
478ba5e
feat(protocol): allow premint of TKO to multiple addresses/amounts in…
cyberhorsey Jul 2, 2023
8ba71a6
chore(protocol): use block.prevrandao to avoid warning (#14088)
dantaik Jul 3, 2023
6805a11
Merge branch 'main' into alpha-4
dantaik Jul 3, 2023
e8ffbb8
Update TokenVault.sol
dong77 Jul 3, 2023
2fa83d2
fix typo
dantaik Jul 3, 2023
a539646
feat(protocol): restrict prover staking changes to once per hour (#14…
dantaik Jul 4, 2023
5bf313e
feat(protocol): disable oracle proofs to be over written by regular p…
dantaik Jul 4, 2023
38d537b
feat(protocol): unify taiko tokens acros L1, L2s, and L3s (#14083)
dantaik Jul 4, 2023
4e8e78a
Merge branch 'main' into alpha-4
cyberhorsey Jul 4, 2023
7f41353
feat(protocol): A4 bindings (#14101)
cyberhorsey Jul 4, 2023
4ef8d0c
fix(eventindexer): add address to Slashed event in db, + add logs (#1…
cyberhorsey Jul 4, 2023
05da0e7
fix(protocol): limit reward per gas in weight calculation (#14098)
dantaik Jul 5, 2023
c341f0a
add provers route
cyberhorsey Jul 5, 2023
44d119e
Merge branch 'main' into alpha-4
cyberhorsey Jul 5, 2023
a24f9a6
abigen
cyberhorsey Jul 5, 2023
76d9375
Merge branch 'alpha-4' of github.com:taikoxyz/taiko-mono into alpha-4
cyberhorsey Jul 5, 2023
5cd6c82
chore(protocol) use uint32 for gas limit, gas used, gas price (#14112)
dantaik Jul 6, 2023
fd07f3f
feat(protocol): add prover into block events (#14123)
dantaik Jul 7, 2023
c4c671e
feat(protocol): also add rewardPerGas into BlockProposedEvent (#14124)
dantaik Jul 8, 2023
053e198
Resolve merge from main with eventindexer changes
cyberhorsey Jul 10, 2023
c4ab00d
Merge branch 'alpha-4' of github.com:taikoxyz/taiko-mono into alpha-4
cyberhorsey Jul 10, 2023
32b043f
empty struct line
cyberhorsey Jul 10, 2023
aa3d6ec
move proverpool
cyberhorsey Jul 10, 2023
62a913c
lint
cyberhorsey Jul 10, 2023
9c0fd32
proverpool address comp
cyberhorsey Jul 10, 2023
f8415a2
chore(protocol): update BridgedERC20.sol by remove "dao" from auth li…
dantaik Jul 10, 2023
abc4157
Merge branch 'main' into alpha-4
cyberhorsey Jul 10, 2023
fc8fbbe
bindings for taikol1
cyberhorsey Jul 11, 2023
eb0d9e3
Merge branch 'main' into alpha-4
cyberhorsey Jul 11, 2023
d27a746
bindings
cyberhorsey Jul 11, 2023
a3e6f03
Merge branch 'alpha-4' of github.com:taikoxyz/taiko-mono into alpha-4
cyberhorsey Jul 11, 2023
35053d2
id => blockid
cyberhorsey Jul 11, 2023
77649c5
chore(protocol): improve ProverPool docs coverage (#14163)
dionysuzx Jul 14, 2023
b782050
feat(protocol): update Alpha-4 network configs (#14169)
davidtaikocha Jul 14, 2023
84f963a
feat(protocol): apply slight reward penalty based on timing (#14164)
dantaik Jul 15, 2023
ce1b87e
feat(bridge-ui): Optional faucet (#14178)
cyberhorsey Jul 16, 2023
29ccc17
comment to force push
cyberhorsey Jul 16, 2023
5ccdbb0
Merge branch 'alpha-4' of github.com:taikoxyz/taiko-mono into alpha-4
cyberhorsey Jul 16, 2023
d0319d1
envvars fix for faucet
cyberhorsey Jul 16, 2023
a58db26
fix(protocol): Fix prover duplicate (#14184)
cyberhorsey Jul 17, 2023
586cb78
fix(bridge-ui): add chain icons (#14189)
jscriptcoder Jul 18, 2023
2305fc7
feat(protocol): Pos dashboard + eventindexer indexing all proverpool …
cyberhorsey Jul 18, 2023
e2600d2
feat(pos-dashboard): Dashboard improvements (#14215)
cyberhorsey Jul 20, 2023
fb40a00
.
cyberhorsey Jul 20, 2023
adaa62e
.
cyberhorsey Jul 20, 2023
49df1a6
rm
cyberhorsey Jul 20, 2023
d54e566
feat(protocol): bring back whitelisted proposer (#14212)
dantaik Jul 20, 2023
7279086
feat(protocol): NFT (ERC721/ERC1155) bridge (#14118)
adaki2004 Jul 23, 2023
838b5e4
Merge branch 'main' into alpha-4
dong77 Jul 23, 2023
cb53b1e
pull main
dong77 Jul 23, 2023
8b746a0
Update LibVaultUtils.sol
dong77 Jul 23, 2023
6363f6e
chore(protocol): do not check sender in bridge's receive function [te…
dantaik Jul 24, 2023
e10bee7
feat(eventindexer): speed up sync (#14258)
cyberhorsey Jul 23, 2023
aa5d03d
chore(website): remove ttko discord and combine node runner manual (#…
dionysuzx Jul 24, 2023
a4aeeee
feat(bridge-ui-v2): bridging ETH and ERC20 (#14225)
jscriptcoder Jul 24, 2023
e269dbf
Merge branch 'main' into alpha-4
dantaik Jul 24, 2023
fdd74ac
fix(repo): update pnpm lock file (#14270)
dionysuzx Jul 24, 2023
9affe9c
feat(eventindexer): Galxe liquidity adding (#14268)
cyberhorsey Jul 25, 2023
8cd932c
fix(protocol): fix issue in slash amount calc (#14272)
dantaik Jul 25, 2023
01a0ad0
feat(protocol): Fix generate genesis tests (#14275)
adaki2004 Jul 25, 2023
29006ea
feat(pos-dashboard): Prover pool update (#14278)
cyberhorsey Jul 25, 2023
013912f
refactor(protocol): add proofWindowMultiplier (#14269)
dantaik Jul 25, 2023
b83a418
feat(pos-dashboard): bump lockfile (#14297)
cyberhorsey Jul 27, 2023
e795a09
merge main
dong77 Jul 27, 2023
fc22d37
Update lefthook.yml
dong77 Jul 27, 2023
3edbe55
Rearrange releaseTokens and merge into 1 txn
adaki2004 Jul 28, 2023
5743097
Remove releasedMsg and unnecessary comments
adaki2004 Jul 28, 2023
570ae10
Merge branch 'main' into alpha-4
cyberhorsey Jul 28, 2023
4b23d14
feat(protocol): decouple proof(s) verification from core protocol (#1…
adaki2004 Jul 29, 2023
7beb4fe
Merge branch 'alpha-4' into one_txn_token_and_eth_release
adaki2004 Jul 31, 2023
bd14dec
Move mock-proof workardound (for tests) into separate files
adaki2004 Jul 31, 2023
cd6b960
Add missing test deps
adaki2004 Jul 31, 2023
b339374
Remove enum/int recall message status
adaki2004 Jul 31, 2023
b4ade2e
remove comment section
adaki2004 Jul 31, 2023
3bd031e
fix(bridge-ui): alpha 4 fix bridge UI - TS errors (#14322)
jscriptcoder Jul 31, 2023
b9f3bda
feat(protocol): update `DeployOnL1` script for `ProofVerifier` (#14325)
davidtaikocha Jul 31, 2023
45549b8
Merge branch 'main' into alpha-4
davidtaikocha Jul 31, 2023
303d88d
Revert "remove comment section"
adaki2004 Aug 1, 2023
b70e686
Revert "Remove enum/int recall message status"
adaki2004 Aug 1, 2023
bf3bf66
Vault route logic
adaki2004 Aug 1, 2023
9661ddc
Merge branch 'main' into alpha-4
dantaik Aug 2, 2023
4d88957
Merge branch 'alpha-4' into one_txn_token_and_eth_release
dantaik Aug 2, 2023
333e39c
Discussed improvements
adaki2004 Aug 2, 2023
2e1ee3c
Fix failing test
adaki2004 Aug 2, 2023
c6cbc98
Remove unnecessary reentrancy
adaki2004 Aug 2, 2023
4a78b6b
feat(bridge-ui-v2): Fixed input validations and catching additional e…
KorbinianK Aug 2, 2023
ad7e9a0
Reduce code size part 1.
adaki2004 Aug 2, 2023
ec4c7a1
Merge branch 'alpha-4' into one_txn_token_and_eth_release
dantaik Aug 2, 2023
9f80603
Code size optimizations
adaki2004 Aug 2, 2023
8799400
Findings
adaki2004 Aug 2, 2023
7b239b6
remove unused mock
adaki2004 Aug 2, 2023
e82deba
feat(protocol): add `blockId` to `Slashed` event (#14357)
davidtaikocha Aug 3, 2023
1f2d4bc
Merge branch 'main' into alpha-4
davidtaikocha Aug 3, 2023
42bbc5f
feat(protocol): Fix failing unit test (#14358)
adaki2004 Aug 3, 2023
bb461e7
Add mock LibBridgeRecall (to mock proof)
adaki2004 Aug 3, 2023
340d245
lint + optimizer setting
adaki2004 Aug 3, 2023
78a2a2e
linitng warnings
adaki2004 Aug 3, 2023
b67ae99
lint warning
adaki2004 Aug 3, 2023
4bd85a3
add back github workflow
adaki2004 Aug 3, 2023
8377a80
Add auto-generated contract documentation
adaki2004 Aug 3, 2023
b21be79
Merge branch 'alpha-4' into one_txn_token_and_eth_release
dantaik Aug 3, 2023
4a8591d
improvements
adaki2004 Aug 3, 2023
7f3e524
Removed supportsInterface where not necessary
adaki2004 Aug 4, 2023
22ddab9
Discussed changes
adaki2004 Aug 4, 2023
3d46d9a
Merge branch 'main' into one_txn_token_and_eth_release
adaki2004 Aug 4, 2023
d0db12a
Merge branch 'main' into one_txn_token_and_eth_release
dantaik Aug 9, 2023
f70d767
feat(protocol): optimize bridge with removal of depositValue (#14383)
dantaik Aug 9, 2023
4660ec9
Merge branch 'main' into one_txn_token_and_eth_release
dantaik Aug 9, 2023
e23c86e
improve comments
dantaik Aug 9, 2023
1f41d77
Merge branch 'main' into one_txn_token_and_eth_release
dantaik Aug 9, 2023
378feec
fix(protocol): fix vault sending ether and improve comments (#14427)
dantaik Aug 11, 2023
e7afabb
Merge branch 'main' into one_txn_token_and_eth_release
dantaik Aug 11, 2023
143e585
Merge branch 'main' into one_txn_token_and_eth_release
dantaik Aug 11, 2023
6eb7f98
Merge branch 'main' into one_txn_token_and_eth_release
dantaik Aug 11, 2023
0381d7a
Modified bridge readme
adaki2004 Aug 11, 2023
3dea1c1
Merge branch 'main' into one_txn_token_and_eth_release
cyberhorsey Aug 11, 2023
8250784
feat(relayer): Bridge relayer updates (#14461)
cyberhorsey Aug 12, 2023
0e6fe65
improve comments
dantaik Aug 9, 2023
f7cc97e
fix(bridge-ui): return true if the token address is found on dest cha…
cyberhorsey Aug 12, 2023
5e9faa7
docs(protocol): cleanup protocol docs (#14462)
dionysuzx Aug 12, 2023
7e21e28
resolve conflicts
dantaik Aug 12, 2023
6c54371
fmt
dantaik Aug 12, 2023
23bf430
improve comments
dantaik Aug 12, 2023
39f29c2
Update EtherVault.sol
dantaik Aug 12, 2023
0691ba8
Merge branch 'main' into one_txn_token_and_eth_release
dantaik Aug 12, 2023
d801475
update comments (#14469)
dantaik Aug 13, 2023
7e7b951
Update ERC721Vault.sol
dantaik Aug 14, 2023
78f2cdb
fix(protocol): fix vault bugs in sending Ether (#14471)
dantaik Aug 14, 2023
f28b222
feat(protocol): Add tests to send ether with other token types (#14486)
adaki2004 Aug 14, 2023
b2ff009
Merge branch 'main' into one_txn_token_and_eth_release
cyberhorsey Aug 14, 2023
3301f1b
feat(protocol): change protocol data layout to enable coverage report…
adaki2004 Aug 16, 2023
3d12e57
Merge branch 'main' into one_txn_token_and_eth_release
dantaik Aug 17, 2023
43b582c
Merge branch 'main' into one_txn_token_and_eth_release
dionysuzx Aug 17, 2023
ab00d40
Merge branch 'main' into one_txn_token_and_eth_release
dantaik Aug 19, 2023
a160237
Merge branch 'main' into one_txn_token_and_eth_release
dantaik Aug 20, 2023
6dbe8c8
fix(protocol): LibBridgeRetry fix (#14577)
adaki2004 Aug 25, 2023
81d9ac0
Merge branch 'main' into one_txn_token_and_eth_release
dantaik Aug 26, 2023
001b722
feat(protocol): simplify protocol and remove prover pool from core pr…
dantaik Aug 27, 2023
f6ec18d
Merge branch 'main' into one_txn_token_and_eth_release
dantaik Aug 27, 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
2 changes: 1 addition & 1 deletion packages/protocol/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
- **protocol:** add parentGasUsed to blockproven ([#13704](https://github.com/taikoxyz/taiko-mono/issues/13704)) ([2ce8787](https://github.com/taikoxyz/taiko-mono/commit/2ce8787b66537dd6142a040b223bd1f4d8b19f89))
- **protocol:** add TaikoGovernor and improve TaikoToken ([#13711](https://github.com/taikoxyz/taiko-mono/issues/13711)) ([ad75cd5](https://github.com/taikoxyz/taiko-mono/commit/ad75cd5476d10886b337c8da2e95a2c5ea043a57))
- **protocol:** Change back token decimals ([#13707](https://github.com/taikoxyz/taiko-mono/issues/13707)) ([82f1677](https://github.com/taikoxyz/taiko-mono/commit/82f1677b18c8dd90f2afc3fcefe5f60a9d8df670))
- **protocol:** Introduce oracle and system prover concept ([#13729](https://github.com/taikoxyz/taiko-mono/issues/13729)) ([e8ba716](https://github.com/taikoxyz/taiko-mono/commit/e8ba7168231f9a8bbef1378fa93448b11c4267ac))
- **protocol:** Introduce oracle prover concept ([#13729](https://github.com/taikoxyz/taiko-mono/issues/13729)) ([e8ba716](https://github.com/taikoxyz/taiko-mono/commit/e8ba7168231f9a8bbef1378fa93448b11c4267ac))
- **protocol:** L2/L3 contracts proxied ([#13725](https://github.com/taikoxyz/taiko-mono/issues/13725)) ([7e6291f](https://github.com/taikoxyz/taiko-mono/commit/7e6291f3be215789759d5d36e2451fab3154979f))
- **protocol:** major protocol upgrade for alpha-3 testnet ([#13640](https://github.com/taikoxyz/taiko-mono/issues/13640)) ([02552f2](https://github.com/taikoxyz/taiko-mono/commit/02552f2aa001893d326062ce627004c61b46cd26))
- **protocol:** make sure system proof delay is proofTimeTarget ([#13742](https://github.com/taikoxyz/taiko-mono/issues/13742)) ([c359dd9](https://github.com/taikoxyz/taiko-mono/commit/c359dd9c39657ca4deac23d8cd7765a5ae58e8f3))
Expand Down
4 changes: 2 additions & 2 deletions packages/protocol/contracts/L1/IProofVerifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ interface IProofVerifier {
/// @param blockId Unique identifier for the block.
/// @param blockProofs Raw bytes representing the proof(s).
/// @param instance Hashed evidence & config data. If set to zero, proof is
/// assumed to be from oracle/system prover.
/// assumed to be from oracle prover.
function verifyProofs(
uint256 blockId,
uint64 blockId,
bytes calldata blockProofs,
bytes32 instance
)
Expand Down
28 changes: 28 additions & 0 deletions packages/protocol/contracts/L1/IProver.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// SPDX-License-Identifier: MIT
// _____ _ _ _ _
// |_ _|_ _(_) |_____ | | __ _| |__ ___
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-<
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/

pragma solidity ^0.8.20;

import { TaikoData } from "./TaikoData.sol";

/// @title IProver Interface
/// @notice Defines the function that handle prover assignment.
interface IProver {
/// @notice Assigns a prover to a specific block or reverts if this prover
/// is not available.
/// @param blockId The ID of the proposed block. Note that the ID is only
/// known when the block is proposed, therefore, it should not be used for
/// verifying prover authorization.
/// @param input The block's BlockMetadataInput data.
/// @param assignment The assignment to evaluate
function onBlockAssigned(
uint64 blockId,
TaikoData.BlockMetadataInput calldata input,
TaikoData.ProverAssignment calldata assignment
)
external
payable;
}
41 changes: 0 additions & 41 deletions packages/protocol/contracts/L1/IProverPool.sol

This file was deleted.

43 changes: 22 additions & 21 deletions packages/protocol/contracts/L1/ProofVerifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ pragma solidity ^0.8.20;

import { AddressResolver } from "../common/AddressResolver.sol";
import { EssentialContract } from "../common/EssentialContract.sol";
import { Proxied } from "../common/Proxied.sol";
import { LibZKPVerifier } from "./libs/verifiers/LibZKPVerifier.sol";
import { IProofVerifier } from "./IProofVerifier.sol";
import { LibBytesUtils } from "../thirdparty/LibBytesUtils.sol";
import { LibZKPVerifier } from "./libs/verifiers/LibZKPVerifier.sol";
import { Proxied } from "../common/Proxied.sol";

/// @title ProofVerifier
/// @notice See the documentation in {IProofVerifier}.
Expand All @@ -30,35 +30,36 @@ contract ProofVerifier is EssentialContract, IProofVerifier {
function verifyProofs(
// blockId is unused now, but can be used later when supporting
// different types of proofs.
uint256,
uint64,
bytes calldata blockProofs,
bytes32 instance
)
external
view
{
// If instance is zero, proof is considered as from oracle/system prover
// If instance is zero, proof is considered as from oracle prover
// and not checked.
if (instance == 0) return;

// Validate the instance using bytes utilities.
if (
!LibBytesUtils.equal(
LibBytesUtils.slice(blockProofs, 2, 32),
bytes.concat(bytes16(0), bytes16(instance))
)
) {
revert L1_INVALID_PROOF();
}
// TODO(david & yue): we need to fix the code below
// if (
// !LibBytesUtils.equal(
// LibBytesUtils.slice(blockProofs, 2, 32),
// bytes.concat(bytes16(0), bytes16(instance))
// )
// ) {
// revert L1_INVALID_PROOF();
// }

if (
!LibBytesUtils.equal(
LibBytesUtils.slice(blockProofs, 34, 32),
bytes.concat(bytes16(0), bytes16(uint128(uint256(instance))))
)
) {
revert L1_INVALID_PROOF();
}
// if (
// !LibBytesUtils.equal(
// LibBytesUtils.slice(blockProofs, 34, 32),
// bytes.concat(bytes16(0), bytes16(uint128(uint256(instance))))
// )
// ) {
// revert L1_INVALID_PROOF();
// }

// Extract verifier ID from the proof.
uint16 verifierId = uint16(bytes2(blockProofs[0:2]));
Expand All @@ -71,5 +72,5 @@ contract ProofVerifier is EssentialContract, IProofVerifier {
}

/// @title ProxiedProofVerifier
/// @notice Proxied version of the ProofVerifier contract.
/// @notice Proxied version of the parent contract.
contract ProxiedProofVerifier is Proxied, ProofVerifier { }
Loading