Skip to content
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

Add a bit of logging to mock runtime #1006

Open
wants to merge 244 commits into
base: fvm-next
Choose a base branch
from

Conversation

mriise
Copy link
Contributor

@mriise mriise commented Jan 10, 2023

No description provided.

vyzo and others added 30 commits July 22, 2022 11:20
…d scripts (#504)

* add devnet-m2-native network with associated features to build scripts

* transitively activate m2-native on runtime

* add devnet-m2-native bundle build target

* fix output target for m2-native bundle

* pacify clippy.

* runtime: Cargo.toml sort dependencies.

* Cargo.toml: point patches to master.

* fix devnet-m2-bundle by propagating Cargo features.

* add build preset / bundle configurations for wallaby and devnet-wasm.

QoL finishing touches:
- The 1:N network/features mapping in runtime/build.rs wasn't cutting it any longer.
  I expanded this data structure to M:N.
- Added docs to runtime/build.rs.

Co-authored-by: vyzo <vyzo@hackzen.org>
* adjust Wallaby parameters.

- minimum consensus power is 16GiB.
- short precommit challenge delay (10 epochs).

* fix: minimum consensus power for wallaby

Co-authored-by: Aayush <arajasek94@gmail.com>
Co-authored-by: Raúl Kripalani <raul@protocol.ai>
This change makes CI trigger whenever:
- a pull request is opened/updated
- a commit is pushed to `master` branch

The main advantage of this setup is that it enables CI runs on PRs originating from forks.
cleanup opcode definition and resolution
- removes the explicit instruction array.
- removes the undefined instructions.
- removes the need for ordering instructions in a specific way.
- ensures that we can't talk about invalid instructions.
* bump rust-toolchain to 1.63

[needed for const fn magic]

* fix new clippy warnings,
most changes is just adding `Eq` to derive, only others was avoiding reborrows and allowing a 'complex' type

* change .err.expect to .expect_err, and dont bind to a unit value

Co-authored-by: mriise <me@mriise.net>
Co-authored-by: Melanie Riise <me@mriise.net>
Fix compile when not compiling as a "fil actor" (e.g., for testing).
This change upgrades to the v4 bundler that _does not_ depend on the FVM to map actor types to IDs. Instead, it relies on the Type enum defined in this repo.

This means new actor types can be added here without having to make changes in multiple places.
Avoid blake2b hashing in wasm

Co-authored-by: Jiaying Wang <42981373+jennijuju@users.noreply.github.com>
Co-authored-by: lyswifter <ly70835@163.com>
* Optimize test_vm get_actor

Improves extend_sector_with_deals by 40%

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>

* Keep the cache across invocations

Gives another 32%

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
* refactor: move opcode handlers to appropriate modules.

* implement BASEFEE opcode handler.

* implement SELFBALANCE opcode handler.

* EVM runtime: add an initial Address type that performs ID address masking.

* EVM runtime: convert EVM errors to ActorErrors.

* EVM runtime: commented selfdestruct.

* EVM runtime: implement DIFFICULTY, NUMBER, COINBASE opcodes.

* EVM runtime: add conversion from actor ID to masked address.

Make CALLER, ADDRESS, ORIGIN use masked ID addresses.

* remove TODO.

* add comment.

* fix clippy.

* adjust test for ID address flag.
mriise and others added 14 commits December 22, 2022 12:45
* move native precompiles to their own addresses with prefix 0xfe

* fmt and remove some stale TODOs

* fix review comments

* comment style consisticy
* fix evm_delegate_call's caller bug

* use Eth address for delegate call params instead of ID address

* fmt, add test for delegatecall

Co-authored-by: samuerio <853713419@qq.com>
* disable get-randomness precompile

* only remove precompile
* Use system.send instead of system.rt.send to properly flush state before calling into another actor.
This is needed since ext* opcodes can/will be called during initcode.
Ext* calling self durin initcode must have _some_ state flushed in order to fetch it, system.send will flush empty bytecode hashes to state before send for us.

* fmt & fix tests

* add tests for ext size/hash in initcode

* clippy

* fix delegate_call test
update EAM to check for new reserved range for native precompiles addresses
* check that precompile address last byte/index is within range of precompile array to avoid panic

* clippy
* move error handling logic into call instead of from trait, remove unused CallActorError

* use err instead of flattening to empty vec right away

* fmt

* add more logging to precompile calls

* add test for empty failure

* fmt
* account for null and native precompile address in eth to f4 address conversions

* fmt & err message fix

* be explicit about rejecting null address in EAM

* add eam test for null address
@Stebalien
Copy link
Member

Can we make this PR against master first? It's not FEVM specific.

@anorth
Copy link
Member

anorth commented Jan 10, 2023

This will only actually print anything for failed tests, right?

@mriise
Copy link
Contributor Author

mriise commented Jan 10, 2023

This will only actually print anything for failed tests, right?

Depends on the env value of RUST_LOG. Default though will only print error level. It will print on successful test if log level is high enough.

@mriise mriise changed the base branch from next to master January 10, 2023 18:56
@mriise mriise changed the base branch from master to next January 10, 2023 18:56
@mriise
Copy link
Contributor Author

mriise commented Jan 10, 2023

Can we make this PR against master first? It's not FEVM specific.

It's not FEVM specific necessarily true, but most of the methods that I am logging in this PR don't exist on master or depend on FEVM related changes.

I would rather make a new PR on master with similar changes than to try and adapt this one.

@Stebalien
Copy link
Member

Unfortunately, if we don't make this PR against master first, we'll end up with annoying conflicts next time we try to merge master back into next.

It's not FEVM specific necessarily true, but most of the methods that I am logging in this PR don't exist on master or depend on FEVM related changes.

Most of them do, right?

@Stebalien
Copy link
Member

The other part of this is that this isn't an EVM specific change, so it should have up-front weigh-in from the rest of the actors/lotus team. It's easier for them to do that on PRs against master (and it'll reduce the review overhead in the final merge).

@Stebalien
Copy link
Member

Hm. Actually, this is a good time to port user_get_randomness_from_chain as well.

@Stebalien
Copy link
Member

(it'll help reduce our load merging to master)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.