-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Changes from all commits
167d957
c693da5
749c63f
d0c5c5a
d2cd0d5
ae82406
699a045
fc5863f
975b057
0e6242c
b256bc1
0725c7a
ccec538
4f0162e
64548f0
c85f74e
c10f480
bafe0eb
8ff0da3
8a22c88
b161046
ca8dec2
cd4605d
467d1ad
dcd55ec
ec38ef3
a48a6b7
51df62e
9010aea
269896b
95fc8cd
80388a2
718f25f
45da2f6
da2b35f
8c6e3fa
dd658eb
f9bb2a9
626957a
120d408
dc442e5
a3be428
81509c6
a4eae93
9c1592c
d287942
e4ddb8d
ee225b8
c56dcbf
5066081
51da738
9786d10
266b021
5b294a9
fcc1fac
d9d4940
45a94fa
ccebb17
867f384
37c0928
22bb8f5
0a93f38
eae7519
d5cc8e8
b162d88
13354c0
475399e
f5ed9c2
be2d91a
709c895
1f73d97
e3648b8
c02042d
e1b099d
0a8f01d
00ff4dc
48f950c
58936eb
0945a2d
1994877
14e4fb7
97330af
24f1df9
93fee3a
f72110b
dd627c4
a7ec002
e293932
6897c68
a05fb76
cffbf21
10aa351
5a4b51b
c40f5a7
be00cdc
5fd3d91
6348487
aa27af7
d75f3b3
519dca7
7537cd1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,11 +7,6 @@ | |
pragma solidity ^0.8.18; | ||
|
||
library TaikoData { | ||
struct FeeConfig { | ||
uint16 avgTimeMAF; | ||
uint16 dampingFactorBips; | ||
} | ||
|
||
struct Config { | ||
uint256 chainId; | ||
uint256 maxNumProposedBlocks; | ||
|
@@ -24,29 +19,26 @@ library TaikoData { | |
uint256 maxTransactionsPerBlock; | ||
uint256 maxBytesPerTxList; | ||
uint256 minTxGasLimit; | ||
uint256 slotSmoothingFactor; | ||
uint256 rewardBurnBips; | ||
uint256 proposerDepositPctg; | ||
// Moving average factors | ||
uint256 feeBaseMAF; | ||
uint256 txListCacheExpiry; | ||
uint64 proofTimeTarget; | ||
uint8 adjustmentQuotient; | ||
bool relaySignalRoot; | ||
bool enableSoloProposer; | ||
bool enableOracleProver; | ||
bool enableTokenomics; | ||
bool skipZKPVerification; | ||
FeeConfig proposingConfig; | ||
FeeConfig provingConfig; | ||
} | ||
|
||
struct StateVariables { | ||
uint64 feeBase; | ||
uint64 basefee; | ||
uint64 accBlockFees; | ||
uint64 genesisHeight; | ||
uint64 genesisTimestamp; | ||
uint64 numBlocks; | ||
uint64 proofTimeIssued; | ||
uint64 lastVerifiedBlockId; | ||
uint64 avgBlockTime; | ||
uint64 avgProofTime; | ||
uint64 accProposedAt; | ||
uint64 lastProposedAt; | ||
} | ||
|
||
|
@@ -142,24 +134,26 @@ library TaikoData { | |
mapping(uint256 blockId => mapping(bytes32 parentHash => mapping(uint32 parentGasUsed => uint256 forkChoiceId))) forkChoiceIds; | ||
mapping(address account => uint256 balance) balances; | ||
mapping(bytes32 txListHash => TxListInfo) txListInfo; | ||
// Never or rarely changed | ||
// Slot 5: never or rarely changed | ||
uint64 genesisHeight; | ||
uint64 genesisTimestamp; | ||
uint64 __reserved1; | ||
uint64 __reserved2; | ||
// Changed when a block is proposed or proven/verified | ||
// Changed when a block is proposed | ||
uint64 __reserved51; | ||
uint64 __reserved52; | ||
// Slot 6: changed by proposeBlock | ||
uint64 lastProposedAt; | ||
uint64 numBlocks; | ||
uint64 lastProposedAt; // Timestamp when the last block is proposed. | ||
uint64 avgBlockTime; // miliseconds | ||
uint64 __reserved3; | ||
// Changed when a block is proven/verified | ||
uint64 accProposedAt; // also by verifyBlocks | ||
uint64 accBlockFees; // also by verifyBlocks | ||
// Slot 7: changed by proveBlock | ||
// uint64 __reserved71; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lets uncomment these 4 fields so we actually reserve a slot for them. Then change There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure i understand this. Uncomment these 4 used slots ? (accProposedAt, and rewardPool ?) |
||
// uint64 __reserved72; | ||
// uint64 __reserved73; | ||
// uint64 __reserved74; | ||
// Slot 8: changed by verifyBlocks | ||
uint64 basefee; | ||
uint64 proofTimeIssued; | ||
uint64 lastVerifiedBlockId; | ||
uint64 __reserved4; | ||
// the proof time moving average, note that for each block, only the | ||
// first proof's time is considered. | ||
uint64 avgProofTime; // miliseconds | ||
uint64 feeBase; | ||
uint64 __reserved81; | ||
// Reserved | ||
uint256[43] __gap; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is
blockFee
a better name? Just asking, not sure...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, represent more what we mean ATM i agree - however if we do not stick to this tokenomics later on (which is definitely probable) it might be just a basefee + some staked/staking fee, or whatever. Currently indeed a blockfee, tho.