ref-fvm icon indicating copy to clipboard operation
ref-fvm copied to clipboard

Tool for applying test vectors from Ethereum on FEVM

Open wenxinnnnn opened this issue 2 years ago • 1 comments

Tracking issue https://github.com/filecoin-project/devgrants/issues/1202.

  1. We implemented a command-line tool that extracts transactions from ethereum and generates test vectors.

  2. We extended TestVector to provide more contextual information:

    • Added chain_id field to TestVector ( for the opcode CHAINID to read )
    • Added tipset_cids field to TestVector ( for the opcode BLOCKHASH to read )
    • Added timestamp field to Variant ( for the opcode TIMESTAMP to read )
    • Added _debug field to Metadatato provide information about transaction.
  3. We extend the way test vectors are compared to :

    • Added skip_compare_gas_used field to TestVector to allow comparisons that ignore gasUsed.
    • Added skip_compare_addresses field to TestVector to allow comparisons that ignore some addresses. (Due to the difference in gas consumption between filecoin and ethereum, So we can't compare from address)
    • Added skip_compare_actor_ids field to TestVector to allow comparisons that ignore some builtin actors. (Since there is no way to compare RewardActor and BurntFundsActor, we need to ignore the comparison of these two builtin actors)
    • Added additional_compare_addresses field to TestVector to allow comparison of more contract addresses. (Since an ethereum transaction may involve more contract addresses than the to address)

wenxinnnnn avatar Jan 16 '23 06:01 wenxinnnnn

another PR: https://github.com/filecoin-project/test-vectors/pull/192

wenxinnnnn avatar Jan 16 '23 06:01 wenxinnnnn