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): Calculate fee/reward based on proof time w/ 1559 math #13489

Merged
merged 101 commits into from
Apr 22, 2023
Merged
Changes from 1 commit
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
167d957
change timebased fee calculation
dantaik Mar 24, 2023
c693da5
change timebased fee calculation
dantaik Mar 24, 2023
749c63f
change timebased fee calculation
dantaik Mar 24, 2023
d0c5c5a
Merge branch 'major_protocol_upgrade_rebase' into fee_reward_fix
dantaik Mar 24, 2023
d2cd0d5
Merge branch 'major_protocol_upgrade_rebase' into fee_reward_fix
dantaik Mar 24, 2023
ae82406
Merge branch 'major_protocol_upgrade_rebase' into fee_reward_fix
dantaik Mar 25, 2023
699a045
rename
dantaik Mar 26, 2023
fc5863f
Merge branch 'major_protocol_upgrade_rebase' into fee_reward_fix
dantaik Mar 27, 2023
975b057
rename
dantaik Mar 27, 2023
0e6242c
rename
dantaik Mar 27, 2023
b256bc1
implement 1559 for L2
dantaik Mar 27, 2023
0725c7a
implement 1559 for L2
dantaik Mar 27, 2023
ccec538
implement 1559 for L2
dantaik Mar 27, 2023
4f0162e
implement 1559 for L2
dantaik Mar 27, 2023
64548f0
implement 1559 for L2
dantaik Mar 27, 2023
c85f74e
implement 1559 for L2
dantaik Mar 27, 2023
c10f480
more
dantaik Mar 27, 2023
bafe0eb
fix tests
dantaik Mar 27, 2023
8ff0da3
fix tests
dantaik Mar 27, 2023
8a22c88
fix tests
dantaik Mar 27, 2023
b161046
fix tests
dantaik Mar 27, 2023
ca8dec2
fix tests
dantaik Mar 27, 2023
cd4605d
fix tests
dantaik Mar 27, 2023
467d1ad
fix tests
dantaik Mar 27, 2023
dcd55ec
fix tests
dantaik Mar 27, 2023
ec38ef3
fix tests
dantaik Mar 27, 2023
a48a6b7
fix tests
dantaik Mar 27, 2023
51df62e
fix tests
dantaik Mar 27, 2023
9010aea
fix tests
dantaik Mar 27, 2023
269896b
Merge branch 'fee_reward_fix' into L2_1559
dantaik Mar 27, 2023
95fc8cd
fix tests
dantaik Mar 27, 2023
80388a2
fix tests
dantaik Mar 27, 2023
718f25f
fix tests
dantaik Mar 27, 2023
45da2f6
Merge branch 'major_protocol_upgrade_rebase' into L2_1559
dantaik Mar 28, 2023
da2b35f
fix tests
dantaik Mar 28, 2023
8c6e3fa
fix tests
dantaik Mar 28, 2023
dd658eb
fix tests
dantaik Mar 28, 2023
f9bb2a9
Add FeeAndRewardConfig structure to calculate fee-rewards based on pr…
adaki2004 Mar 28, 2023
626957a
Following changes:
adaki2004 Mar 28, 2023
120d408
Changes
adaki2004 Mar 29, 2023
dc442e5
Delete logging and unnecessary vars and enable one additional test
adaki2004 Mar 29, 2023
a3be428
feat(protocol): calculate L2 EIP-1558 basefee on L1 (#13468)
dantaik Mar 30, 2023
81509c6
update foundry.toml
dantaik Mar 30, 2023
a4eae93
minor fix TaikoL2
dantaik Mar 30, 2023
9c1592c
fix
dantaik Mar 30, 2023
d287942
fix
dantaik Mar 30, 2023
e4ddb8d
+deploy_on_l1.sh
dantaik Mar 30, 2023
ee225b8
+deploy_on_l1.sh
dantaik Mar 30, 2023
c56dcbf
+deploy_on_l1.sh
dantaik Mar 30, 2023
5066081
Changes
adaki2004 Mar 30, 2023
51da738
Remove old archived files
adaki2004 Mar 30, 2023
9786d10
Remove archived test file
adaki2004 Mar 30, 2023
266b021
add doc
dantaik Mar 31, 2023
5b294a9
add doc
dantaik Mar 31, 2023
fcc1fac
+deploy_on_l1.sh
dantaik Mar 31, 2023
d9d4940
+deploy_on_l1.sh
dantaik Mar 31, 2023
45a94fa
+deploy_on_l1.sh
dantaik Mar 31, 2023
ccebb17
Changes:
adaki2004 Mar 31, 2023
867f384
Remove python algo
adaki2004 Mar 31, 2023
37c0928
PR review 1
adaki2004 Apr 1, 2023
22bb8f5
rebase with upstream
dantaik Apr 3, 2023
0a93f38
Changes:
adaki2004 Apr 3, 2023
eae7519
Added mechanism to pool and distribute rewards based on deposits
adaki2004 Apr 3, 2023
d5cc8e8
step1
dantaik Apr 4, 2023
b162d88
step1
dantaik Apr 4, 2023
13354c0
fix
dantaik Apr 4, 2023
475399e
fix
dantaik Apr 4, 2023
f5ed9c2
fix
dantaik Apr 4, 2023
be2d91a
fix
dantaik Apr 4, 2023
709c895
fix
dantaik Apr 4, 2023
1f73d97
fix
dantaik Apr 4, 2023
e3648b8
fix
dantaik Apr 4, 2023
c02042d
fix
dantaik Apr 4, 2023
e1b099d
fix
dantaik Apr 4, 2023
0a8f01d
fix
dantaik Apr 4, 2023
00ff4dc
fix
dantaik Apr 4, 2023
48f950c
fix
dantaik Apr 4, 2023
58936eb
fix
dantaik Apr 4, 2023
0945a2d
fix
dantaik Apr 4, 2023
1994877
fix
dantaik Apr 4, 2023
14e4fb7
fix
dantaik Apr 4, 2023
97330af
fix
dantaik Apr 4, 2023
24f1df9
PR review findings II.
adaki2004 Apr 4, 2023
93fee3a
Merge with base and resolve conflicts
adaki2004 Apr 4, 2023
f72110b
test(protocol): test 1559 calculation (#13534)
dantaik Apr 4, 2023
dd627c4
Remove unused libs
adaki2004 Apr 4, 2023
a7ec002
Drop typescript deployment task
adaki2004 Apr 4, 2023
e293932
Disable one (inentionally) failing tesst and remove unused gasAccumul…
adaki2004 Apr 4, 2023
6897c68
Merge branch 'L2_1559_rebase_in_anchor' into prove_time_based_rewards…
dantaik Apr 4, 2023
a05fb76
Deduct 1 from lastVerifiedBlock
adaki2004 Apr 4, 2023
cffbf21
refactor(protocol): recommend changes to Dani's PR (part1) (#13540)
dantaik Apr 17, 2023
10aa351
Function modifier and shadow declaration in test fix
adaki2004 Apr 17, 2023
5a4b51b
Resolve merge conflicts with base
adaki2004 Apr 18, 2023
c40f5a7
Merge branch 'major_protocol_upgrade_rebase' into prove_time_based_re…
adaki2004 Apr 18, 2023
be00cdc
Resolve build issues after massive merge conflicts fix
adaki2004 Apr 18, 2023
5fd3d91
Rename getProverFee to getBlockFee
adaki2004 Apr 18, 2023
6348487
Changes:
adaki2004 Apr 20, 2023
aa27af7
Merge branch 'major_protocol_upgrade_rebase' into prove_time_based_re…
dantaik Apr 21, 2023
d75f3b3
Changes:
adaki2004 Apr 21, 2023
519dca7
Change simulated L1 blocktime to 12
adaki2004 Apr 22, 2023
7537cd1
refactor(protocol): improve on top of Dani's PR (#13635)
dantaik Apr 22, 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
implement 1559 for L2
dantaik committed Mar 27, 2023
commit c85f74ee172c6e13cbe70a3e4381c0a0f4cbefb3
2 changes: 1 addition & 1 deletion packages/protocol/contracts/L1/TaikoConfig.sol
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ library TaikoConfig {
// Set it to 6M, since its the upper limit of the Alpha-2
// testnet's circuits.
blockMaxGasLimit: 6000000,
gasTarget: 60000000,
gasTarget: 6000000, // per second (not per 12 seconds)
adjustmentQuotient: 8,
// Set it to 79 (+1 TaikoL2.anchor transaction = 80),
// and 80 is the upper limit of the Alpha-2 testnet's circuits.
4 changes: 1 addition & 3 deletions packages/protocol/contracts/L1/libs/LibL2Tokenomics.sol
Original file line number Diff line number Diff line change
@@ -17,8 +17,6 @@ library LibL2Tokenomics {
using LibMath for uint256;
using SafeCastUpgradeable for uint256;

uint256 private constant ETH_BLOCK_TIME = 12 seconds;

function get1559Basefee(
TaikoData.State storage state,
TaikoData.Config memory config,
@@ -51,7 +49,7 @@ library LibL2Tokenomics {
pure
returns (uint256 newGasExcess, uint32 basefee, uint256 gasPurchaseCost)
{
uint256 adjustment = (gasTarget * blockTime) / ETH_BLOCK_TIME;
uint256 adjustment = gasTarget * blockTime;
newGasExcess = gasExcess.max(adjustment) - adjustment;

gasPurchaseCost =