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

test: Enable Shanghai and Cancun EIPs blockchain test by Cancun and Prague forks #211

Conversation

Mdaiki0730
Copy link
Contributor

@Mdaiki0730 Mdaiki0730 commented Jan 17, 2025

Proposed changes

This PR enables Shanghai, Cancun EETS blockchain testing with the Cancun and Prague forks.
The flow has been slightly changed to enable blockchain testing.

It includes some code to check for eth compatibility, but these may not be optimal.
Please review these only for the logic to proceed with the test task first.

Types of changes

Please put an x in the boxes related to your change.

  • Bugfix
  • New feature or enhancement
  • Others

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.

  • I have read the CONTRIBUTING GUIDELINES doc
  • I have read the CLA and signed by comment I have read the CLA Document and I hereby sign the CLA in first time contribute
  • Lint and unit tests pass locally with my changes ($ make test)
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

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...

@Mdaiki0730 Mdaiki0730 force-pushed the feat/shanghai-cancun-eets branch 4 times, most recently from 930d209 to abb1237 Compare January 17, 2025 05:10
@Mdaiki0730 Mdaiki0730 force-pushed the feat/shanghai-cancun-eets branch from 9bd1211 to 877e495 Compare January 17, 2025 05:28
@Mdaiki0730 Mdaiki0730 marked this pull request as ready for review January 17, 2025 05:40
@Mdaiki0730 Mdaiki0730 requested review from shiki-tak and ulbqb January 17, 2025 05:40
Comment on lines +85 to +87
default:
// It's an EIP-2718 typed TX envelope.
// First read the tx payload bytes into a temporary buffer.
Copy link
Contributor

Choose a reason for hiding this comment

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

We must not decode 01~04 prefixes. It's Kaia's spec to disallow them. Because,

  • Case A. allow both Eth and Kaia type bytes
f9... -> legacy
01... -> eth accesslist
08... -> kaia valuetransfer
what if Eth defines 08 in the future?
  • Case B. Eth and Kaia types are distinguished with envelope
f9... -> legacy
01... -> disallowed
7801... -> eth accesslist
08... -> kaia valuetransfer
7808... -> eth type 8

and we chose type B in 2022. TxInternalDataSerializer.DecodeRLP accepting 0x01 prefix is an explicit spec violation. Please try to convert the test JSON, for instance,

  • decode EthBlock RLP
  • extract EthTx RLPs array [][]bytes (don't further decode txs here)
  • attach 0x78 if first byte of each tx RLP is 01,02,03,04
  • then decode into Kaia's []types.Transaction.

Comment on lines +2779 to +2782
if UseKaiaCancunExtCodeHashFee && chainConfig.Rules(header.Number).IsCancun {
// EIP-1052 must be activated for backward compatibility on Kaia. But EIP-2929 is activated instead of it on Ethereum
vm.ChangeGasCostForTest(&vmenv.Config.JumpTable, vm.EXTCODEHASH, params.WarmStorageReadCostEIP2929)
}
Copy link
Contributor

@blukat29 blukat29 Jan 17, 2025

Choose a reason for hiding this comment

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

If EIP-1052 fails, then let it fail and skip those JSONs (unless most tests fail due to 1052). The skip list is the accurate representation of Kaia's compatibility.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

then let it fail and skip it

Does it means vm.ChangeGasCostForTest?

@Mdaiki0730 Mdaiki0730 merged commit b474ad6 into kaiachain:feat/eets-blockchain-test Jan 17, 2025
9 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 17, 2025
@Mdaiki0730 Mdaiki0730 deleted the feat/shanghai-cancun-eets branch January 17, 2025 07:33
@Mdaiki0730 Mdaiki0730 restored the feat/shanghai-cancun-eets branch January 20, 2025 04:42
@Mdaiki0730 Mdaiki0730 self-assigned this Jan 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants