Closed FroghubMan closed 1 year ago
CC: @maciejwitowski for visibility
builtin-actors adds test_tvx. The test vectors data of evm is implemented and directly written into the vm. Finally, the output results are compared with the changed values of the slots. There is a bug in the rlp_append implementation of RlpCreateAddress. issues
Hi @FroghubMan, thanks for your proposal. Although your description and explanations are quite brief, it seems like you have a good big picture understanding of the approach involved. Some comments here:
@raulk At the beginning, we considered tvx vector format, but because the comparison target of tvx vector format is StateTree Root, which is inconsistent with the EVM slot we imagined, so we wanted to design a new format test vector.
For environmental data, we need to expand the implementation of opcodes related to it, implement the function that these environment data can be read from external data sources in testing phase. These data sources can be files, blockstore, etc.
For opcodes that access the state tree, e.g. BALANCE, EXTCODE*,We can use the address, balance, , bytecode(if needed) and slot data(if needed) on the state tree to correctly instantiate the account. for opcode EXTCODEHASH, BLOCKHASH, since it is generated by cid, it is necessary to read directly from the outside (maybe file/blockstore as datasource) in testing phase.
Now after our team's discussion, we can indeed directly use the tvx vector format and reuse the conformance test vector runner. We intend to achieve our goals as follows:
Intercept the data of the following types of opcodes through evm tracing: context: BLOCKHASH, COINBASE, GASPRICE, GAS, TIMESTAMP, NUMBER, DIFFICULTY, GASLIMIT, CHAINID, BASEFEE ext: EXTCODESIZE, EXTCODECOPY, EXTCODEHASH call: CALLDATALOAD, CALLDATASIZE, CALLDATACOPY, CODESIZE, CODECOPY, CALL storage: SLOAD, SSTORE
With the help of ref-fvm, correctly simulate the data (address, balance, bytecode, slot data) of the account on the state tree through the opcode data of call and storage types,In order to execute the contract call.
Expand the function implementation of context and ext type opcodes under ref-fvm, allowing data to be read from external data sources (eg, files, blockstore, etc.).
Expand the tvx function so that the test vector of the evm type can be replayed
To summarize the previous discussion, I submitted a new issue: #1202
RFP Proposal:
Tool for applying test vectors from Ethereum on FEVM
Name of Project: Tool for applying test vectors from Ethereum on FEVM
Link to RFP: fvm-ethereum-test-vectors
RFP Category:
devtools-libraries
Proposer:
FroghubMan
Do you agree to open source all work you do on behalf of this RFP and dual-license under MIT and APACHE2 licenses?: Yes
Project Description
Technical Approach:
Development Roadmap
Milestone1:
Milestone2: FEVM Consumes Test Vector and generate test result.
Documentation, Education, and Community
The code repository will contain detailed instructions for using the CLI tool
Milestone Summary
Total Budget Requested
$42000
Maintenance and Upgrade Plans
We are willing to maintain this test vector tool for a long time.
Team
Contact Info
wenxin@froghub.io
Team Members
Team Website
https://www.froghub.io/
Relevant Experience
Please describe (in words) your team's relevant experience, and why you think would do a great job with this RFP. You can cite your team's prior experience in similar domains, doing similar dev work, individual team members' backgrounds, etc.
Team code repositories
https://github.com/froghub-io