aionnetwork / aion_fastvm

Aion's FastVM implementation
MIT License
33 stars 15 forks source link

Make value transferred available immediately #34

Open iamyulong opened 5 years ago

iamyulong commented 5 years ago

In the current FastVM implementation, the value being transferred through transaction are not available to the callee contract. This has caused a few trouble for the Rust kernel implementation, due to a transaction on the Mastery testnet. See https://mastery.aion.network/#/transaction/ff8b53df5b06ee1e6569e437d83766ec747b331e7f2e92e6f3c38bffdec0cc99

Double checked the Ethereum's implementation, it seems that different clients have different implementation:

In Aion, the value transfer after the code execution for the transactions; before the code execution for the CALL or CREATE opcodes. For consistency, I'd prefer to change the behavior for transaction, by conducting value transfer before code execution.