When translating "native" messages to Ethereum transactions, correctly handle parameters:
1. If the message looks like a valid "create external", treat it as a contract creation.
2. If it looks like a valid EVM invocation, decode it as such.
3. Otherwise, ABI-encode the parameters to make them look like a "handle_filecoin_method" call. This
will help chain explorers recognize these messages.
Part of #11355
We need to always use the state-tree from the tipset _after_ the message
executed. If we use any other state-tree, we might not find the address
we're trying to resolve.
This change also has some implication for pending messages: there's no
guarantee we'll be able to generate a 0x-style address for a pending
native message. So, instead of trying, I've removed support for pending
native messages from the Eth API. Messages from EthAccounts will still
work, and native messages will still show up in blocks/traces, they just
won't show up as "pending". Which should affect exactly nobody.
I'm also taking this opportunity to cleanup some edge-cases:
1. Pass contexts where appropriate.
2. Remove all state access from `ethTxHashFromSignedMessage`.
Part of #11355
We added this check as a self-test to make sure that the message indices
in our trace matched up with those in the block. Unfortunately, this
only works for blocks on the main-chain, and breaks tracing of uncle
blocks (and tracing of head).
* upgrade calibnet by removing move_partitions from miner actor in actor v12
* cids for buggy bundles
* revert changes to v12 tar
* upgrade system actor state
* update based on manifest
* nit: clean up some comments
* chore: rename param to oldBuggyMinerCID
* refactor, ensure both buggy bundles are loaded
* update to actors v12.0.0-rc.3
* fix: load second buggy bundle for UpgradeWatermelonFixHeight
* add calibration fix2 upgrade epcoh
* update mainnet upgrade epoch
---------
Co-authored-by: Aayush <arajasek94@gmail.com>
Co-authored-by: jennijuju <jiayingw703@gmail.com>
* chore: eth: move & rename input/output encoding functions
These are shared functions, so I'm moving them to the utils library.
* fix: eth: correctly encode and simplify native input/output encoding
When generating eth traces, we encode "native" message inputs/outputs
to "solidity ABI" by formatting the inputs/outputs the same way we do in
FEVM's "handle_native_method". However, we had quite a few bugs with the
implementation:
1. We were right-aligning 64bit values in 256bit words, instead of
left-aligning (as we should given that these values are big-endian).
2. The return-value encoding wasn't correctly handling lengths.
This patch:
1. Fixes those bugs.
2. Deduplicates the logic (we're doing _basically_ the same thing in
both cases).
3. Removes all error paths (these functions can't fail).
- Added a goroutine to listen for interrupt signals, which will cancel the current context when an interrupt signal is received. This allows for graceful shutdown of ongoing operations.
* refactor: make GetEmbeddedBuiltinActorsBundle take network bundle name
* update calibnet actor bundle to v12.0.0-rc.2, but include v12.0.0-rc.1 as calibrationnet-buggy.car
* wip: calibnet unbork migration
* calibnet: add buggy miner actor CID to actorMeta
* fix incorrect buggy calibnet manifest
* make UpgradeWatermelonFixHeight a build param
* calibnet patch: check whether network is calibration from init actor state
* add sanity checks to the v12 calibnet patch upgrade
* address review