-
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): remove gas limit check #14087
Changes from all commits
98f9498
71f5b36
92d787a
43fcd7a
fac5ca3
6c12ba4
5afb36e
ba51f1e
57553a3
3e5a7d4
0a50f8e
4f29af6
883c2fb
a621929
7cd9859
30d98b1
8707d4e
6ea1180
37b29bd
e6eabc9
ad670e6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,4 +29,4 @@ broadcast | |
.vscode | ||
|
||
#coverage | ||
lcov.info | ||
lcov.info |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -176,12 +176,8 @@ contract TaikoL1 is | |
}); | ||
} | ||
|
||
function getBlockFee(uint32 gasLimit) public view returns (uint64) { | ||
return LibUtils.getBlockFee({ | ||
state: state, | ||
config: getConfig(), | ||
gasAmount: gasLimit | ||
}); | ||
function getBlockFee() public view returns (uint64) { | ||
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. Shall we also change the calculation of L2 EIP-1559? since its "purchasing" the 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. If |
||
return LibUtils.getBlockFee({ state: state, config: getConfig() }); | ||
} | ||
|
||
function getTaikoTokenBalance(address addr) public view returns (uint256) { | ||
|
@@ -193,7 +189,6 @@ contract TaikoL1 is | |
view | ||
returns ( | ||
bytes32 _metaHash, | ||
uint32 _gasLimit, | ||
uint24 _nextForkChoiceId, | ||
uint24 _verifiedForkChoiceId, | ||
bool _proverReleased, | ||
|
@@ -211,7 +206,6 @@ contract TaikoL1 is | |
blockId: blockId | ||
}); | ||
_metaHash = blk.metaHash; | ||
_gasLimit = blk.gasLimit; | ||
_nextForkChoiceId = blk.nextForkChoiceId; | ||
_verifiedForkChoiceId = blk.verifiedForkChoiceId; | ||
_proverReleased = blk.proverReleased; | ||
|
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 want to double check if we will use this value to reject transactions with
tx.limit > blockAndTxMaxGasUsed
because then the name is a bit confusing (gasLimit vs gasUsed). I'm not sure if Ethereum itself already does something like this e.g. if a tx has a gas limit of 100M gas but the block gas limit is 10M gas, is it rejected or can it still be included in a block if the tx ends up only using < 10M gas?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.
No all transactions accumulated gasLimit can not exceed
block.gasLimit
, so in go-ethereum, if its building a block, that transaction will just be rejected; if it received a block like this from the network, the whole block will be treat as invalid. So i think, if we just useblockAndTxMaxGasUsed
asblock.gasLimit
, it will break the ethereum protocol, maybe useuint256.max
or just set atxMaxGasLimit
then use the all txs accumulated gasLimit as theblock.gasLimit
will be more ethereum competitive?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.
So Ethereum has a pretty similar problem we currently have? As in only a single tx with a tx.gasLimit close to the block gas limit can be included? The only difference with our previous approach is that transactions with a smaller tx.gasLimit cannot be included anymore while in Ethereum blocks that would still be possible.
I think
blockAndTxMaxGasUsed
should still be okay no? So there is a block gas limit, and eachtx.gasLimit
needs to be<= block.gasLimit
. But to be 100% compatible with Ethereum we would also have to add an additional check thatl(Br)_u + tx.gasLimit <= block.gasLimit
as well. That seems like a pretty easy check to add.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 this would be a pretty big change (similar to the previous approach) where the the
tx.gasLimit
is a pretty important value. In Ethereum it's a mostly unimportant value where you can set it to a high value to make sure it will be successful with no real impact (except I guess for the rule above, but for any real use case should still be much smaller than block.gasLimit).