Skip to content
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

[evm] support opBasefee #3643

Merged
merged 3 commits into from
Sep 22, 2022
Merged

[evm] support opBasefee #3643

merged 3 commits into from
Sep 22, 2022

Conversation

dustinxie
Copy link
Member

Description

EIP3198 is enabled in London EVM, which accesses evm.Context.BaseFee. See ethereum/go-ethereum@94451c2#diff-c21870801ba3133fda5991da046fbfd0f83999bda1008a4af84affca83ec5eb9R171

Fixes #(issue)

Type of change

Please delete options that are not relevant.

  • [] Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • [] Code refactor or improvement
  • [] Breaking change (fix or feature that would cause a new or changed behavior of existing functionality)
  • [] This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • make test
  • fullsync (WIP)
  • [] Other test (please specify)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@dustinxie dustinxie requested a review from a team as a code owner September 20, 2022 23:04
@codecov
Copy link

codecov bot commented Sep 20, 2022

Codecov Report

Merging #3643 (1935154) into master (e9732a1) will decrease coverage by 0.16%.
The diff coverage is 78.76%.

@@            Coverage Diff             @@
##           master    #3643      +/-   ##
==========================================
- Coverage   74.95%   74.78%   -0.17%     
==========================================
  Files         269      269              
  Lines       23819    23881      +62     
==========================================
+ Hits        17854    17860       +6     
- Misses       5039     5093      +54     
- Partials      926      928       +2     
Impacted Files Coverage Δ
db/trie/mptrie/node.go 100.00% <ø> (ø)
action/protocol/execution/evm/evm.go 44.57% <26.66%> (-0.86%) ⬇️
db/trie/mptrie/hashnode.go 36.36% <41.17%> (-54.55%) ⬇️
db/trie/mptrie/merklepatriciatrie.go 78.73% <46.80%> (-12.70%) ⬇️
db/trie/mptrie/leafiterator.go 62.06% <50.00%> (ø)
action/protocol/execution/evm/evmstatedbadapter.go 65.87% <64.28%> (-0.04%) ⬇️
db/trie/mptrie/extensionnode.go 91.91% <94.28%> (-1.07%) ⬇️
db/trie/mptrie/branchnode.go 97.60% <98.66%> (-1.01%) ⬇️
action/protocol/context.go 68.00% <100.00%> (+0.25%) ⬆️
api/grpcserver.go 83.33% <100.00%> (ø)
... and 6 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

BlockNumber: new(big.Int).SetUint64(blkCtx.BlockHeight),
Time: new(big.Int).SetInt64(blkCtx.BlockTimeStamp.Unix()),
Difficulty: new(big.Int).SetUint64(uint64(50)),
GasLimit: gasLimit,
BaseFee: new(big.Int).SetUint64(1), // in units of 10^-6 IOTX, current basefee is 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how is BaseFee used?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see https://eips.ethereum.org/EIPS/eip-3198

it is for contract to access the basefee

Copy link
Member

@Liuhaai Liuhaai Sep 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok. Why is it hardcoded to 1?

@sonarcloud
Copy link

sonarcloud bot commented Sep 22, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@dustinxie dustinxie merged commit a784616 into iotexproject:master Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants