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 146 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/contracts/L1/ProofVerifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,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 { }
17 changes: 4 additions & 13 deletions packages/protocol/contracts/L1/ProverPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,7 @@ contract ProverPool is EssentialContract, IProverPool {
EssentialContract._init(_addressManager);
}

/// @notice Protocol specifies the current feePerGas and assigns a prover to
/// a block.
/// @param blockId The block id.
/// @param feePerGas The current fee per gas.
/// @return prover The address of the assigned prover.
/// @return rewardPerGas The reward per gas for the assigned prover.
/// @inheritdoc IProverPool
function assignProver(
uint64 blockId,
uint32 feePerGas
Expand Down Expand Up @@ -116,8 +111,7 @@ contract ProverPool is EssentialContract, IProverPool {
}
}

/// @notice Increases the capacity of the prover by releasing a prover.
/// @param addr The address of the prover to release.
/// @inheritdoc IProverPool
function releaseProver(address addr) external onlyFromProtocol {
(Staker memory staker, Prover memory prover) = getStaker(addr);

Expand All @@ -129,10 +123,7 @@ contract ProverPool is EssentialContract, IProverPool {
}
}

/// @notice Slashes a prover.
/// @param addr The address of the prover to slash.
/// @param blockId The block id of the block which was not proved in time.
/// @param proofReward The reward that was set for the block's proof.
/// @inheritdoc IProverPool
function slashProver(
uint64 blockId,
address addr,
Expand Down Expand Up @@ -473,5 +464,5 @@ contract ProverPool is EssentialContract, IProverPool {
}

/// @title ProxiedProverPool
/// @notice Proxied version of the ProverPool contract.
/// @notice Proxied version of the parent contract.
contract ProxiedProverPool is Proxied, ProverPool { }
47 changes: 32 additions & 15 deletions packages/protocol/contracts/L1/TaikoData.sol
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,33 @@ library TaikoData {
uint64 id;
}

/// @dev Forge is only able to run coverage in case the contracts by default
/// capable of compiling without any optimization (neither optimizer runs,
/// no compiling --via-ir flag).
/// In order to resolve stack too deep without optimizations, we needed to
/// introduce outsourcing vars into structs below.
struct SlotA {
uint64 genesisHeight;
uint64 genesisTimestamp;
uint64 __reserved70;
uint64 __reserved71;
}

struct SlotB {
uint64 numOpenBlocks;
uint64 numEthDeposits;
uint64 numBlocks;
uint64 nextEthDepositToProcess;
}

struct SlotC {
uint64 lastVerifiedAt;
uint64 lastVerifiedBlockId;
uint64 __reserved90;
uint32 feePerGas;
uint16 avgProofDelay;
}

/// @dev Struct holding the state variables for the {TaikoL1} contract.
struct State {
// Ring buffer for proposed blocks and a some recent verified blocks.
Expand All @@ -198,22 +225,12 @@ library TaikoData {
mapping(uint256 depositId_mode_ethDepositRingBufferSize => uint256)
ethDeposits;
mapping(address account => uint256 balance) taikoTokenBalances;
// Slot 7: never or rarely changed
uint64 genesisHeight;
uint64 genesisTimestamp;
uint64 __reserved70;
uint64 __reserved71;
// Slot 6: never or rarely changed
SlotA slotA;
// Slot 7
SlotB slotB;
// Slot 8
uint64 numOpenBlocks;
uint64 numEthDeposits;
uint64 numBlocks;
uint64 nextEthDepositToProcess;
// Slot 9
uint64 lastVerifiedAt;
uint64 lastVerifiedBlockId;
uint64 __reserved90;
uint32 feePerGas;
uint16 avgProofDelay;
SlotC slotC;
// Reserved
uint256[42] __gap;
}
Expand Down
36 changes: 18 additions & 18 deletions packages/protocol/contracts/L1/TaikoL1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ contract TaikoL1 is
depositEtherToL2(address(0));
}

/// @notice Initialize the rollup.
/// @notice Initializes the rollup.
/// @param _addressManager The {AddressManager} address.
/// @param _genesisBlockHash The block hash of the genesis block.
/// @param _initFeePerGas Initial (reasonable) block fee value.
Expand All @@ -68,7 +68,7 @@ contract TaikoL1 is
});
}

/// @notice Propose a Taiko L2 block.
/// @notice Proposes a Taiko L2 block.
/// @param input An abi-encoded BlockMetadataInput that the actual L2 block
/// header must satisfy.
/// @param txList A list of transactions in this block, encoded with RLP.
Expand Down Expand Up @@ -102,7 +102,7 @@ contract TaikoL1 is
}
}

/// @notice Prove a block with a zero-knowledge proof.
/// @notice Proves a block with a zero-knowledge proof.
/// @param blockId The index of the block to prove. This is also used to
/// select the right implementation version.
/// @param input An abi-encoded {TaikoData.BlockEvidence} object.
Expand Down Expand Up @@ -131,7 +131,7 @@ contract TaikoL1 is
}
}

/// @notice Verify up to N blocks.
/// @notice Verifies up to N blocks.
/// @param maxBlocks Max number of blocks to verify.
function verifyBlocks(uint256 maxBlocks) external nonReentrant {
if (maxBlocks == 0) revert L1_INVALID_PARAM();
Expand All @@ -143,7 +143,7 @@ contract TaikoL1 is
});
}

/// @notice Deposit Ether to Layer 2.
/// @notice Deposits Ether to Layer 2.
/// @param recipient Address of the recipient for the deposited Ether on
/// Layer 2.
function depositEtherToL2(address recipient) public payable {
Expand All @@ -155,19 +155,19 @@ contract TaikoL1 is
});
}

/// @notice Deposit Taiko tokens to the contract.
/// @notice Deposits Taiko tokens to the contract.
/// @param amount Amount of Taiko tokens to deposit.
function depositTaikoToken(uint256 amount) public nonReentrant {
LibTaikoToken.depositTaikoToken(state, AddressResolver(this), amount);
}

/// @notice Withdraw Taiko tokens from the contract.
/// @notice Withdraws Taiko tokens from the contract.
/// @param amount Amount of Taiko tokens to withdraw.
function withdrawTaikoToken(uint256 amount) public nonReentrant {
LibTaikoToken.withdrawTaikoToken(state, AddressResolver(this), amount);
}

/// @notice Check if Ether deposit is allowed for Layer 2.
/// @notice Checks if Ether deposit is allowed for Layer 2.
/// @param amount Amount of Ether to be deposited.
/// @return true if Ether deposit is allowed, false otherwise.
function canDepositEthToL2(uint256 amount) public view returns (bool) {
Expand All @@ -178,7 +178,7 @@ contract TaikoL1 is
});
}

/// @notice Get the block fee for a given gas limit.
/// @notice Gets the block fee for a given gas limit.
/// @param gasLimit Gas limit for the block.
/// @return The block fee in Taiko tokens.
function getBlockFee(uint32 gasLimit) public view returns (uint64) {
Expand All @@ -189,14 +189,14 @@ contract TaikoL1 is
});
}

/// @notice Get the Taiko token balance for a specific address.
/// @notice Gets the Taiko token balance for a specific address.
/// @param addr Address to check the Taiko token balance.
/// @return The Taiko token balance of the address.
function getTaikoTokenBalance(address addr) public view returns (uint256) {
return state.taikoTokenBalances[addr];
}

/// @notice Get the details of a block.
/// @notice Gets the details of a block.
/// @param blockId Index of the block.
/// @return _metaHash Metadata hash of the block.
/// @return _gasLimit Gas limit of the block.
Expand Down Expand Up @@ -245,7 +245,7 @@ contract TaikoL1 is
_proofWindow = blk.proofWindow;
}

/// @notice Get the fork choice for a specific block.
/// @notice Gets the fork choice for a specific block.
/// @param blockId Index of the block.
/// @param parentHash Parent hash of the block.
/// @param parentGasUsed Gas used by the parent block.
Expand All @@ -268,7 +268,7 @@ contract TaikoL1 is
});
}

/// @notice Get the block hash of the specified Layer 2 block.
/// @notice Gets the block hash of the specified Layer 2 block.
/// @param blockId Index of the block.
/// @return Block hash of the specified block.
function getCrossChainBlockHash(uint256 blockId)
Expand All @@ -287,7 +287,7 @@ contract TaikoL1 is
: bytes32(0);
}

/// @notice Get the signal root of the specified Layer 2 block.
/// @notice Gets the signal root of the specified Layer 2 block.
/// @param blockId Index of the block.
/// @return Signal root of the specified block.
function getCrossChainSignalRoot(uint256 blockId)
Expand All @@ -307,7 +307,7 @@ contract TaikoL1 is
: bytes32(0);
}

/// @notice Get the state variables of the TaikoL1 contract.
/// @notice Gets the state variables of the TaikoL1 contract.
/// @return StateVariables struct containing state variables.
function getStateVariables()
public
Expand All @@ -317,7 +317,7 @@ contract TaikoL1 is
return state.getStateVariables();
}

/// @notice Get the configuration of the TaikoL1 contract.
/// @notice Gets the configuration of the TaikoL1 contract.
/// @return Config struct containing configuration parameters.
function getConfig()
public
Expand All @@ -328,7 +328,7 @@ contract TaikoL1 is
return TaikoConfig.getConfig();
}

/// @notice Get the name of the proof verifier by ID.
/// @notice Gets the name of the proof verifier by ID.
/// @param id ID of the verifier.
/// @return Verifier name.
function getVerifierName(uint16 id) public pure returns (bytes32) {
Expand All @@ -337,5 +337,5 @@ contract TaikoL1 is
}

/// @title TaikoL1
/// @notice Proxied version of the TaikoL1 contract.
/// @notice Proxied version of the parent contract.
contract ProxiedTaikoL1 is Proxied, TaikoL1 { }
8 changes: 0 additions & 8 deletions packages/protocol/contracts/L1/TaikoToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ contract TaikoToken is
error TKO_INVALID_PREMINT_PARAMS();
error TKO_MINT_DISALLOWED();

/*//////////////////////////////////////////////////////////////
USER-FACING FUNCTIONS
//////////////////////////////////////////////////////////////*/

/// @notice Initializes the TaikoToken contract and mints initial tokens to
/// specified recipients.
/// @param _addressManager The {AddressManager} address.
Expand Down Expand Up @@ -163,10 +159,6 @@ contract TaikoToken is
return LibTaikoTokenConfig.DECIMALS;
}

/*//////////////////////////////////////////////////////////////
INTERNAL FUNCTIONS
//////////////////////////////////////////////////////////////*/

function _beforeTokenTransfer(
address from,
address to,
Expand Down
19 changes: 10 additions & 9 deletions packages/protocol/contracts/L1/libs/LibEthDepositing.sol
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,20 @@ library LibEthDepositing {

// Append the deposit to the queue.
address _recipient = recipient == address(0) ? msg.sender : recipient;
uint256 slot = state.numEthDeposits % config.ethDepositRingBufferSize;
uint256 slot =
state.slotB.numEthDeposits % config.ethDepositRingBufferSize;
state.ethDeposits[slot] = _encodeEthDeposit(_recipient, msg.value);

emit EthDeposited(
TaikoData.EthDeposit({
recipient: _recipient,
amount: uint96(msg.value),
id: state.numEthDeposits
id: state.slotB.numEthDeposits
})
);

unchecked {
state.numEthDeposits++;
state.slotB.numEthDeposits++;
}
}

Expand All @@ -77,7 +78,7 @@ library LibEthDepositing {
{
// Calculate the number of pending deposits.
uint256 numPending =
state.numEthDeposits - state.nextEthDepositToProcess;
state.slotB.numEthDeposits - state.slotB.nextEthDepositToProcess;

if (numPending < config.ethDepositMinCountPerBlock) {
deposits = new TaikoData.EthDeposit[](0);
Expand All @@ -90,7 +91,7 @@ library LibEthDepositing {
block.basefee * config.ethDepositGas
)
);
uint64 j = state.nextEthDepositToProcess;
uint64 j = state.slotB.nextEthDepositToProcess;
uint96 totalFee;
for (uint256 i; i < deposits.length;) {
uint256 data =
Expand All @@ -109,13 +110,13 @@ library LibEthDepositing {
++j;
}
}
state.nextEthDepositToProcess = j;
state.slotB.nextEthDepositToProcess = j;
// This is the fee deposit
state.ethDeposits[state.numEthDeposits
state.ethDeposits[state.slotB.numEthDeposits
% config.ethDepositRingBufferSize] =
_encodeEthDeposit(feeRecipient, totalFee);
unchecked {
state.numEthDeposits++;
state.slotB.numEthDeposits++;
}
}
}
Expand All @@ -137,7 +138,7 @@ library LibEthDepositing {
unchecked {
return amount >= config.ethDepositMinAmount
&& amount <= config.ethDepositMaxAmount
&& state.numEthDeposits - state.nextEthDepositToProcess
&& state.slotB.numEthDeposits - state.slotB.nextEthDepositToProcess
< config.ethDepositRingBufferSize - 1;
}
}
Expand Down
Loading
Loading