Commit Graph

4480 Commits

Author SHA1 Message Date
Steven Allen
8ba491b6b4
feat: api: improve the correctness of Eth's trace_block (#11609)
* Improve the correctness of Eth's trace_block

- Improve encoding/decoding of parameters and return values:
  - Encode "native" parameters and return values with Solidity ABI.
  - Correctly decode parameters to "create" calls.
  - Use the correct (ish) output for "create" calls.
  - Handle all forms of "create".
- Make robust with respect to reverts:
  - Use the actor ID/address from the trace instead of looking it up in
    the state-tree (may not exist in the state-tree due to a revert).
  - Gracefully handle failed actor/contract creation.
- Improve performance:
  - We avoid looking anything up in the state-tree when translating the
    trace, which should significantly improve performance.
- Improve code readability:
  - Remove all "backtracking" logic.
  - Use an "environment" struct to store temporary state instead of
    attaching it to the trace.
- Fix random bugs:
  - Fix an allocation bug in the "address" logic (need to set the
    capacity before modifying the slice).
  - Improved error checking/handling.
- Use correct types for `trace_block` action/results (create, call, etc.).
  - And use the correct types for Result/Action structs instead of reusing the same "Call" action every time.
- Improve error messages.
2024-02-21 12:20:00 -08:00
Steven Allen
edb2b9584b
fix: stmgr: remove watermelon migration hack (#11623)
We did this to avoid using cached migrations in the borked watermelon
upgrade on calibrationnet, but we don't need to keep this in the
code (even for users syncing from scratch).
2024-02-21 10:32:22 -08:00
Łukasz Magiera
9ddfe23702 lp: Small migration improvements 2024-02-16 21:23:19 +01:00
Rod Vagg
cd19c2a08d
Clean up warning message (#11619) 2024-02-13 09:36:50 -08:00
Steven Allen
ca877940a0
feat: fvm: update the FVM/FFI to v4.1 (#11608)
This:

1. Adds nv22 support.
2. Updates the message tracing format.
2024-02-06 17:22:14 -08:00
Ian Norden
95fb198597
perf: api: add indexes to event topics and emitter addr (#11477)
* add index to event_entry.key

* add index to event.emitter_addr
2024-01-31 10:49:07 -08:00
Steven Allen
efb9422c01
fix: eth: re-execute tipsets on missing events (#11588)
This will re-execute tipsets to forcibly re-compute and store events
when they're missing. This is effectively lazy backfilling of events.

NOTE: This _won't_ backfill the index itself, it'll just give us the
events.

fixes #11335
2024-01-30 10:29:54 -08:00
Steven Allen
4d73febaf7
chore: sync: cleanup sync serve and reduce log noise (#11543)
* chore: cleanup sync serve and reduce log noise

1. Demote a noisy blocksync request error to debug. All this warning
means is that someone is requesting a tipset we don't have.
2. Add a separate warning if we fail to collect a chain. If we have the
tipsets but fail to collect the chain, something is actually wrong.
3. Fix a TODO and return a single CompactedMessages rather than 4
separate values.

* generally reduce the warning to info

It turns out we do fail to gather messages frequently as well, likely
because we have written the tipsets but haven't fetched the messages...
2024-01-29 11:17:05 -08:00
Steven Allen
6cbeb9aad6
fix: sync: atomically switch chains when checkpointing (#11595)
We can now atomically switch chains when checkpointing. Previously,
we'd call `SetHead` followed by `SetCheckpoint`. Unfortunately, that's
not atomic and the "head" could have reverted before we called
`SetCheckpoint` (causing the latter to fail).

Now, we just call `SetCheckpoint` and let `SetCheckpoint` adjust our
head. This changes the behavior of `ChainStore.SetCheckpoint`, but
`Syncer.SyncCheckpoint` is the only caller anyways.
2024-01-26 08:50:32 -08:00
Aayush
6a6b03ef40 feat: drand: refactor round verification 2024-01-24 19:15:36 -05:00
Steven Allen
61cfb51674 fix: fill in power-base & replaced-day-reward in state getter
see #11586
2024-01-17 16:23:12 -08:00
Aayush
c86f5a1b2b fix: chain: use latest go-state-types types for miner UI 2024-01-11 10:37:13 -05:00
Jiaying Wang
6fb300b460 Merge pull request #11565 from filecoin-project/asr/harden-sync
feat: exchange: change GetBlocks to always fetch the requested number of tipsets
2024-01-11 11:29:31 +01:00
Jiaying Wang
512c70bb39
Merge pull request #11565 from filecoin-project/asr/harden-sync
feat: exchange: change GetBlocks to always fetch the requested number of tipsets
2024-01-11 18:13:10 +08:00
Aayush
170b9844ef feat: exchange: change GetBlocks to always fetch the requested number of tipsets 2024-01-10 12:04:52 -05:00
Łukasz Magiera
92b67334ae Merge remote-tracking branch 'origin/master' into misc/drop-raft-experiment 2024-01-09 15:39:41 +01:00
Steven Allen
156a3a400c
fix: Eth API: accept input data in call arguments under field 'input' (#11505)
The correct name for this field is 'input' according to the Ethereum specs [0].
However, for the longest time, clients have been using 'data' and servers have been
lenient to accept both, preferring 'input' over 'data' when both appear.

Our lack of support for 'input' had gone unnoticed until go-ethereum decided
to adjust their ethclient implementation to issue eth_call and eth_estimateGas
requests with the 'input' field instead of 'data' [1]. This suddenly broke apps
using this client against Lotus' Eth API.

[0]: https://github.com/ethereum/execution-apis/blob/main/src/schemas/transaction.yaml#L33-L35
[1]: ethereum/go-ethereum#28078

Co-authored-by: raulk <raul.kripalani@gmail.com>
2024-01-06 15:42:52 -08:00
Aayush Rajasekaran
b1c0d3cce5 fix: sync: do not include incoming in return of syncFork (#11541) 2024-01-04 15:36:39 +01:00
Aayush Rajasekaran
ee7c251a90 Merge pull request #11533 from filecoin-project/asr/speedup-fork-sync
feat: syncer: optimize syncFork for one-epoch forks
2024-01-04 15:35:42 +01:00
Aayush Rajasekaran
bfc26cdc18
fix: sync: do not include incoming in return of syncFork (#11541) 2023-12-19 13:39:52 -08:00
Aayush
e473571dfb feat: syncer: optimize syncFork for one-epoch forks 2023-12-15 14:02:17 -05:00
Steven Allen
7caaa60992 fix: exchange: explicitly cast the block message limit const (#11511)
It's not a const for the testground build, and needs to be an int 99%
of the time. So we might as well just cast here.
2023-12-09 22:32:13 +08:00
Steven Allen
f2a4891ada
fix: exchange: explicitly cast the block message limit const (#11511)
It's not a const for the testground build, and needs to be an int 99%
of the time. So we might as well just cast here.
2023-12-09 23:24:43 +09:00
Steven Allen
f086374233 fix lints 2023-12-09 21:20:19 +08:00
Steven Allen
2b771693eb fix: exchange: allow up to 10k messages per block
Also explicitly limit how many bytes we're willing to read in one go
such that we're capable of reading a worst-case tipset (like, really,
never going to happen worst-case). Previously, this wasn't an issue.
However, we've bumped the max number of messages from 8,192 to 150,000
and need to limit allocations somewhere else.
2023-12-09 21:19:55 +08:00
Łukasz Magiera
7f684ec840
Merge pull request #11506 from filecoin-project/steb/fix-exchange-message-length
fix: exchange: allow up to 10k messages per block
2023-12-09 11:31:03 +01:00
Steven Allen
88e90aaa44 fix lints 2023-12-09 18:21:22 +09:00
Steven Allen
986f240d91 fix: exchange: allow up to 10k messages per block
Also explicitly limit how many bytes we're willing to read in one go
such that we're capable of reading a worst-case tipset (like, really,
never going to happen worst-case). Previously, this wasn't an issue.
However, we've bumped the max number of messages from 8,192 to 150,000
and need to limit allocations somewhere else.
2023-12-09 18:08:32 +09:00
Andrew Jackson (Ajax)
e102e4f31f
Merge branch 'master' into feat/sturdypost 2023-11-29 17:15:42 -06:00
Łukasz Magiera
e425322c2b misc: Drop the raft-cluster experiment 2023-11-29 17:28:46 +01:00
Fridrik Asmundsson
a3417e7488 Make block param to EthEstimateGas optional 2023-11-29 10:26:22 +00:00
Łukasz Magiera
231b2070d4
feat: chain import: don't walk to genesis - 2-3x faster snapshot import (#11446)
* chain import: don't walk to genesis

* fix daemon build

* fast snapshot genesis: address review
2023-11-25 13:29:57 -08:00
Andrew Jackson (Ajax)
37d5d59ecc lp: fix: migrate 0 panic 2023-11-24 11:00:32 -06:00
Łukasz Magiera
16cc24443f Merge remote-tracking branch 'origin/master' into chore/master-into-sturdy 2023-11-22 17:26:37 +01:00
jennijuju
aea0718ef8 bump libp2p version to v0.30 2023-11-21 22:10:40 +08:00
Steven Allen
9b4df6a4d0
fix: eth: use the correct state-tree when resolving addresses (#11387)
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
2023-11-17 18:20:31 +01:00
Aarsh Shah
943bf8be2c feat: chain: light-weight patch to fix calibrationnet again by removing move_partitions from built-in actors (#11409)
* 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>
2023-11-15 13:08:24 -05:00
Aarsh Shah
808a6e9226
feat: chain: light-weight patch to fix calibrationnet again by removing move_partitions from built-in actors (#11409)
* 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>
2023-11-15 13:07:26 -05:00
Aayush
5b5dd525f5 skip migration cache correctly 2023-11-09 14:14:46 -05:00
Aayush
410bdc389e fix: nv21fix migration: correctly upgrade system actor 2023-11-09 14:14:41 -05:00
Andrew Jackson (Ajax)
23ba7faa84 Merge branch 'release/v1.25.0' into feat/sturdypost 2023-11-08 11:24:17 -06:00
Aayush Rajasekaran
292e19893f
Merge pull request #11396 from filecoin-project/phi-backport-11395-v1240
chore: backport #11395 to release/v1.24.0
2023-11-08 11:48:47 -05:00
Aayush Rajasekaran
ce6cbcbf2b
Merge pull request #11397 from filecoin-project/phi-backport-11395-v1250
chore: backport #11395 to release/v1.25.0
2023-11-08 11:48:44 -05:00
Aayush
65591841f9 skip migration cache correctly 2023-11-08 17:14:02 +01:00
Aayush
ba98d63c41 fix: nv21fix migration: correctly upgrade system actor 2023-11-08 17:13:55 +01:00
Aayush
ae75aa1d0d skip migration cache correctly 2023-11-08 10:26:15 -05:00
Aayush
fb3c16207f fix: nv21fix migration: correctly upgrade system actor 2023-11-08 08:11:27 -05:00
Phi
5f3eb793ed Move premigration to 90 minutes
Move premigration to 90 minutes before upgrade epoch.
2023-11-08 10:27:29 +01:00
Phi
a75f3b7acb Move premigration to 90 minutes
Move premigration to 90 minutes before upgrade epoch.
2023-11-08 10:23:58 +01:00
Phi
24a714d123 Move premigration to 90 minutes
Move premigration to 90 minutes before upgrade epoch.
2023-11-08 08:22:15 +01:00
Andrew Jackson (Ajax)
848c20d15f Merge branch 'master' into feat/sturdypost 2023-11-06 16:10:57 -06:00
Phi-rjan
12b30c0069
Merge pull request #11361 from filecoin-project/feat/add-mpool-metrics
feat: metric: export Mpool message count
2023-11-03 14:44:19 +01:00
Phi
d121760172 Record currentSize on addLocked
Record currentSize on addLocked
2023-11-03 08:59:01 +01:00
Aayush Rajasekaran
b7a3da4319 fix: sync: iterate over returned messages directly (#11373) 2023-11-02 07:57:22 +08:00
Aayush Rajasekaran
71ba2e4ac4 fix: sync: iterate over returned messages directly (#11373) 2023-11-01 15:13:45 -07:00
Aayush Rajasekaran
29fbfaf13d
fix: sync: iterate over returned messages directly (#11373) 2023-11-01 15:08:23 -07:00
Aayush Rajasekaran
ce0c1d834f feat: chain: light-weight patch to fix calibrationnet (#11363)
* 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
2023-10-31 18:36:05 -04:00
Aayush Rajasekaran
51266c3125 feat: chain: light-weight patch to fix calibrationnet (#11363)
* 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
2023-10-31 18:35:12 -04:00
Aayush Rajasekaran
77b6b7ef10
feat: chain: light-weight patch to fix calibrationnet (#11363)
* 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
2023-10-31 18:29:09 -04:00
Phi
d1b8af338e Export Mpool-count
Record the current size of the mpool and export through Prometheus
2023-10-31 08:09:00 +00:00
Steven Allen
48a3076876
test: drand: switch tests to drand testnet (from devnet) (#11359)
At the request of the drand team.
2023-10-30 17:05:02 -07:00
Alejandro Criado-Pérez
b6a77dfafc
Fix/texts (#11298)
* documentation text corrections

* Text corrections in go files

* make docsgen-cli
2023-10-27 11:32:42 -07:00
Łukasz Magiera
ad9c05e30b lpwindow: Simple adder 2023-10-25 20:58:16 +02:00
Łukasz Magiera
c9e5720f68 chain: Undo exporting TipSetKey Value 2023-10-25 10:56:56 +02:00
Ian Norden
84b07519c2
fix: api: exclude reverted events in eth_getLogs results (#11318)
* exclude reverted events from results returned by eth_getLogs

* unit test

* update CHANGELOG.md
2023-10-24 10:05:20 -07:00
guangwu
2d8dbf5bc1
chore: slice loop replace (#11349) 2023-10-24 10:02:28 -07:00
Andrew Jackson (Ajax)
2bc4951d79 Merge branch 'release/v1.24.0' into release/v1.25.0 2023-10-17 10:19:51 -05:00
Aayush
5e76b05b17 Merge branch 'feat/nv21' into asr/merge-feat-nv21 2023-10-16 11:13:33 -04:00
Aayush
2a644e2c04 feat: limit PoSted partitions to 3 2023-10-11 12:41:55 -04:00
Łukasz Magiera
861134d923
mpool: Fix CapGasFee maxFee handling
Co-authored-by: Aayush Rajasekaran <arajasek94@gmail.com>
2023-10-11 16:49:00 +02:00
Aayush
00aad34194 messagepool: refactor CapGasFee logic to be cleaner 2023-10-10 11:20:26 -04:00
Andrew Jackson (Ajax)
598e9b931d Merge branch 'feat/wdpost-adder' into wdpost-can-accept 2023-10-06 11:48:04 -05:00
Shrenuj Bansal
f01096bca3 wip 2023-10-05 11:52:22 -04:00
Łukasz Magiera
444e75ef77 feat: mpool/wdpost: Maximize feecap config 2023-10-03 11:32:49 +02:00
Andrew Jackson (Ajax)
ea035f4a7f lint, db timout, cfg rm 2023-09-29 11:56:10 -05:00
Steven Allen
c6debaadf0 make gen 2023-09-23 17:54:44 -04:00
Aayush
04ebd5177c refactor: GetMaxSectorExpirationExtension depends on network version 2023-09-23 14:09:25 -04:00
Andrew Jackson (Ajax)
632bf15b82 build oops 2023-09-22 18:08:19 -05:00
Andrew Jackson (Ajax)
a888b6320c harmonytask bump http protocol spec & lints 2023-09-22 18:06:26 -05:00
Łukasz Magiera
ac85a2e23b
Merge pull request #11171 from ipfs-force-community/opt/remove-repeat-check
opt: fix duplicate check exitcode
2023-09-22 14:52:34 +02:00
Andrew Jackson (Ajax)
a520ee85d6 master-to-sturdy 2023-09-21 10:37:02 -05:00
Łukasz Magiera
3f076bfc16 fix exec traces with new ffi 2023-09-19 11:58:13 +02:00
Icarus9913
2a8ea957fa stop using go-libp2p deprecated peer.ID.Pretty
Signed-off-by: Icarus9913 <icaruswu66@qq.com>
2023-09-12 13:13:34 +08:00
Phi
024dd5e08e Merge branch 'feat/nv21' into feat/implement-SyntheticPoRep 2023-09-08 16:41:39 +02:00
Mikers
5e5a81bf23
add go linter - "unused" (#11235)
* add go linter - "unused"

* use _ to name unused but needed padding variable

* remove unused code

* add queue test to appease unused linter

* remove unused code in test

* remove unused func

* remove unused struct identified by linter

* remove unused variable

* remove unused code

* remove unused file

* remove unused struct

* remove unused function

* remove unused observe peers function in raft

* remove unused declareFaults function

* annotate nolint:unused on needed methods
2023-09-05 12:19:43 -10:00
Łukasz Magiera
4ee20965fa chore: chain/actors: Use type proxies instead of versioned GST imports 2023-08-29 15:28:16 +02:00
Fridrik Asmundsson
ed407689e6 Parse input/output for delegate call + other smaller things 2023-08-28 17:48:22 +00:00
Fridrik Asmundsson
029a4a72b8 Address most recent comments 2023-08-28 17:48:22 +00:00
Fridrik Asmundsson
ee3cdf0e97 Fix use filecoin addr + other small refactor
After changing in prev commit to use to ethereum addresses the
comparison does not make sense against builtin actors. This
fixes that by storing also the filecoin addresses in each trace

Also renamed filecoin related fields to Filecoin prefix.

Also remove requirement call to InvokeContract needed to come
from a evm actor
2023-08-28 17:48:22 +00:00
Fridrik Asmundsson
cf255127a4 Decode eth param/return values and change them to ethbytes type 2023-08-28 17:48:22 +00:00
Fridrik Asmundsson
8d8891a431 Moved tracing types to ethtypes to address circular dependencies 2023-08-28 17:48:22 +00:00
Fridrik Asmundsson
ef7bcfec06 Do not compute message index as traces should be in message execution order 2023-08-28 17:48:22 +00:00
Fridrik Asmundsson
4068e0710d Do not return interface{} from trace api methods 2023-08-28 17:48:22 +00:00
Fridrik Asmundsson
1b0f54a61b Add new tracing API 2023-08-28 17:48:22 +00:00
Aayush Rajasekaran
c4214e23bf
Merge pull request #11206 from AnomalRoil/fix/ctxonlongops
fix: chain: cancel long operations upon ctx cancelation
2023-08-28 13:33:08 -04:00
Aayush Rajasekaran
1c9344d805
Merge pull request #11202 from gammazero/fix/update-cached-message-sequence
fix: chain: Do not update message info cache until after message validation
2023-08-24 10:59:47 -04:00
Łukasz Magiera
ae2ae3b9ed
Merge pull request #11189 from filecoin-project/update-go-libp2p-v0300
update go-libp2p to v0.30.0
2023-08-24 16:15:26 +02:00
Yolan Romailler
13ade62e27 fix: cancel long operations upon ctx cancelation 2023-08-24 15:30:33 +02:00
gammazero
03826aac87 fix doc check 2023-08-23 19:05:21 -07:00
gammazero
7774ca0179 Add sequence number DoS test 2023-08-23 16:53:21 -07:00