3606 Commits

Author SHA1 Message Date
945451c528 feat(miner): remove batch balancer-related functionality (#12919)
Closes: https://github.com/filecoin-project/lotus/issues/12902
2025-03-19 16:07:32 +11:00
36b2478fdb feat(fip0100): updates to FIP including Teep->Tock 2025-03-19 13:43:52 +11:00
637e21519d chore(fees): add initial fees & migration testing (FIP-0100) (#12942) 2025-03-19 13:43:52 +11:00
79206a00eb chore: upgrade to go-f3 v0.8.3 (#12941)
Upgrade to go-f3 `v0.8.3`

Upgrade to the latest go-f3, to bubble up:
* various bug fixes
* extended manifest parameters for better control in passive testing

Note that the return type from F3GetProgress API has changed to now
include the input chain to an instance.

Update CLI templates to print the additional fields.
2025-03-17 17:34:33 +00:00
926d924d3e feat: add Agent to Filecoin.Version ! (#12953)
feat: add Agent to `Filecoin.Version`
2025-03-14 13:09:04 +00:00
5273b3050e fix: f3: topic filter with no static manifest
Signed-off-by: Jakub Sztandera <oss@kubuxu.com>
2025-03-10 15:44:48 +01:00
48cd35195a fix: allow users to optionally configure node startup even if index reconciliation fails (#12930)
* optional index start on reconciliation failure

* warning

* fix ChangeLog

* fix make gen

* fix compilation
2025-03-06 11:43:38 +04:00
e894b7f52d feat: add GenesisTimestamp to NetworkParams (#12925) 2025-02-28 12:45:43 +01:00
685c83aa53 Address review
Signed-off-by: Jakub Sztandera <oss@kubuxu.com>
2025-02-19 18:49:02 +01:00
96684f7c68 Add StateCall to StateModuleAPI, it is already provided by Gateway
Signed-off-by: Jakub Sztandera <oss@kubuxu.com>
2025-02-19 18:49:01 +01:00
f3e0cf7a42 Fix the builder
Signed-off-by: Jakub Sztandera <oss@kubuxu.com>
2025-02-19 18:49:00 +01:00
be8e782853 WIP: f3-activation-contract integration
Includes shed tool for debuging, the tool could be re-written to use the
the ContractManifestProvider.

Integration of ContractManifestProvider into the existing manifest
pipeline is missing.

Signed-off-by: Jakub Sztandera <oss@kubuxu.com>
2025-02-19 18:49:00 +01:00
8972194753 fix: Only run F3 on full nodes
It has no chance of working on lite nodes right now

Signed-off-by: Jakub Sztandera <oss@kubuxu.com>
2025-02-19 18:48:54 +01:00
5f0f5853bf chore: upgrade to the latest go-f3 and allow F3 chain exchange topics (#12893)
Upgrade to the latest go-f3 and allow F3 chain exchange topics

Upgrade to the latest `go-f3` and add the F3 chain exchange topics to
the allowed topic list for both static and dynamic manifests.

Fixes https://github.com/filecoin-project/go-f3/issues/809
2025-02-12 14:43:23 +00:00
b1376cfbd2 feat(api)!: expose StateGetNetworkParams in Lotus Gateway API and remove SupportedProofTypes (#12881)
* refactor(api)!: remove SupportedProofTypes from StateGetNetworkParams

Breaking change: The SupportedProofTypes field has been removed from StateGetNetworkParams. This field was unreliable as it didn't match  the FVM's actual supported proofs and was frequently overlooked during proof type updates

* feat: expose StateGetNetworkParams in Lotus Gateway API

feat: expose StateGetNetworkParams in Lotus Gateway API

* chore: update changelog

chore: update changelog
2025-02-10 08:36:54 +01:00
a90ee17282 refactor(eth): attach ToFilecoinMessage converter to EthCall. (#12844) 2025-01-24 20:37:13 +01:00
edfa817daf chore(eth): refactor eth API module into separate pieces in new pkg (#12796) 2024-12-20 08:32:46 +00:00
a5847457fd feat: add network tag to metrics (#12733) 2024-12-18 06:16:43 +00:00
7f2068efc3 fix(f3): test API during inactive-F3 modes and make consistent and safe (#12781)
Closes: https://github.com/filecoin-project/lotus/issues/12772
2024-12-13 22:48:45 +11:00
9bfd0b4295 chore: remove IPNI advertisement relay over pubsub via Lotus node (#12768)
The initial implementation of IPNI used GossipSub as a way to propagate
IPNI advertisement chain. To do this the propagation had to be relayed
through the Lotus node due to strict Filecoin GossipSub validation
rules.

Since then IPNI has moved on to roll out its own sync protocol that
works over HTTP, and HTTP-over-libp2p. This move has been the official
way of advertising content to IPNI federation over a year now.

Therefore, remove the ad relay over pubsub via Lotus node as it is now
considered to have reached its EOL as a mechanism for advertising to
IPNI.
2024-12-10 12:56:04 +00:00
a704e4710d chore: delete STM annotations (#12752)
Signed-off-by: Jakub Sztandera <oss@kubuxu.com>
2024-12-05 16:45:07 +11:00
0857ce54dc chore: bump deps, set calibnet nv25 epoch, change nv25-codename (#12754)
* chore: update codename for nv25 to "Teep"
* chore: set upgrade epoch for Calibration net
* chore: fix GenesisNetworkVersion for butterfly
* chore: set upgrade height for butterflynet
* chore: update to builtin-actors v16.0.0-rc1
* chore: update go-state-types to v0.16.0-rc1
* chore: update filecoin-ffi to v1.32.0-rc1
2024-12-05 15:04:46 +11:00
c6d2e700ab fix(eth_trace): don't decode return value in EAM create error case (#12730)
Fixes: https://github.com/filecoin-project/lotus/issues/12731
2024-12-03 16:53:09 +00:00
64736eaab0 feat: api: market pending proposal API/CLI (#12724) 2024-11-29 15:28:24 +11:00
b0de2bd64b feat: nv25 network skeleton (#12707)
* chore: update dependencies and stuff

* update stuff part 2

* chore: make gen

* chore: update UpgradeTuktukHeight to var

* chore: make actors-gen
2024-11-25 09:48:20 +01:00
467c6ff63d chore(deps): adapt to QAP API changes
Ref: https://github.com/filecoin-project/go-state-types/pull/308
2024-11-21 15:19:49 +11:00
4f923484bd feat(events): add max results error and default raw codec for eth_getLogs (#12671) 2024-11-20 21:35:31 +11:00
66a83b57f6 chore(events): improve perf for parallel event filter matching
1. Cache address look-ups for the given tipset across filters
2. Run the filters in an errgroup
2024-11-20 15:50:47 +11:00
1f5f51fc38 doc(indexer): more clarity for ChainIndexer configuration setup (#12701) 2024-11-19 07:51:35 +00:00
8003997b85 fix(eth): make trace_filter resilient to null rounds (#12702) 2024-11-19 18:40:09 +11:00
e9393dfe8c fix(eth): present revert "data" as plain bytes
decode the cbor return value for reverts and present that, as is expected by
Ethereum tooling
2024-11-07 16:29:22 +11:00
dcc903c65d feat: a new ChainIndexer to index tipsets, messages and events (#12421)
* chain index complete for msgs and txns

* dont need observer changes for now

* changes

* fix tests

* fix tests

* use th right context

* index empty tipsets correctly

* implement automated backfilling

* add event indexing and remove all old indices

* fix test

* revert deployment test changes

* revert test changes and better error handling for eth tx index lookups

* fix sql statments naming convention

* address review for Index GC

* more changes as per review

* changes as per review

* fix config

* mark events as reverted during reconciliation

* better reconciliation; pens down and code complete; also reconcile events

* fix tests

* improve config and docs

* improve docs and error handling

* improve read logic

* improve docs

* better logging and handle ennable event storage

* improve logs and index init proc

* better logging

* fix bugs based on calibnet testing

* create sqliite Indices

* gc should be based on epochs

* fix event query

* foreign keys should be enabled on the DB

* reverted tipsets should be removed as part of GC

* release read lock

* make it easy to backfill an empty index using reconciliation

* better docs for reconciliation

* fix conflicts with master

* Apply suggestions from code review

Co-authored-by: Rod Vagg <rod@vagg.org>

* fix go mod

* fix formatting

* revert config changes

* address changes in observer

* remove top level chainindex package

* changes as per review

* changes as per review

* changes as per review

* handle index with reverted tipsets during reconciliation

* changes as per review

* fix type of max reconcile epoch

* changes to reconciliation as per review

* log ipld error

* better logging of progress

* disable chain indexer hydrate from snapshot based on config

* always populate index

* make config easy to reason about

* fix config

* fix messaging

* revert config changes

* Apply suggestions from code review

Co-authored-by: Rod Vagg <rod@vagg.org>

* changes as per review

* make error messages homogenous

* fix indentation

* changes as per review

* feat: recompute tipset to generate missing events if event indexing is enabled (#12463)

* auto repair events

* make jen

* fix leaky abstraction

* better docs for gc retention epoch

* imrpove DB handling (#12485)

* fix conflict

* fix lite node config for indexer

* exclude reverted events from eth get logs if client queries by epoch

* Simply addressing for event lookups in the index.

simply addressing for event lookups

* Apply suggestions from code review

Co-authored-by: Rod Vagg <rod@vagg.org>

* Apply suggestions from code review

Co-authored-by: Rod Vagg <rod@vagg.org>

* fix tests

* Apply suggestions from code review

Co-authored-by: Rod Vagg <rod@vagg.org>

* feat: migration("re-indexing"), backfilling and diasgnostics tooling for the `ChainIndexer` (#12450)

* fix conflicts with chain indexer

* feat: chain indexer todos [skip changelog] (#12462)

* feat: finish todos of validation api

* feat: add indexed data verification with chain store

* feat: address comments and finish TODO

* fix: build issue

* address comments

* fix: ci issue

* Apply suggestions from code review

Co-authored-by: Rod Vagg <rod@vagg.org>

* changes to Index Validation API based on Rodds first review

* build chain indexer API

* improve error handling

* feat: lotus-shed tooling for chain indexer (#12474)

* feat: add lotus-shed command for backfilling chain indexer

* feat: add lotus-shed command for inspecting the chain indexer

* feat: use single lotus-shed command to inspect and backfill

* fix: remove the unused queries

* small changes

* add change log

* backfilling improvements and fixes

* finish chain index validation and backfill tooling

* user documentation for the

* validate from epoch

* Apply suggestions from code review

Suggestions from Steve's read of the user doc.

Co-authored-by: Steve Loeppky <biglep@filoz.org>

* changes to user doc as per review

* Apply suggestions from code review

Co-authored-by: Steve Loeppky <biglep@filoz.org>

* changes to user doc as per review

* Apply suggestions from code review

Co-authored-by: Steve Loeppky <biglep@filoz.org>

* changes as per review

* feat: add event entries count in validation API (#12506)

* feat: add event entry count in validation API

* address comments

* use sqllite defaults (#12504)

* Apply suggestions from code review

Co-authored-by: Steve Loeppky <biglep@filoz.org>

* write chain index to a different dir

* Apply suggestions from code review

Co-authored-by: Steve Loeppky <biglep@filoz.org>

* fix conflicts

* UX improvements to backfilling

* feat: tests for the chain indexer (#12521)

* ddl tests

* tests for the chain indexer

* finish unit tests for chain indexer

* fix formatting

* cleanup reverted tipsets to avoid db bloat

* fix logging

* test for filter by address

* test gc cascade delete

* fix db locked error during backfilling

* fix var name

* increase db locked timeout

* fix db locked issue

* reduce db lock timeout

* no lock in gc

* reconcile does not need lock

* improved error handling

* Update chain-indexing-overview-for-rpc-providers.md

Doc updates based on @jennijuju feedack.

* Update chain-indexing-overview-for-rpc-providers.MD

Fixes after reviewing 33c1ca1831

* better metrics for backfilling

* Update chain/index/chain-indexing-overview-for-rpc-providers.MD

Co-authored-by: Rod Vagg <rod@vagg.org>

* Update chain/index/chain-indexing-overview-for-rpc-providers.MD

Co-authored-by: Rod Vagg <rod@vagg.org>

* Update chain/index/chain-indexing-overview-for-rpc-providers.MD

Co-authored-by: Rod Vagg <rod@vagg.org>

* Update chain/index/chain-indexing-overview-for-rpc-providers.MD

Co-authored-by: Rod Vagg <rod@vagg.org>

* Update chain/index/chain-indexing-overview-for-rpc-providers.MD

Co-authored-by: Rod Vagg <rod@vagg.org>

* Update chain/index/chain-indexing-overview-for-rpc-providers.MD

Co-authored-by: Rod Vagg <rod@vagg.org>

* Update chain/index/chain-indexing-overview-for-rpc-providers.MD

Co-authored-by: Rod Vagg <rod@vagg.org>

* tests for changes to event addressing

* Apply suggestions from code review

Co-authored-by: Rod Vagg <rod@vagg.org>

* changes as per review -> round 1

* Apply suggestions from code review

Co-authored-by: Rod Vagg <rod@vagg.org>

* Apply suggestions from code review

Co-authored-by: Rod Vagg <rod@vagg.org>

* log tipset key cid

* Apply suggestions from code review

Co-authored-by: Rod Vagg <rod@vagg.org>

* Apply suggestions from code review

Co-authored-by: Rod Vagg <rod@vagg.org>

* fix docs

* Apply suggestions from code review

Co-authored-by: Rod Vagg <rod@vagg.org>

* fix tests

* fix tests

* make jen

* fix conflicts

---------

Co-authored-by: Aryan Tikarya <aryan.tikarya@dojima.network>
Co-authored-by: Rod Vagg <rod@vagg.org>
Co-authored-by: Steve Loeppky <biglep@filoz.org>

* fix lint

* Apply suggestions from code review

Co-authored-by: Rod Vagg <rod@vagg.org>

* Apply suggestions from code review

Co-authored-by: Rod Vagg <rod@vagg.org>

* remove reverted flag from RPC

* Apply suggestions from code review

Co-authored-by: Rod Vagg <rod@vagg.org>

* fix testing of events and dummy chain store

* remove lotus shed commands for old Indices

* change type of event counts to uint64

* only recompute events if theyre not found

* short-circuit empty events path for older tipsets

* chain indexer must be enabled if ETH RPC is enabled

* change name of message_id column to id in tipset_message table

* only expose SetRecomputeTipSetStateFunc

* dont block on head indexing for reading messages

* document why we're only checking for missing events for a single tipset

* document when we query for reverted events

* simplify event collection

* Apply suggestions from code review

Co-authored-by: Rod Vagg <rod@vagg.org>

* fix test

* change event_id to id in the event table

* change head indexed timeout

* remove deprecated config options

* fail ETH RPC calls if ChainIndexer is disabled

* fix docs

* remove the tipset key cid func from lotus shed

* address review comments

* Apply suggestions from code review

Co-authored-by: Rod Vagg <rod@vagg.org>

* chore(events): remove unnecessary DisableRealTimeFilterAPI (#12610)

* feat(cli): add --quiet to chainindex validate-backfill + cleanups (#12611)

* fix tests

* Apply suggestions from code review

Co-authored-by: Rod Vagg <rod@vagg.org>

* error type for disabled chainindexer

* fix(chainindex): recompute tipset when we find no receipts

* fix(chainindexer): backfilling should halt when chain state data is missing and not backfill parents (#12619)

* fix backfilling UX

* Update chain/index/api.go

Co-authored-by: Rod Vagg <rod@vagg.org>

* address review

---------

Co-authored-by: Rod Vagg <rod@vagg.org>

* reduce log noise

* make jen

* make jen

* docs: finishing chain-indexer-overview-for-operators.md (#12600)

* Followup to PR #12450 for doc updates

This is being used to resolve the unresolved items in https://github.com/filecoin-project/lotus/pull/12450 since that PR is unwieldly at this point.

* Incorporated some items and added TODOs based on unresolved items from https://github.com/filecoin-project/lotus/pull/12450

* Incorporating more feedback

* Pointing to issue to learn about benefits

* Formatting fixes

* Apply most of the suggestions from @rvagg code review

Co-authored-by: Rod Vagg <rod@vagg.org>

* Incorporating feedback from https://github.com/filecoin-project/lotus/pull/12600#discussion_r1802519453

* Addressing https://github.com/filecoin-project/lotus/pull/12600#discussion_r1802540042 and more

* Moved chain-indexer docs to documentation
Renamed
Added ToC

We can move to lotus-docs later

* Update documentation/en/chain-indexer-overview-for-operators.md

Co-authored-by: Rod Vagg <rod@vagg.org>

* Update documentation/en/chain-indexer-overview-for-operators.md

Co-authored-by: Rod Vagg <rod@vagg.org>

* Added upgrade path when importing chain state from a snapshot.

* Typo fixes

* Update documentation/en/chain-indexer-overview-for-operators.md

Co-authored-by: Rod Vagg <rod@vagg.org>

* chore(doc): "regular checks" section for chainindexer docs (#12612)

* Apply suggestions from @rvagg code review

Co-authored-by: Rod Vagg <rod@vagg.org>

* Incorporating @aarshkshah1992 feedback

* Update documentation/en/chain-indexer-overview-for-operators.md

Co-authored-by: Rod Vagg <rod@vagg.org>

---------

Co-authored-by: Rod Vagg <rod@vagg.org>
Co-authored-by: Aarsh Shah <aarshkshah1992@gmail.com>

* remove go mod replace

* remove unnecessary changes from CHANGELOG

* fix test

* compare events AMT root (#12632)

* fix(chainindex): retry transaction if database connection is lost (#12657)

* retry database lost connection

* log context cancellation

* address review

* fix gateway itest: no chainindexer for lite nodes

* fix changelog

---------

Co-authored-by: Rod Vagg <rod@vagg.org>
Co-authored-by: Aryan Tikarya <aryan.tikarya@dojima.network>
Co-authored-by: Steve Loeppky <biglep@filoz.org>
2024-10-31 09:58:19 +00:00
6a70c6b01b feat(eth): return consistent error for null rounds from RPC methods (#12655) 2024-10-31 20:12:34 +11:00
8feaa02de0 Revert "feat: fix GetBlock for null rounds by returning nil (#12529)"
This reverts commit c6745545041939b97962e376ee2593609bb3d5b5.
2024-10-28 15:17:44 +11:00
ab3446726f feat(eth): implement eth_getTransactionByBlockNumberAndIndex and eth_getTransactionByBlockHashAndIndex (#12618) 2024-10-25 02:00:14 +00:00
082b7caab5 feat(api): populate data field for revert error in EthEstimateGas and EthCall (#12553)
Co-authored-by: Aryan Tikarya <aryan.tikarya@dojima.network>
2024-10-25 01:13:32 +00:00
02a8b972db chore(logging): downgrade GasEstimateMessageGas info log to debug 2024-10-23 11:40:21 +11:00
bc8c29bf7f feat(f3): display the initial power table CID in the F3 manifest (#12626)
Also, add it to the manifest if not already set.
2024-10-22 18:00:01 +00:00
13a0ce7c11 feat: implement F3 list participants API (#12608)
* Implement F3 list participants API

Implement Lotus API to list the current miner IDs that are
participating.

* Include lease information to list participants API

Also return start and validity terms of the list participants API.
2024-10-17 19:14:01 +00:00
d4b8af99b2 fix(miner): fix new bug in StateMinerPreCommitDepositForPower calculation (#12595)
Regression introduced by refactoring in
https://github.com/filecoin-project/lotus/pull/12384 where the NV16 special
case was missed and the full sector weight calculation was applied. The lack of
this special case essentially reverts FIP-0034 for this API, but not for actors
which would have a different PCD calculation.
2024-10-14 18:43:32 +02:00
4d4d473ad2 feat(f3): refactor the F3 participation module to improve testing (#12589)
1. Move it next to all the F3 code.
2. Make it look more like a "service" so I won't have to duplicate the
start/stop code in the itests.
3. Rename participator to participant. Not perfect, but it's a word.
4. Make all the constants public.
5. Only depend on the parts of the API we need (will help with unit testing).
2024-10-11 15:18:06 +00:00
8ea8e63d1f feat(f3): remove lease-check interval constants (#12580)
1. Instead of hard-coding the renewal to be within 2 instances of the
end of the lease, specify the renewal to be within 1/2th of the end of
the lease, rounded up (towards the end of the lease).
2. Instead of hard-coding the lease check interval to be
10s (problematic for tests where the block time is 100ms), set it to be
the minimum amount of time we expect to have to wait for the remaining
instances to complete.
2024-10-11 13:43:39 +00:00
b3b77272e1 fix(f3): handle a case where we might receive no manifest (#12579)
In _theory_ a lotus node can return no manifest from `F3Manifest`. I
don't think that happens in practice but we should handle the case and
start over at the top (try to get another lease). If we really have no
manifest, lotus will tell us that F3 isn't ready yet and we'll backoff
for a bit.
2024-10-11 13:43:13 +00:00
4ef0aed156 fix(events): handle subscribe and get/fill cases separately
* subscribe-type calls always wants future reverts but only historical reverts
  when a tipset is specified
* get-type calls only want reverts when a tipset is specified

Add a new Fill() method to avoid the unnecessary install + remove step for get-
type calls.

Closes: https://github.com/filecoin-project/lotus/issues/12584
2024-10-11 21:16:45 +11:00
038981c8b6 fix(events): address API reverted semantics
Apply suggestions from code review

Co-authored-by: Rod Vagg <rod@vagg.org>
2024-10-11 21:16:45 +11:00
4586794faa fix(f3): log the correct number of instances remaining (#12578) 2024-10-10 20:58:31 +00:00
0d9dcd7e2c fix(f3): improve log messages (#12576)
1. Change Restarting -> Renewing. Restarting sounds like something is
going wrong.
2. Fix spelling of rechecking.
2024-10-10 16:57:24 +00:00
e769bdfd01 fix(f3): fix hot loop in F3 participation (#12575)
* fix(f3): fix hot loop in F3 participation
* fix(f3): Correct lease expiration log message
* feat(f3): log not-before and not-after for new leases
* test(f3): make the f3-enabled test wait for at one lease to expire

---------

Signed-off-by: Jakub Sztandera <oss@kubuxu.com>
Co-authored-by: Steven Allen <steven@stebalien.com>
2024-10-10 16:21:41 +00:00
a0d529263a feat: implement ticket based F3 participation lease (#12531)
* Implement ticket based F3 participation lease

Implemented enhanced ticket-based participation system for F3 consensus
in `F3Participate`. This update introduces a new design where
participation tickets grant a temporary lease, allowing storage
providers to sign as part of the F3 consensus mechanism. This design ensures that
tickets are checked for validity and issuer alignment, handling errors
robustly. If there's an issuer mismatch, the system advises miners to
retry with the existing ticket. If the ticket is invalid or expired,
miners are directed to obtain a new ticket via
`F3GetOrRenewParticipationTicket`.

Fixes https://github.com/filecoin-project/go-f3/issues/599

* Use fresh timer every time for F3 backoffs

To avoid potential of deadlock in case f3Participator is used from
multiple goroutines use throw-away timers at the price of higher GC.

Also use the cancel function in context explicitly in a unified stop
hook that awaits the participation to end before exiting.

* Strictly require start instance to never decrease

Require the start instance of a participation to never decrease if there
 is an existing lease by the miner.

* feat(f3): update go-f3 to 0.7.0 and adapt for changes to the API

* feat(f3): Include the network name in the lease

That way we don't re-use leases across networks. It's a bit racy (we ask
for the manifest before we ask for the current progress) but it should
be fine because at least we won't create a lease for the new network
with a future instance.

There's still an ABA problem if we rapidly switch back and forth between
two networks but... let's just not do that? At least for the mainnet
switchover, that won't be an issue because we enforce a 900 epoch
silence period.

I have to say, I'm not happy about this. But... we can probably just
hard-code it in the future once we get rid of the dynamic manifest.

* Handle not ready error gracefully in participator

Back off and get a fresh token if F3 is not ready.

---------

Co-authored-by: Steven Allen <steven@stebalien.com>
2024-10-08 09:57:23 +01:00
1b9b81537b feat(f3): prepare for f3 bootstrap (#12552)
This patch:

1. Bootstraps F3 when we hit the `F3BootstrapEpoch` (when non-negative).
2. Refuses any/all dynamic manifests once we get within one finality of said epoch.
3. Sets the F3 network name for mainnet to "filecoin".
4. Refuses any/all dynamic manifests that don't start with the expected
    network name prefix.
2024-10-07 15:03:55 +00:00