This repository has been archived by the owner on Aug 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 184
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Most of the code is based on Ethereum's code. So please take a look. Differences * Klaytn uses baseFeePerGas as 0. * Klaytn uses maxPriorityPerGas as 25 ston which is configured by governance. * Didn't applied cache because Gas-related values in Klaytn are all fixed, so it was determined that this API is unlikely to be used significantly. * Added OracleBackend but there are some differences from Etheruem's backend * Remove SubscribeChainHeadEvent because Klaytn uses fixed gasPrice policy, so we don't have to fetch and cache latest head. * Remove PendingBlockAndReceipts because there is no related apis about pending block in Klaytn backend. * Change GetReceipts to GetBlockReceipts because this fits to Klaytn backend operation.
aeharvlee
requested review from
aidan-kwon,
jeongkyun-oh,
jimni1222,
KimKyungup,
mckim19,
sirano11 and
yoomee1313
as code owners
January 24, 2022 12:35
5 tasks
7 tasks
jimni1222
reviewed
Feb 9, 2022
5 tasks
jimni1222
previously approved these changes
Feb 10, 2022
jimni1222
reviewed
Feb 10, 2022
9 tasks
aidan-kwon
reviewed
Feb 10, 2022
aidan-kwon
previously approved these changes
Feb 10, 2022
@jeongkyun-oh @yoomee1313 PTAL |
sirano11
previously approved these changes
Feb 11, 2022
IntrinsicGas now consider AccessList. This is feature is from upstream/dev branch.
aeharvlee
dismissed stale reviews from sirano11, aidan-kwon, and jimni1222
via
February 11, 2022 06:09
9d247c9
aidan-kwon
previously approved these changes
Feb 11, 2022
jimni1222
previously approved these changes
Feb 11, 2022
IntrinsicGas now consider AccessList. This is feature is from upstream/dev branch.
jimni1222
approved these changes
Feb 11, 2022
sirano11
approved these changes
Feb 11, 2022
aidan-kwon
approved these changes
Feb 11, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Proposed changes
Most of the code is based on Ethereum's code, So please take a look Ethereum's FeeHistory API
Related docs
Differences with Geth's implementation.
0
so there is no need to calculate this value.25 ston
which is configured by governance so there is no need to calculate this value.OracleBackend
but there are some differences from Etheruem's OracleBackendSubscribeChainHeadEvent
because Klaytn uses fixed gasPrice policy, so we don't have to fetch and cache latest head.PendingBlockAndReceipts
because there is no related apis about pending block in Klaytn backend.GetReceipts
toGetBlockReceipts
because this fits to Klaytn backend operation.How to test this PR
First, please clone my origin repo.
1. Run added tests in this PR.
go test -run "TestEthereumAPI_*" -v ./... -count=1
2. Build ken and test with it.
1. Build ken with source codes related with this PR.
make ken
2. Run ken
eth
namepsace to RPC_API and WS_API in kend.conf3. Setup environment to send txs
Test logs
KEN
Beautified Result
Should note that
17(=0x10 + 0x1)
because it should always return nextBaseFee based on the spec. Other fields lengths are all16(=0x10)
.2656(=0xa60), 2659(=0xa63), (2662 =0xa66)
.Block#2656(=0xa60)
used total gas295200400
=> 295200400 / UpperGasLimit ==0.0002952004000002952
which is the same with API return.Related KEN logs
Geth
Specify reward percentiles
Beautified Result
Didn't specify reward percentiles
Beautified Result
** Fetch empty blocks **
Beautified Result
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
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...