-
Notifications
You must be signed in to change notification settings - Fork 79
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
[DO NOT MERGE] make eth compliance tester work #1199
Draft
vyzo
wants to merge
359
commits into
fvm-next
Choose a base branch
from
vyzo/eth-compliance
base: fvm-next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* FVM specific EVM precompiles - changes randomness functions to take a raw i64 since this is userspace now - add precompiles: resolve_address, lookup_address, get_actor_code_cid, get_randomness(beacon/chain) * leave context as TODO * fixes after rebase * rustfmt * add new user randomness functions (that dont limit types to domain seperation tags) * add some precompile docs, use ID addresses instead of ETH style ID addresses, assert reserved bytes are zeroes * fmt & clippy * Update precompiles.rs * kill old expect randomness functions and route them through the new ones * rename user get_randomness_x functions to be more consistient * rustfmt
* use more EVM style params for precompiles
- CALL: truncates the return value, but doesn't zero fill. - CALLDATA, EXTCODECOPY, CODECOPY: treat input as if it were followed by infinite zeros. - RETURNDATACOPY: explicitly forbids out-of-bounds reads. We might be able to change the behavior of EXTCODECOPY and CODECOPY to match RETURNDATACOPY, but we _can't_ change CALLDATA as solidity abuses this feature for zeroing memory. So we're just going to match what the EVM does because it's safer (and because we need to implement that behavior _anyways_ for CALLDATA). fixes filecoin-project/ref-fvm#1021 fixes filecoin-project/ref-fvm#1024
We ran out of space.
We can already handle _executing_ with empty bytecode, we just didn't allow construction.
Includes refactored network/message context syscalls.
* wip callactor precompile (very broken) * fill out logic a bit * rustfmt * pass in context through to precompiles * exit with error on static call to callactor, array chunks abstraction * forgot increment cursor... * actually use gas from call, assert unused bits in randomness params are zeroed * pass precompile context to all precompiles add a chunked parameter reader * improve parameter reader, check for readonly, new precompiles only read u32 for dynamicly sized bytes * update sdk * review changes, fix fn name in runtime * nit: don't comment out code
* add exit to runtime interface * propagate revert data in contract invocations * add data to ActorError * propagate data in actor errors from send * correctly handle reverts in calls * implement exit with panics in mock runtime * implement exit with panics in test vm * fix clippy * fix test vm: exit data should be in new context * use pop instead of ugly gets in ret * cosmetics * add naked revert test * rustfmt * only test naked revert in unit test nested call revert should go in integration test, really * fix callvariants contract to check reverts * really fix callvariants contract: iszero is what you want * test_vm: missing panic handler * callvariants is also testing mutation * deduplicate actor exit handler code * rustfmt * remove unnecessary replaces for exits. * fix runtime trampoline to propagate data from errors * perform contract/constructor invocation abortive returns with errors * don't synethesize exit data if it is not there * propagate error data in test_vm * rustfmt * simplify/dedup identical code
* clean up leftovers from CALLACTOR and METHODNUM refactor. * fix callactor test * rusftm Co-authored-by: mriise <[email protected]>
* add unit tests for some opcodes ADD MUL SUB DIV * fmt
* fix call_actor precompile; modify error message * revert modifying error message * rustfmt
* check stack limits at dispatch, make stack ops unchecked * use a growable vector for the stack * fix growth check * clippy wants default... * optimize ensure somewhat * remove implicit assumption about growth patterns * drop error from Bytecode::new signature, it can't really err. fix rebase artifact * refactor part I: primops * add arity/stack checks for primops * dup and swap * push * immediates * sugar * first stdfun * keccak256 as stdfun and prettier sugar * moar stdfuns * calldatacopy * emacs auto-indent friendly sugar * more functionoids * moar funcionoids * call opcodes also kill leftover callactor * primitive -> primop * codesize and codecopy * create and create2 * control flow * mark stack ops as unsafe only macro mechanically checked invocations for these * fix tests * rustfmt * shut up clippy's frivolous complaints * nit: macro magic Co-authored-by: Steven Allen <[email protected]>
* defeat instruction zoo call convention complexity it's just one, the intrinsic, which passes a machine. * fix tests * rip ControlFlow enum * more macrology * cosmetics * shut up clippy
* Update FVM * feat: correctly handle "read-only" errors. Co-authored-by: Steven Allen <[email protected]>
* fix: correctly compute addresses in CREATE And add some basic tests. fixes #866 * Apply suggestions from code review Co-authored-by: Melanie Riise <[email protected]> Co-authored-by: Melanie Riise <[email protected]>
* Export Datacap Actor methods * Export Init Actor methods * Export Market Actor methods * Export Miner Actor methods * Export Multisig Actor methods * Export Verifreg Actor methods * Address review
* Power actor: Add exported getters for raw power * FRC-XXXX is FRC-0042 * Power actor: network_raw_power: Return this_epoch_raw_byte_power * Power actor: miner_raw_power: Return whether above consensus min power * Power actor: types: serialize one-element structs transparently * Address review * Miner actor: Add exported getters for info and monies (#811) * Miner actor: Add exported getters for info and monies * Tweak comment * Miner actor: Replace GetWorker and GetControls with IsControllingAddress * Miner actor: Add exported GetAvailableBalance * Miner actor: Add exported GetVestingFunds * Miner actor: Remove exported monies getters * Miner actor: types: serialize one-element structs transparently * Address review * Address review
Co-authored-by: zenground0 <[email protected]>
* Market actor: GetDealTermExported: Return (start_epoch, duration) * Market actor: Export getter for deal total price
fix mockruntime tipset-cid, add unit test for opcode
* add tests for first half of context * remove blockhash from this PR, fmt * add remaining context tests
* EVM: reproduce ecMul precompile zero-scalar bug. * EVM: fix encoding of zero --------- Co-authored-by: Steven Allen <[email protected]>
* test sload * test sstore * make lint happy in macro expansion * test log0 * test log1 * test log2,3,4
This was probably intended to reduce copying between EVM contracts, but it makes no difference for us beyond introducing strange types.
- Remove OnceCell and replace it with an Option. - Move lazy_static to the dev dependencies. - Manually implement deref instead of importing a crate just for that. - Remove a bunch of unused dependencies.
* fix: added hyperspace feature for build * rustfmt
* test codesize * test codecopy * test extcode* * rustfmt
* test address * test origin * test caller * test gas * test gasprice * rustfmt
* test call happy path * test call alternative paths * test delegatecall * test staticcall * test invalid * rustfmt * add correctness check sled to test return/revert * clippy
* test create * test create edge cases * test create2 * test create2 variants * test selfdestruct * rustfmt * check nonce on create tests * test read only conditions * rustfmt * add check for tombstone contents
test memory reads
check all instructions for stack underflow behaviour none should panic.
That way, we: 1. Don't depend on a fork of an unmaintained library. 2. Use a much simpler blake2f implementation.
vyzo
changed the title
[WIP] make eth compliance tester work
[DO NOT MERGE] make eth compliance tester work
Feb 10, 2023
Stebalien
force-pushed
the
next
branch
2 times, most recently
from
August 14, 2023 19:32
0ae21b1
to
c0599c4
Compare
Stebalien
force-pushed
the
fvm-next
branch
3 times, most recently
from
September 28, 2023 16:56
3c56111
to
96654e3
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
companion to shamb0/fevm-eth-compliance-test#2