-
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
feat(protocol): Calculate fee/reward based on proof time w/ 1559 math #13489
Conversation
We definitely need to be reasonable with the proofTimeTarget.
How to test possible main net scenario ? |
|
||
reward = uint64( | ||
(uint256(state.accBlockFees) * proofTime) / | ||
totalNumProvingSeconds |
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.
seems that there is a chance that when there are more and more unproven blocks on chain, reward will be less and less? or i missed something?
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.
Theoretically possible, in case proposers stop proposing.
The fee connected with the proof time issued seconds, so the more 'unproven' (while still being proposed) -> the more the fee -> the bigger the reward pool.
@adaki2004 please also fix all the warnings except those related to |
Proposer fee /prover reward balanced algorithm
This PR introduces an implementation of the proposer fee / prover reward equilibrium calculation, aiming to balance deposits and withdrawals. The implemented (new
baseFeeProof
) calculation depends on the proving time and utilizes the following parameters:The base fee proof serves as a dynamic fee that adapts to the network conditions, aiming to keep the inflow and outflow of tokens in balance.
See issue discussion:
https://github.com/taikoxyz/internal/issues/121
(Especially see Brecht's comment here, with fixed proof time target (Target 1) and 'Mint new tokens when needed' approach - in reality the deposits and withdrawals will be balanced.)
This is an experiment where the base idea is to have a simplified fee / reward calculation structure with TKO for provers and proposers and depends on proving time.
Notes:
targetProofTime
is far (above) from the actual proof time, the system will need more time to reach equilibrium when the time starts stabilizing - (and need to be stabilized below this targettest_reward_and_fee_if_proof_time_stable_but_above_time_target
) -> Setting thetargetProofTime
above the actual edge (where we expect the proof times) does not harm at all, because if proof times are below that, the equilibrium will be reached (deposits ≈ withdrawals) anyhow at some point.What remains to be done in this PR:
mintAllowed = false
mintAllowed = false
L2_1559_rebase
)