Commit Graph

4069 Commits

Author SHA1 Message Date
Aayush
4e57626e42 feat: update renew-sectors with FIP-0045 logic 2023-03-02 16:38:05 -05:00
Steven Allen
dbbcf4b2ee
feat: vm: switch to the new exec trace format (#10372)
This is now "FVM" native. Changes include:

1. Don't treat "trace" messages like off-chain messages. E.g., don't
include CIDs, versions, etc.
2. Include IPLD codecs where applicable.
3. Remove fields that aren't filled by the FVM (timing, some errors,
code locations, etc.).
2023-03-01 16:02:18 -08:00
Aayush
19f1ad2762 Merge branch 'releases' into asr/merge-release-into-master 2023-03-01 14:18:35 -05:00
Steven Allen
68b401a895 fix: cli: better handle sending from EthAccount actors
This will make `lotus send` mostly just "do what the user wants" in this
case:

1. The user may not explicitly specify a method number.
2. Parameters are automatically cbor-encoded where applicable.
3. The method number is automatically selected based on the
   recipient (CreateExternal if sent to the EAM, InvokeEVM otherwise).
2023-02-24 15:15:41 -08:00
Łukasz Magiera
ea57a1aec3 Merge remote-tracking branch 'origin/master' into hsanjuan/chain-export-range-rebased 2023-02-23 13:08:14 +01:00
Travis Person
bf2ac13609
Merge pull request #10283 from filecoin-project/feat/disable-pre-migrations
feat: stmgr: add env to disable premigrations
2023-02-21 09:23:13 -08:00
Travis Person
2dcaddf61d feat: stmgr: add env to disable premigrations
Setting the environment variable `LOTUS_DISABLE_PRE_MIGRATIONS=1` will
discard premigrations for all upgrade.
2023-02-17 23:12:26 +00:00
Aayush Rajasekaran
1ec02c5c95
Merge pull request #10296 from filecoin-project/asr/migration-test
feat: shed: test the nv18 migration
2023-02-17 16:20:51 -05:00
Aayush
984b4c78cb Merge branch 'release/v1.20.0' into asr/merge-release-into-master 2023-02-17 16:08:22 -05:00
Aayush Rajasekaran
efcdec6517
Merge pull request #10300 from filecoin-project/steb/fix-eth-nonce
fix: eth: return the correct nonce from EthGetTransactionCount
2023-02-17 14:45:45 -05:00
Steven Allen
a3bc65ba05 fix: eth: return the correct nonce from EthGetTransactionCount
EVM contracts track this number internally.

fixes https://github.com/filecoin-project/lotus/issues/10255
2023-02-17 10:51:42 -08:00
Jorropo
2d3065ae8e chore: all: bump go-libipfs to replace go-block-format
Includes changes from:
- https://github.com/ipfs/go-block-format/pull/37
- https://github.com/ipfs/go-libipfs/pull/58

(cherry picked from commit f572852d06)
2023-02-17 18:46:11 +01:00
Aayush
fab7ea6ca1 feat: shed: test the nv18 migration 2023-02-17 11:09:52 -05:00
Steven Allen
00b6d06041
feat: eth: parse revert data (#10295)
We don't really want to do this in the FVM because it's Ethereum
specific, but this makes sense to do in the Ethereum API.

See:

See https://docs.soliditylang.org/en/latest/control-structures.html#panic-via-assert-and-error-via-require
2023-02-17 01:18:03 +00:00
Aayush
75c744a438 Merge branch 'release/v1.20.0' 2023-02-14 20:29:14 -05:00
Hector Sanjuan
1bb698619c Ranged-export: Remove CachingBlockstore
The improvements in the range-export code lead to avoid reading most blocks
twice, as well as to allowing some blocks to be written to disk multiple times.

The cache hit-rate went down from being close to 50% to a maximum of 12% at
the very end of the export. The reason is that most CIDs are never read twice
since they are correctly tracked in the CID set.

These numbers do not support the maintenance of the CachingBlockstore
code. Additional testing shows that removing it has similar memory-usage
behaviour and about 5 minute-faster execution (around 10%).

Less code to maintain and less options to mess up with.
2023-02-14 21:08:10 +01:00
Hector Sanjuan
fa93c23813 Chain ranged export: rework and address current shortcomings
This commit moderately refactors the ranged export code. It addresses several
problems:
  * Code does not finish cleanly and things hang on ctrl-c
  * Same block is read multiple times in a row (artificially increasing cached
    blockstore metrics to 50%)
  * It is unclear whether there are additional races (a single worker quits
    when reaching height 0)
  * CARs produced have duplicated blocks (~400k for an 80M-blocks CAR or
    so). Some blocks appear up to 5 times.
  * Using pointers for tasks where it is not necessary.

The changes:

  * Use a FIFO instead of stack: simpler implementation as its own type. This
has not proven to be much more memory-friendly, but it has not made things
worse either.
  * We avoid a probably not small amount of allocations by not using
    unnecessary pointers.
  * Fix duplicated blocks by atomically checking+adding to CID set.
  * Context-termination now works correctly. Worker lifetime is correctly tracked and all channels
  are closed, avoiding any memory leaks and deadlocks.
  * We ensure all work is finished before finishing, something that might have
  been broken in some edge cases previously. In practice, we would not have
  seen this except perhaps in very early snapshots close to genesis.

Initial testing shows the code is currently about 5% faster. Resulting
snapshots do not have duplicates so they are a bit smaller. We have manually
verified that no CID is lost versus previous results, with both old and recent
snapshots.
2023-02-14 21:08:10 +01:00
Jiaying Wang
86b4aeef1a
Merge pull request #10258 from filecoin-project/steb/fix-msg-modify
fix: stmgr: copy the message before modifying it
2023-02-14 10:07:24 -05:00
frrist
21efd481d8 First efficient ranged-export implementation by @frisst
This first commit contains the first and second implementation stabs (after
primary review by @hsanjuan), using a stack for task buffering.

Known issues: ctrl-c (context cancellation) results in the export code getting
deadlocked. Duplicate blocks in exports. Duplicate block reads from store.

Original commit messages:

works

works against mainnet and calibnet

feat: add internal export api method

- will hopfully make things faster by not streaming the export over the json rpc api

polish: better file nameing

fix: potential race in marking cids as seen

chore: improve logging

feat: front export with cache

fix: give hector a good channel buffer on this shit

docsgen
2023-02-14 15:41:10 +01:00
raulk
11ac325d1a
Revert "fix: stmgr: check message validity before invoking vm" (#10270)
This reverts commit 2bbd1fbbb6.
2023-02-14 14:06:33 +00:00
Aayush Rajasekaran
3c4a83916b
Merge pull request #10259 from filecoin-project/steb/call-check-message-validity
fix: stmgr: check message validity before invoking vm
2023-02-13 21:29:19 -05:00
ychiao
0d92c746bd
Eth JSON-RPC: populate reward in eth_feeHistory (#10245)
Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com>
Co-authored-by: Raúl Kripalani <raul@protocol.ai>
2023-02-14 01:02:37 +00:00
Steven Allen
a16c54051c
fix: eth: rename yParity to v in transaction return values (#10264)
fixes https://github.com/filecoin-project/ref-fvm/issues/1662
2023-02-13 23:29:13 +00:00
Steven Allen
2bbd1fbbb6 fix: stmgr: check message validity before invoking vm
Otherwise we may, e.g., try to estimate gas on a message to an f4
address before the nv18 migration.

I'm _not_ checking the "prior messages" here as this is just a sanity
check.
2023-02-13 11:01:42 -08:00
Steven Allen
f427c2b566
fix: eth: correctly convert filecoin message <-> eth txn (#10257)
1. We do allow deploying with empty initcode.
2. Make sure that the encoded "code" is non-empty, if specified.

Basically, this makes everything consistent (and it's how I specified it
in the FIP).
2023-02-13 10:33:59 -08:00
Steven Allen
77fbc60cb8 fix: stmgr: copy the message before modifying it 2023-02-13 10:06:59 -08:00
Raúl Kripalani
8ff55c027e Merge branch 'release/v1.20.0' into asr/merge-release-into-master 2023-02-13 11:45:09 +00:00
raulk
37e1ac5d93
eth: FIP-0055: implement final version of transitory delegated signature. (#10239) 2023-02-12 21:08:42 +00:00
Aayush
63b03a48d0 Merge branch 'release/v1.20.0' into asr/merge-release-into-master 2023-02-10 18:39:51 -05:00
ychiao
db749b8fc7 Merge branch 'release/v1.20.0' into fix/EthUint64-args 2023-02-10 17:26:38 -05:00
Steven Allen
01e616f29e
fix: stmgr: make the tipset and height agree when estimating gas (#10216)
* fix: stmgr: make the tipset and height agree when estimating gas

Specifically re-execute all messages in the current tipset, tacking the new
message onto the end. That way, the epoch is the epoch of the current tipset.

We could try to "make" a fake block and use that, but that's unlikely to
work well.

* fix: stmgr: only apply tipset messages for CallWithGas

* fix: itest: window post dispute
2023-02-10 20:49:26 +00:00
ychiao
5e56af33df fix typo 2023-02-10 13:52:25 -05:00
ychiao
3c580403c1 implement itest and handle optional params 2023-02-10 13:33:59 -05:00
ychiao
37044ed3c3
Apply suggestions from code review
Co-authored-by: raulk <raul@protocol.ai>
2023-02-10 10:42:19 -05:00
Steven Allen
ece8f25511 fix: eth: strict event parsing
We now enforce the following rules:

1. No duplicate topics or data.
2. Topics must have 32 byte keys.
3. Topics may not be skipped. (e.g., no t1 & t3 without a t2).
4. Raw codecs.

We _don't_ require that topics/data be emitted in any specific order.

We _skip_ events with unknown keys. We _drop_ events that violate the
above rules.
2023-02-10 07:41:29 -08:00
Steven Allen
f1381ad535 refactor: use EthHash for event topics
This ensures they're always 32 bytes and padded, as required.
2023-02-10 07:41:29 -08:00
Łukasz Magiera
1588dd3dbe
Merge pull request #10227 from filecoin-project/fix/signing-noexport
fix: Don't call WalletExport in msg signing flows
2023-02-10 16:21:24 +01:00
Raúl Kripalani
e06e3a0654 Merge branch 'release/v1.20.0' into fix/EthUint64-args 2023-02-10 12:49:02 +00:00
Steven Allen
80fccba93f
fix: gas: update ffi & correct the message inclusion cost in nv18 (#10228)
Co-authored-by: Raúl Kripalani <raul@protocol.ai>
2023-02-10 12:48:20 +00:00
Łukasz Magiera
088d231cda fix: Don't call WalletExport in msg signing flows 2023-02-10 02:37:59 +01:00
Raúl Kripalani
d30ace0518 Merge branch 'release/v1.20.0' into raulk/timestamp-null-rounds 2023-02-09 22:58:08 +00:00
Steven Allen
a83f120f32 fix: chain: make sure the head is empty, not the code 2023-02-09 11:36:02 -08:00
Łukasz Magiera
0f05232199
Merge pull request #10224 from filecoin-project/feat/ethcli-strip-spaces
feat: eth cli: Strip out empty spaces around contract bytes
2023-02-09 19:24:49 +01:00
Jiaying Wang
1c13a591e9
Merge pull request #10223 from filecoin-project/feat/ethtx-fixes
fix: ethrpc: Add missing fields to EthTx
2023-02-09 13:13:26 -05:00
Łukasz Magiera
75f9b7d040
Merge pull request #10119 from filecoin-project/gstuart/tx-hash-on-simport-napshot
feat: eth: populate tx hash database on startup
2023-02-09 19:06:20 +01:00
Łukasz Magiera
b0fa75f13e feat: eth cli: Strip out empty spaces around contract bytes 2023-02-09 18:49:08 +01:00
Łukasz Magiera
cb8e2836bb
Merge pull request #10184 from filecoin-project/asr/merge-release-into-master
chore: merge release/v1.20.0 into master
2023-02-09 16:41:58 +01:00
Łukasz Magiera
e321761a72 ethrpc: Add missing fields to EthTx 2023-02-09 14:26:13 +01:00
Łukasz Magiera
554dd2f1ee itests: Test EVM bytecode getters, check bytecode hash 2023-02-09 13:23:17 +01:00
Łukasz Magiera
8d6aa2477c feat: actors: Add bytecode getter 2023-02-09 13:12:16 +01:00