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): major protocol upgrade #13389

Merged
merged 53 commits into from
Apr 23, 2023
Merged
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
6f69132
feat(protocol): major protocol upgrade (#13254)
dantaik Mar 22, 2023
53bfe07
refactor
dantaik Mar 22, 2023
6a13380
Delete .gas-snapshot
dantaik Mar 22, 2023
177f41b
refactor(protocol): check if amount > 0 inside sendEther (#13390)
dantaik Mar 23, 2023
59cd9fa
Update packages/protocol/contracts/L2/TaikoL2.sol
dantaik Mar 23, 2023
6138b1f
refactor(protocol): address some comments from Brecht and Dani (#13428)
dantaik Mar 23, 2023
4ddbd9b
feat(protocol): make gasUsed of L2 blocks available on L1 (#13440)
dantaik Mar 24, 2023
0b8f7fe
refactor(protocol): various changes based on Brecht & Dani's feedback…
dantaik Mar 24, 2023
7b912ee
fix(protocol): allow deposit Ether to any address on L2 (#13426)
dantaik Mar 24, 2023
7c0dbcd
feat(protocol): instead of revert, emit a special event for conflicti…
dantaik Mar 25, 2023
85acf33
refactor(protocol): change TaikoToken's decimals from 18 to 8 (#13443)
dantaik Mar 25, 2023
e7cc30b
refactor(protocol): various small improvements (#13459)
dantaik Mar 27, 2023
0fc5ef6
feat(protocol): change time-based fee/reward calculation (#13442)
dantaik Mar 28, 2023
0e803e2
feat(protocol): add foundry deployment scripts (#13447)
dantaik Mar 29, 2023
935ba36
feat(protocol): enable graffiti for provers (#13512)
dong77 Mar 31, 2023
f91185b
refactor(protocol): remove prefix in hashMessage() (#13510)
dantaik Apr 2, 2023
fb1721b
Update packages/protocol/contracts/L1/libs/LibVerifying.sol
davidtaikocha Apr 2, 2023
7edd5ff
fix
dantaik Apr 5, 2023
e5509ac
fix
dantaik Apr 5, 2023
b467bef
feat(protocol): enable EIP-1559 for L2 (#13501)
dantaik Apr 5, 2023
112c45b
fix
dantaik Apr 5, 2023
d9d8d27
Update packages/protocol/contracts/L1/TaikoData.sol
dantaik Apr 5, 2023
887008b
cleanup
dantaik Apr 5, 2023
ac52f45
more
dantaik Apr 5, 2023
e5251dd
more
dantaik Apr 5, 2023
2efac0e
Merge branch 'main' into major_protocol_upgrade_rebase
davidtaikocha Apr 5, 2023
39d66e5
recommend changes
dantaik Apr 6, 2023
6af8a92
chore(protocol): update L1 deployment script to set treasure address …
davidtaikocha Apr 6, 2023
0509218
feat(protocol): refactor L2 genesis generation scripts / tests by fou…
davidtaikocha Apr 6, 2023
15523af
chore(protocol): update `test:foundry` npm script (#13561)
davidtaikocha Apr 6, 2023
2bad518
refactor(protocol): optimize keyForName (#13557)
dantaik Apr 6, 2023
702ddd8
resolve
dantaik Apr 6, 2023
f2ef668
refactor(protocol): split oracle proving into a function (#13552)
dong77 Apr 6, 2023
31fcaf3
feat(protocol): make parentGasUsed verifiable on L2 (#13560)
dantaik Apr 7, 2023
b3974ad
test(protocol): add a test to calculate and verify 1559 params for al…
dantaik Apr 7, 2023
624a4b5
Merge branch 'main' into major_protocol_upgrade_rebase
dionysuzx Apr 7, 2023
c40dbb3
test(protocol): add a fuzz test with a lot of blocks (#13543)
dantaik Apr 8, 2023
3b7469a
feat(protocol): allow multiple Taiko deployments to sync signals (#13…
dantaik Apr 8, 2023
670a85c
refactor(protocol): optimize proveBlock gas cost (#13571)
dantaik Apr 8, 2023
c6605db
Merge branch 'main' into major_protocol_upgrade_rebase
dantaik Apr 8, 2023
e8689cb
feat(protocol): update `TaikoL2.getBasefee` parameters (#13570)
davidtaikocha Apr 8, 2023
e18bf92
refactor(protocol): minor cleanup (#13578)
dantaik Apr 10, 2023
91cf930
refactor(protocol): minor optimize signal service merkle proof (#13579)
dantaik Apr 18, 2023
6095326
test(protocol): EtherVault tests in Foundry (#13625)
cyberhorsey Apr 20, 2023
4f15527
test(protocol): Token vault foundry tests (#13627)
cyberhorsey Apr 20, 2023
60eb6d9
feat(protocol): Calculate fee/reward based on proof time w/ 1559 math…
adaki2004 Apr 22, 2023
32d1df0
feat(protocol): enable ETH deposit from L1 to L2 using withdrawalsRoo…
dantaik Apr 22, 2023
c627df8
test(protocol): Bridge foundry tests (#13634)
cyberhorsey Apr 22, 2023
f55bd27
feat(protocol): allow proof cooldown period [2] (#13597)
dantaik Apr 23, 2023
796ddc4
refactor(protocol): optimize proving logics [3] (#13611)
dantaik Apr 23, 2023
7e2e1ad
test(protocol): Signal service foundry tests (#13632)
cyberhorsey Apr 23, 2023
913f17f
Update package.json
dantaik Apr 23, 2023
7f84e77
Merge branch 'main' into major_protocol_upgrade_rebase
dantaik Apr 23, 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
feat(protocol): update TaikoL2.getBasefee parameters (#13570)
Co-authored-by: Daniel Wang <99078276+dantaik@users.noreply.github.com>
davidtaikocha and dantaik authored Apr 8, 2023
commit e8689cb67671f269de0a60bc99a0b76ebc5f565a
6 changes: 1 addition & 5 deletions packages/protocol/contracts/L2/TaikoL2.sol
Original file line number Diff line number Diff line change
@@ -215,14 +215,10 @@ contract TaikoL2 is EssentialContract, TaikoL2Signer, IXchainSync {
**********************/

function getBasefee(
uint32 timeSinceNow,
uint32 timeSinceParent,
uint64 gasLimit,
uint64 parentGasUsed
) public view returns (uint256 _basefee) {
uint256 timeSinceParent;
unchecked {
timeSinceParent = timeSinceNow + block.timestamp - parentTimestamp;
}
(_basefee, ) = _calcBasefee(timeSinceParent, gasLimit, parentGasUsed);
}

33 changes: 16 additions & 17 deletions packages/protocol/test2/TaikoL2.t.sol
Original file line number Diff line number Diff line change
@@ -132,27 +132,26 @@ contract TestTaikoL2 is Test {
}

function testGetBasefee() external {
assertEq(_getBasefeeAndPrint(0, 0, 0), 317609019);
assertEq(_getBasefeeAndPrint(0, 1, 0), 317609019);
assertEq(_getBasefeeAndPrint(0, 1000000, 0), 320423332);
assertEq(_getBasefeeAndPrint(0, 5000000, 0), 332018053);
assertEq(_getBasefeeAndPrint(0, 10000000, 0), 347305199);

assertEq(_getBasefeeAndPrint(100, 0, 0), 54544902);
assertEq(_getBasefeeAndPrint(100, 1, 0), 54544902);
assertEq(_getBasefeeAndPrint(100, 1000000, 0), 55028221);
assertEq(_getBasefeeAndPrint(100, 5000000, 0), 57019452);
assertEq(_getBasefeeAndPrint(100, 10000000, 0), 59644805);
uint32 timeSinceParent = uint32(block.timestamp - L2.parentTimestamp());
assertEq(_getBasefeeAndPrint(timeSinceParent, 0, 0), 317609019);
assertEq(_getBasefeeAndPrint(timeSinceParent, 1, 0), 317609019);
assertEq(_getBasefeeAndPrint(timeSinceParent, 1000000, 0), 320423332);
assertEq(_getBasefeeAndPrint(timeSinceParent, 5000000, 0), 332018053);
assertEq(_getBasefeeAndPrint(timeSinceParent, 10000000, 0), 347305199);

timeSinceParent = uint32(100 + block.timestamp - L2.parentTimestamp());
assertEq(_getBasefeeAndPrint(timeSinceParent, 0, 0), 54544902);
assertEq(_getBasefeeAndPrint(timeSinceParent, 1, 0), 54544902);
assertEq(_getBasefeeAndPrint(timeSinceParent, 1000000, 0), 55028221);
assertEq(_getBasefeeAndPrint(timeSinceParent, 5000000, 0), 57019452);
assertEq(_getBasefeeAndPrint(timeSinceParent, 10000000, 0), 59644805);
}

function _getBasefeeAndPrint(
uint32 timeSinceNow,
uint32 timeSinceParent,
uint64 gasLimit,
uint64 parentGasUsed
) private returns (uint256 _basefee) {
uint256 timeSinceParent = timeSinceNow +
block.timestamp -
L2.parentTimestamp();
uint256 gasIssued = L2.gasIssuedPerSecond() * timeSinceParent;
string memory _msg = string.concat(
"#",
@@ -168,7 +167,7 @@ contract TestTaikoL2 is Test {
", parentGasUsed=",
Strings.toString(parentGasUsed)
);
_basefee = L2.getBasefee(timeSinceNow, gasLimit, parentGasUsed);
_basefee = L2.getBasefee(timeSinceParent, gasLimit, parentGasUsed);

_msg = string.concat(
_msg,
@@ -187,7 +186,7 @@ contract TestTaikoL2 is Test {
) private returns (uint256 _basefee) {
return
_getBasefeeAndPrint(
timeSinceNow,
uint32(timeSinceNow + block.timestamp - L2.parentTimestamp()),
gasLimit,
gasLimit + ANCHOR_GAS_COST
);
2 changes: 1 addition & 1 deletion packages/protocol/test2/genesis/GenerateGenesis.g.sol
Original file line number Diff line number Diff line change
@@ -66,7 +66,7 @@ contract TestGenerateGenesis is Test, AddressResolver {
vm.warp(taikoL2.parentTimestamp() + 12);
vm.fee(
taikoL2.getBasefee(
0,
12,
BLOCK_GAS_LIMIT,
i + LibL2Consts.ANCHOR_GAS_COST
)