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
FEVM | Howto access cross contract pre-compile functions. #988
Comments
Starting off with the error message:This is attempting to CALL with destination
Null address is used commonly by burn tokens, so this is definitely a good issue to catch. I've opened an issue to fix it. Now to the assembly:Contract 1 - First push Contract 2 - First push a bunch of 0s (used later). Push 32 bytes of input data starting at Comments in the code already have some good pseudo-code of what is going on. Which side note - I really like, is this part of a dissasembler somewhere or something you wrote in? Contract 1 will always fail as since we dont have support for PUSH0, but its a simple enough add so I've opened an issue to add it. Q1.1We don't want add runtime bytecode as part of the ConstructorParams since this usage is specific to tests, on network contract will only be created with initcode. The solution to use the constructor method is to wrap the bytecode with some simple initcode that just returns the bytecode. e.g.
This will deploy the contract as-is, waiting to be ran with Q1.2We support all Eth Precompiles at their normal addresses! I believe what happened was since it was called in the constructor it had no input data so it used Thanks for the great issue! Issues created from this: |
Thanks, @mriise. I got your suggestion for Q1.1. But the requirement for the test tool is to re-use the test vector as it is from https://github.com/ethereum/tests.git. So any other possibility to deploy the contract with invalid bytecodes ? |
Yes, though it's a fair bit more of a pain to do.
Both options require stepping carefully though, so I recommend double checking to make sure that not changing the test bytecode (like mentioned) in any way is a hard requirement. |
@shamb0 Address rejection fix just got merged into |
@shamb0 can you share your plan for next steps so I know what to expect? |
btw we are still not sure whether to add Push0 to the scope of this milestone filecoin-project/ref-fvm#1400 |
Hello @maciejwitowski, Have some good news, cross contract call is working As next step.
|
Thanks for the update! Yes, I like the suggestion about shortlisting the tests! What do you think about these rules for work?
If we do this, and we report whether particular test pass or not every day, then we build a solid confidence day by day. We could create a new issue eg in ref-fvm repo and post updates there as they come. Does it make sense? Thanks for your hard work! This is an absolutely crucial time for us and we really appreciate your enthusiasm to help! ❤️ |
Thanks @maciejwitowski :-). Proposed Way-of-work sounds good. I agree to that. One suggestion is, Instead of updating the issues to repo link, like to update the test execution status to tracking sheet in the PR branch (at least for first few days). Once the team agrees, the failure or bug will move to repo issue tracker. The idea is not to flood with spam issues on the repo issue tracker. |
Sounds good, thank you!
Correct? |
Hello @maciejwitowski, Eth Compliance test, intermediate progress.
Raised Issues |
@shamb0 is this issue good to be closed since initial issue has been fixed? |
Thanks, @mriise, for great support. :-) |
Issues Related
Discussion Thread ...
Bit blocked in the bring-up of test-suite push0.json. Use-case trying to invoke functions between contracts. To be specific looking for some clarity on how "CALL(0xF1)" works under FEVM context. Tried my best to mimic the test app implementation from revme, but no luck. Captured the traces from revme & FEVM context.
Use-Case
https://github.com/ethereum/tests/blob/b3d820f4488e2b49674546269a176db021ee4249/GeneralStateTests/EIPTests/stEIP3855/push0.json#LL157C18-L157C18
Draft PR
Contract-01
Test Case
Decompiled ASM code
Contract-02
Test Case
Decompiled ASM code
Execution of testcase under revme context
https://github.com/bluealloy/revm/tree/main/bins/revme
Use-case is working fine on revme context, and the execution flow & traces looks OK.
Execution of Contract-02
Contract-02 invokes Contract-01
Complete Trace
Execution of testcase under fevm context
FEVM Error
Complete Trace
Some Highlights for Discussion.
Most of the bytecodes in Eth test vectors, have only runtime codes,
I hope this approach helps to deploy the actor as it is. and manage the state & invokation of contract runtime function from other actors.
The text was updated successfully, but these errors were encountered: