Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Gas price market change: Escalator Algorithm (alternative to 1559) #2593
Gas price market change: Escalator Algorithm (alternative to 1559) #2593
Changes from 5 commits
2a2b589
59ed1a0
70ca333
011b1ba
ddb7a6a
a2418c9
bb81b26
8465697
3477905
1fb9783
8d65502
bbccbb4
a276bad
fde8413
9e7d501
7b78944
7613333
3527187
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
How is the
START_BLOCK
actually defined? If a transaction could have been valid at block 1000, but it has been created at block 2000, what is theSTART_BLOCK
in such case?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.
Similarly, what happens if
START_BLOCK
is in the future? Can this EIP also solve the problem of delayed transactions?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.
My question was basically a hint that
START_BLOCK
probably cannot be suitably defined (so that it can be efficiently calculated from consensus values, and not just from subjective tx pool timestamps), and this could be the main thing that makes this EIP hard or impossible to implementThere 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.
What do you mean suitably defined? The user or user's wallet specifies the
START_BLOCK
andMAX_BLOCK
in the transaction, just like with gas price and gas limit. If the miner is working on a block with numberBLOCK_NUMBER
, the block is valid iff all transactions within the block haveSTART_BLOCK
<=BLOCK_NUMBER
andMAX_BLOCK
>=BLOCK_NUMBER
It's very easy for a wallet to set this parameter. Just choose the next block for
START_BLOCK
and theMAX_BLOCK
to whatever delay the user is willing to tolerate divided by the 15 seconds average block times plus the start block.This constraint can be cheaply validated by any node, and adds some compute time to ordering transactions into a block (must determine the gas price for each transaction for the given block, and whether it can be included) but also has the benefit that transactions can be dropped from the mempool as soon as the block number exceeds
MAX_BLOCK
by some threshold, and potentially if they are sent with aSTART_BLOCK
too far in the futureThere 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.
Ok, I misunderstood, now I see that
START_BLOCK
is suggested to be a new transaction parameter. Thank youThere 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.
I'm not a fan of the transaction getting dropped when max-block is reached. In most cases I would want to escalate up to target price and then sit at that target price until mined or cancelled. I can also imagine situations where I want to "mine by this block or give up", so I can appreciate the desire but I don't think it is the common case.
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.
Thanks for highlighting this distinction. I think I agree with you as the default case, especially since it resembles current behavior more, but I think there is a use case (for a future EIP, perhaps a new tx type) to allow TXs that become invalid over time or after some conditions. Making this change.
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.
Consider changing this to
START_TIME
andMAX_TIME
instead. Miners can only fudge the block timestamp a little, and it is very costly for them to fudge the timestamp into the future. Timestamps are much easier for humans, and also much more reliable (block times range from 1 second to 100 seconds) so using block numbers can result in very unexpected (for a human) wait times.Also, by using timestamps here we will incentivize miners to more accurately set block timestamps than they do now. Right now, many miners set timestamps far (30+ seconds) in the past because there is a very marginal advantage for them to have their clocks be off by a bit. By having this be timestamp based, miners are strongly encouraged to set the timestamp as far forward as they can without risking significant profits. It turns out, that is just about
now
because they start taking on huge risk by settingblock.timestamp
to the future. This means that we can kill two birds with one stone with this PR by having gas price (or gas premium) be a function of time instead of block number.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.
This is an interesting point, and I have no objection, so I've made this change. I hope this doesn't greatly complicate any analyses that are currently in progress.
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.
START_BLOCK
/MAX_BLOCK
is inconsistent, preferMIN_BLOCK
/MAX_BLOCK
orSTART_BLOCK
/END_BLOCK
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.
The ideal behavior imo is that the transaction cannot be included after the
MAX_BLOCK
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, this wording conflicts with the wording above on
MAX_BLOCK
. I disagree with @moodysalem here and think that the ideal behavior (if we have to choose between two options) is to have it sit atMAX_PRICE
forever onceMAX_BLOCK
is reached.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.
I see people complain about transactions pending for days, blocking new things they want to do, in basically every dapp's support chat. Cancelling transactions via resubmitting with different gas price is a horrible experience, and has non-deterministic results. If you really want to wait up to 3 days for a transaction, set the MAX_BLOCK to last 3 days.
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.
The problem is that the fee algorithm is a function of
MAX_BLOCK, START_BLOCK
, so if you setMAX_BLOCK
to 3 days in the future, your fee increase rate is really slow. I would not be opposed to adding yet-another-variable forTERMINATION_BLOCK
, so you can escalate up to a target fee over say 5 minutes, but then sit in the pending queue for up to 24 hours at that fee.In other words, I agree that there is a problem with never-expiring transactions. I just disagree that
MAX_BLOCK
in this specification is the right place to fix that. In fact, one could create a totally separate EIP that just adds in aNOT_AFTER
field to transactions.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.
Suggest this could be a smart contract that implements this function in the future, but by default linear?
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.
That could be, I looked at some other EIPs and it seemed like pseudocode is fairly common for layer-1 proposals, but I'd gladly add specificity anywhere it's lacking.
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.
Just to clarify, I mean that the EIP could specify that a linear 'escalator' algorithm is just one of a number of gas price functions, which could be implemented as smart contracts and then specified by the user in the transaction as an address,
gasPriceContractAddress
. E.g. the specified contract could produce gas prices as a step function, or decreasing gas prices to encourage immediate inclusion. This may be way out of scope for this EIP though, but just worth mentioning as a hint towards the extensibility of this featureThere 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.
In order to prevent DoS attacks against the network, nodes need to be able to very quickly check to see if the caller can afford to submit the transaction, before executing arbitrary user-provided code. This ensures that someone can't waste node resources by submitting transactions to the network that are invalid.
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.
I think the DoS consideration is fair, but there is an obvious solution: limit how much gas the computation requires and make it pure. You still have to look up the code, but that can be easily memoized.