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
all : implement dynamicGasPrice(kip-71) #1493
Conversation
…ist of transactions that greater than or equal to the given baseFee.
…ponding nonce already exists, a transaction with a high gasPrice is added.
…of newTx is bigger than gasPrice of oldTx, replace it.
Co-authored-by: Junghyun Colin Kim <colin.klaytn@krustuniverse.com>
Co-authored-by: Junghyun Colin Kim <colin.klaytn@krustuniverse.com>
Co-authored-by: Junghyun Colin Kim <colin.klaytn@krustuniverse.com>
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.
Nice work :)
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.
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.
When a node processes a block, it doesn't verify the gas price of block transactions whether it is higher than the block base fee.
api/api_ethereum.go
Outdated
@@ -1464,10 +1493,14 @@ func (api *EthereumAPI) rpcMarshalHeader(head *types.Header) (map[string]interfa | |||
"receiptsRoot": head.ReceiptHash, | |||
} | |||
|
|||
// TODO-Klaytn needs to add kip71 hardfork condition |
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.
Do we need this line?
// TODO-klaytn temporal number for test | ||
KIP71CompatibleBlockNum = big.NewInt(95000000) |
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.
Time to remove this
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.
We can fix the block number now? I think we can fix this after the hardforked block number is confirmed.
@kjeom Can you resolve conflict? |
@jimni1222 Yes, I resolved the conflict twice. |
@kjeom CN: Cannot process the tx. Logs Full Logs images-CN-0-1 | WARN[07/06,21:31:41 -04] [25|consensus/istanbul/core/roundchange.go:138] [RC] Prepare messages received before startNewRound address=0x73718C4980728857f3Aa5148E9d1B471eFa3a7dd state="Accept request" from=0x73718C4980728857f3Aa5148E9d1B471eFa3a7dd round=8069 len(prepares)=0 messages="\n"
images-CN-0-1 | WARN[07/06,21:31:41 -04] [25|consensus/istanbul/core/roundchange.go:140] [RC] Commit messages received before startNewRound address=0x73718C4980728857f3Aa5148E9d1B471eFa3a7dd state="Accept request" from=0x73718C4980728857f3Aa5148E9d1B471eFa3a7dd round=8069 len(commits)=0 messages="\n"
images-CN-0-1 | WARN[07/06,21:31:41 -04] [25|consensus/istanbul/core/roundchange.go:142] [RC] Received 2f+1 Round Change Messages. Starting new round address=0x73718C4980728857f3Aa5148E9d1B471eFa3a7dd state="Accept request" from=0x73718C4980728857f3Aa5148E9d1B471eFa3a7dd currentRound=8069 newRound=8069
images-CN-0-1 | WARN[07/06,21:31:41 -04] [25|consensus/istanbul/core/preprepare.go:95] Failed to verify proposal address=0x73718C4980728857f3Aa5148E9d1B471eFa3a7dd from=0x73718C4980728857f3Aa5148E9d1B471eFa3a7dd state="Accept request" err="invalid baseFee: have 25000000000, want 190020286334, parentBaseFee 200000000000, parentGasUsed 60859" duration=0s
images-CN-0-1 | WARN[07/06,21:31:41 -04] [25|consensus/istanbul/core/roundchange.go:42] [RC] sendNextRoundChange happened where="handlePreprepare. Proposal verification failure. Not ErrFutureBlock"
images-CN-0-1 | WARN[07/06,21:31:41 -04] [25|consensus/istanbul/core/roundchange.go:57] [RC] Prepare messages received before catchUpRound address=0x73718C4980728857f3Aa5148E9d1B471eFa3a7dd state="Accept request" len(prepares)=0 messages="\n"
images-CN-0-1 | WARN[07/06,21:31:41 -04] [25|consensus/istanbul/core/roundchange.go:59] [RC] Commit messages received before catchUpRound address=0x73718C4980728857f3Aa5148E9d1B471eFa3a7dd state="Accept request" len(commits)=0 messages="\n"
images-CN-0-1 | WARN[07/06,21:31:41 -04] [25|consensus/istanbul/core/core.go:310] [RC] Catch up round address=0x73718C4980728857f3Aa5148E9d1B471eFa3a7dd old_round=8069 old_seq=195 old_proposer=0x73718C4980728857f3Aa5148E9d1B471eFa3a7dd new_round=8070 new_seq=195 new_proposer=0x73718C4980728857f3Aa5148E9d1B471eFa3a7dd Problem Log
This error is produced by func VerifyKIP71Header(config *params.ChainConfig, parentHeader, header *types.Header) error {
if header.BaseFee == nil {
return fmt.Errorf("header is missing baseFee")
}
// Verify the baseFee is correct based on the parent header.
expectedBaseFee := NextBlockBaseFee(parentHeader, config)
if header.BaseFee.Cmp(expectedBaseFee) != 0 {
return fmt.Errorf("invalid baseFee: have %s, want %s, parentBaseFee %s, parentGasUsed %d",
header.BaseFee, expectedBaseFee, parentHeader.BaseFee, parentHeader.GasUsed)
}
return nil
} Problem Situation
After block number 194, the error occurred. How to Re-produce issue
After 5 mins later... (It takes few minutes to KCN up) I recommended run this unit test using Intelli J Ultimate cc. @jimni1222 |
@kjeom @aidan-kwon Let's merge this and resolve the bug in other PRs. |
Proposed changes
This PR is merged from followings
This PR includes following features
Governance parameters
for KIP-71governance parameters
and parentbaseFee
gasPrice
(baseFee)Types of changes
Please put an x in the boxes related to your change.
Checklist
Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.
$ make test
)Related issues
Further comments
number
baseFee
field is added to the block header, so a hard fork is required.