111 Commits

Author SHA1 Message Date
54bd2c74d6 chore(deps): bump filecoin-ffi for fvm@v4.7 (#13029) 2025-05-10 02:06:32 +12:00
b89a29803b feat(shed): add commands for importing/exporting datastore snapshots (#12685)
This makes it possible to import/export arbitrary datastore snapshots.
2024-11-08 06:09:49 +00:00
89b0941462 fix: support Forrest parity testing for F3 participation APIs (#12615)
* Support Forrest parity testing for F3 participation APIs

For parity testing, Forest nodes need to decode an F3 participation
ticket that is issued by Lotus. Lotus so happens to use CBOR to encode
tickets, which it then decodes to issue a lease.

The lease issuer is of type `peer.ID` which is an alias of type `string`
that may contain non UTF-8 characters. If this type is used directly in
CBOR encoding then it gets encoded as string, which works fine in Golang
but not Rust, which in turn results in decoding issues in Forest.

To avoid this use `[]byte` as the type to encode the issuer public key.
In Lotus, the value will be the binary marshalling of `peer.ID` that
issued the ticket.

While at it, also fix two issues that were brought up during discussion:

* A miner must not be able to ask for a ticket to participate in zero
  instances. Validate and return error if instances is set to zero.

* Use CBOR tuple encoding for a slightly better efficient wire encoding
  of ticket. `cborgen.Write*` APIs explicitly create a given file; hence
  the need to separate the file to which tuple kinds are generated since
  the existing encoding for types in `api/cbor_gen.go` use maps.
2024-10-18 16:11:14 +01: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
312fa3a5cc Simplify code generation logic for a faster and better UX (#12493)
The changes here simplify the string of targets executed as part of
`make gen`. The simplifications include:
* parallelised code generation whenever possible
* re-implementation of documentation generation for a significant
  simplification and improved readability.
* unified mocks generation to avoid multiple slow calls to `go run` per
  package.

Note, the changes introduced here are purely mechanical and do not alter
the Lotus node functionality.

Fixes #8392
2024-09-20 16:32:54 +00:00
6f7498b622 chore: Merge nv22 into master (#11699)
* [WIP] feat: Add nv22 skeleton

Addition of Network Version 22 skeleton

* update FFI

* feat: drand: refactor round verification

* feat: sealing: Support nv22 DDO features in the sealing pipeline (#11226)

* Initial work supporting DDO pieces in lotus-miner

* sealing: Update pipeline input to operate on UniversalPiece

* sealing: Update pipeline checks/sealing states to operate on UniversalPiece

* sealing: Make pipeline build with UniversalPiece

* move PieceDealInfo out of api

* make gen

* make sealing pipeline unit tests pass

* fix itest ensemble build

* don't panic in SectorsStatus with deals

* stop linter from complaining about checkPieces

* fix sector import tests

* mod tidy

* sealing: Add logic for (pre)committing DDO sectors

* sealing: state-types with method defs

* DDO non-snap pipeline works(?), DDO Itests

* DDO support in snapdeals pipeline

* make gen

* update actor bundles

* update the gst market fix

* fix: chain: use PreCommitSectorsBatch2 when setting up genesis

* some bug fixes

* integration working changes

* update actor bundles

* Make TestOnboardRawPieceSnap pass

* Appease the linter

* Make deadlines test pass with v12 actors

* Update go-state-types, abstract market DealState

* make gen

* mod tidy, lint fixes

* Fix some more tests

* Bump version in master

Bump version in master

* Make gen

Make gen

* fix sender

* fix: lotus-provider: Fix winning PoSt

* fix: sql Scan cannot write to an object

* Actually show miner-addrs in info-log

Actually show miner-addrs in lotus-provider info-log

* [WIP] feat: Add nv22 skeleton

Addition of Network Version 22 skeleton

* update FFI

* ddo is now nv22

* make gen

* temp actor bundle with ddo

* use working go-state-types

* gst with v13 market migration

* update bundle, builtin.MethodsMiner.ProveCommitSectors2 -> 3

* actually working v13 migration, v13 migration itest

* Address review

* sealing: Correct DDO snap pledge math

* itests: Mixed ddo itest

* pipeline: Fix sectorWeight

* sealing: convert market deals into PAMs in mixed sectors

* sealing: make market to ddo conversion work

* fix lint

* update gst

* Update actors and GST to lastest integ branch

* commit batcher: Update ProveCommitSectors3Params builder logic

* make gen

* use builtin-actors master

* ddo: address review

* itests: Add commd assertions to ddo tests

* make gen

* gst with fixed types

* config knobs for RequireActivationSuccess

* storage: Drop obsolete flaky tasts

---------

Co-authored-by: Jennifer Wang <jiayingw703@gmail.com>
Co-authored-by: Aayush <arajasek94@gmail.com>
Co-authored-by: Shrenuj Bansal <shrenuj.bansal@protocol.ai>
Co-authored-by: Phi <orjan.roren@gmail.com>
Co-authored-by: Andrew Jackson (Ajax) <snadrus@gmail.com>
Co-authored-by: TippyFlits <james.bluett@protocol.ai>

* feat: implement FIP-0063

* chore: deps: update to go-multiaddr v0.12.2 (#11602)

* feat: fvm: update the FVM/FFI to v4.1 (#11608) (#11612)

This:

1. Adds nv22 support.
2. Updates the message tracing format.

Co-authored-by: Steven Allen <steven@stebalien.com>

* AggregateProofType nil when doing batch updates

Use latest nv22 go-state-types version with matching update

* Update to v13.0.0-rc.2 bundle

* chore: Upgrade heights and codename

Update upgrade heights

Co-Authored-By: Steven Allen <steven@stebalien.com>

* Update epoch after nv22 DRAND switch

Update epoch after nv22 DRAND switch

* Update Mango codename to Phoneix

Make the codename for the Drand-change inline with Dragon style.

* Add UpgradePhoenixHeight to API params

* set UpgradePhoenixHeight to be one hour after Dragon

* Make gen

Make gen and UpgradePhoenixHeight in butterfly and local devnet to be in line with Calibration and Mainnet

* Update epoch heights (#11637)

Update epoch heights

* new: add forest bootstrap nodes (#11636)

Signed-off-by: samuelarogbonlo <sbayo971@gmail.com>

* Merge pull request #11491 from filecoin-project/fix/remove-decommissioned-pl-bootstrap-nodes

Remove PL operated bootstrap nodes from mainnet.pi

* feat: api: new verified registry methods to get all allocations and claims (#11631)

* new verireg methods

* update changelog and add itest

* update itest and cli

* update new method's support till v9

* remove gateway APIs

* fix cli internal var names

* chore:: backport #11609 to the feat/nv22 branch (#11644)

* 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.

* Make gen

Make gen

---------

Co-authored-by: Steven Allen <steven@stebalien.com>

* fix: add UpgradePhoenixHeight to StateGetNetworkParams (#11648)

* chore: deps: update to go-state-types v13.0.0-rc.1

* do NOT update the cache when running the real migration

* Merge pull request #11632 from hanabi1224/hm/drand-test

feat: drand quicknet: allow scheduling drand quicknet upgrade before nv22 on 2k devnet

* chore: deps: update to go-state-types v13.0.0-rc.2

chore: deps: update to go-state-types v13.0.0-rc.2

* feat: set migration config UpgradeEpoch for v13 actors upgrade

* Built-in actor events first draft

* itest for DDO non-market verified data w/ builtin actor events

* Tests for builtin actor events API

* Clean up DDO+Events tests, add lots of explainer comments

* Minor tweaks to events types

* Avoid duplicate messages when looking for receipts

* Rename internal events modules for clarity

* Adjust actor event API after review

* s/ActorEvents/Events/g in global config

* Manage event sending rate for SubscribeActorEvents

* Terminate SubscribeActorEvents chan when at max height

* Document future API changes

* More clarity in actor event API docs

* More post-review changes, lots of tests for SubscribeActorEvents

Use BlockDelay as the window for receiving events on the SubscribeActorEvents
channel. We expect the user to have received the initial batch of historical
events (if any) in one block's time. For real-time events we expect them to
not fall behind by roughly one block's time.

* Remove duplicate code from actor event type marshalling tests

Reduce verbosity and remove duplicate test logic from actor event types
JSON marshalling tests.

* Rename actor events test to follow go convention

Add missing `s` to `actor_events` test file to follow golang convention
used across the repo.

* Run actor events table tests in deterministic order

Refactor `map` usage for actor event table tests to ensure deterministic
test execution order, making debugging potential issues easier. If
non-determinism is a target, leverage Go's built-in parallel testing
capabilities.

* Reduce scope for filter removal failure when getting actor events

Use a fresh context to remove the temporary filter installed solely to
get the actor events. This should reduce chances of failure in a case
where the original context may be expired/cancelled.

Refactor removal into a `defer` statement for a more readable, concise
return statement.

* Use fixed RNG seed for actor event tests

Improve determinism in actor event tests by using a fixed RNG seed. This
makes up a more reproducible test suit.

* Use provided libraries to assert eventual conditions

Use the functionalities already provided by `testify` to assert eventual
conditions, and remove the use of `time.Sleep`.

Remove duplicate code in utility functions that are already defined.

Refactor assertion helper functions to use consistent terminology:
"require" implies fatal error, whereas "assert" implies error where the
test may proceed executing.

* Update changelog for actor events APIs

* Fix concerns and docs identified by review

* Update actor bundle to v13.0.0-rc3

Update actor bundle to v13.0.0-rc3

* Prep Lotus v1.26.0-rc1

- For sanity reverting the mainnet upgrade epoch to 99999999, and then only set it when cutting the final release

-Update Calibnet CIDs to v13.0.0-rc3

- Add GetActorEvents, SubscribeActorEvents, GetAllClaims and GetAllAllocations methods to the changelog

Co-Authored-By: Jiaying Wang <42981373+jennijuju@users.noreply.github.com>

* Update CHANGELOG.md

Co-authored-by: Masih H. Derkani <m@derkani.org>

* Make gen

Make gen

* fix: beacon: validate drand change at nv16 correctly

* bump to v1.26.0-rc2

* test: cleanup ddo verified itest, extract steps to functions

also add allocation-removed event case

* test: extract verified DDO test to separate file, add more checks

* test: add additional actor events checks

* Add verification for "deal-activated" actor event

* docs(drand): document the meaning of "IsChained" (#11692)

* Resolve conflicts

I encountered multiple issues when trying to run make gen. And these changes fixed a couple of them:
- go mod tidy
- Remove RaftState/RaftLeader
- Revert `if ts.Height() > claim.TermMax+claim.TermStart || !cctx.IsSet("expired")` to the what is in the release/v1.26.0: `if tsHeight > val.TermMax || !expired`

* fixup imports, make jen

* Update version

Update version in master to v1.27.0-dev

* Update node/impl/full/dummy.go

Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com>

* Adjust ListClaimsCmd

Adjust ListClaimsCmd according to review

---------

Signed-off-by: samuelarogbonlo <sbayo971@gmail.com>
Co-authored-by: TippyFlits <james.bluett@protocol.ai>
Co-authored-by: Aayush <arajasek94@gmail.com>
Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com>
Co-authored-by: Jennifer Wang <jiayingw703@gmail.com>
Co-authored-by: Shrenuj Bansal <shrenuj.bansal@protocol.ai>
Co-authored-by: Andrew Jackson (Ajax) <snadrus@gmail.com>
Co-authored-by: Steven Allen <steven@stebalien.com>
Co-authored-by: Rod Vagg <rod@vagg.org>
Co-authored-by: Samuel Arogbonlo <47984109+samuelarogbonlo@users.noreply.github.com>
Co-authored-by: LexLuthr <88259624+LexLuthr@users.noreply.github.com>
Co-authored-by: tom123222 <160735201+tom123222@users.noreply.github.com>
Co-authored-by: Aarsh Shah <aarshkshah1992@gmail.com>
Co-authored-by: Masih H. Derkani <m@derkani.org>
Co-authored-by: Jiaying Wang <42981373+jennijuju@users.noreply.github.com>
2024-03-12 10:33:58 +01:00
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
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
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
cdf3812e40 NV18: Filecoin EVM runtime + Actor Events + EthAccount + EAM + f4 addressing (#9998)
Co-authored-by: Steven Allen <steven@stebalien.com>
Co-authored-by: Raul Kripalani <raulk@users.noreply.github.com>
Co-authored-by: Kevin Li <ychiaoli18@users.noreply.github.com>
Co-authored-by: vyzo <vyzo@hackzen.org>
Co-authored-by: Ian Davis <nospam@iandavis.com>
Co-authored-by: Aayush Rajasekaran <arajasek94@gmail.com>
Co-authored-by: Jiaying Wang <42981373+jennijuju@users.noreply.github.com>
Co-authored-by: Jennifer Wang <jiayingw703@gmail.com>
Co-authored-by: Geoff Stuart <geoff.vball@gmail.com>
Co-authored-by: Shrenuj Bansal <shrenuj.bansal@protocol.ai>
Co-authored-by: Shrenuj Bansal <108157875+shrenujbansal@users.noreply.github.com>
Co-authored-by: Geoff Stuart <geoffrey.stuart@protocol.ai>
Co-authored-by: Aayush Rajasekaran <aayushrajasekaran@Aayushs-MacBook-Pro.local>
Co-authored-by: ZenGround0 <5515260+ZenGround0@users.noreply.github.com>
Co-authored-by: zenground0 <ZenGround0@users.noreply.github.com>
2023-01-13 19:11:13 +00:00
2651a38f89 Merge branch 'master' into feat/nv18 2022-11-22 10:08:54 -08:00
674d127701 state tree version 5 scaffolding 2022-11-09 10:44:51 +02:00
1577740bc4 bstore: Network blockstore 2022-11-08 09:37:11 +00:00
859c2606f0 sealing: Address review 2022-09-19 12:13:06 +02:00
3caa010779 sector import: Update type-gen 2022-09-19 12:13:06 +02:00
5c485c3375 sealing: Drop redundant Piece type 2022-09-19 12:13:05 +02:00
92cc24fca2 support fvm gas tracing 2022-09-09 21:40:15 -04:00
82857e6d5d chore: rerun gen with moved packages 2022-06-14 20:13:31 +02:00
a9600b8a6f storage: Move extern/sector-storage to storage/sealer 2022-06-14 20:03:38 +02:00
e65fae28de chore: fix imports 2022-06-14 17:00:51 +02:00
36a8d9716e FVM: Support exectraces 2022-04-19 15:24:40 -04:00
84dbb229b6 shed: blockstore/vlog to car export cmds 2022-03-09 10:21:36 +01:00
a989f60e27 add SectorAddPieceToAny and SectorUnsealPiece to StorageMiner iface; model moved to api package - PieceDealInfo, DealSchedule 2021-05-19 13:05:07 +02:00
ea58bee3f5 backupds: Allow larger values in write log 2021-03-11 12:03:24 +01:00
ca7e70bf3a Metadata datastore log 2021-03-09 22:33:01 +01:00
4d3cd7dcb8 refactor: FundManager 2020-11-10 19:44:26 -08:00
0de3051821 Merge remote-tracking branch 'origin/master' into feat/async-restartable-workers 2020-10-08 13:10:41 +02:00
e803cf151f introduce separate state-tree versions
Instead of versioning the state tree along with the actors, version it
separately. This structure may not upgrade every time we update actors.
2020-10-07 12:04:32 -07:00
cf71f034dc Merge remote-tracking branch 'origin/dev' into feat/async-restartable-workers 2020-09-26 12:35:32 +02:00
46f5b62a76 Remove a misleading miner actor abstraction
We shouldn't implement CBOR functions on the "abstract" miner info. Otherwise,
we could end up trying to actually _use_ this "abstract" info when decoding
state (which won't work across version).

Also remove the use of these CBOR functions, and instead explicitly use miner0
types. We'll have to abstract over versions eventually, but we'll probably need
some form of abstract miner builder (or maybe even adding some "add sector",
etc. functions to the current miner abstraction?
2020-09-23 14:49:53 -07:00
ce6b92484f Merge remote-tracking branch 'origin/master' into feat/async-restartable-workers 2020-09-23 11:31:21 +02:00
a95e34f742 Fix build 2020-09-21 02:02:33 -04:00
d9d644b27f sectorstorage: handle restarting manager, test that 2020-09-17 00:35:09 +02:00
5e09581256 sectorstorage: get new work tracker to run 2020-09-16 22:33:58 +02:00
b1361aaf8b sectorstorage: wip manager work tracker 2020-09-16 17:08:05 +02:00
cc4d5306eb Progress 2020-09-14 15:43:12 -07:00
1ebca8f732 more working code 2020-09-14 19:09:01 +02:00
453e826a0f rename p2p protocol to /fil/chain/xchg/0.0.1 (backwards-compatible); rename more. 2020-09-07 19:45:34 +01:00
55b1456d45 blocksync: introduce interfaces; rename to chainexchange. 2020-09-07 19:31:43 +01:00
e689c305d2 fix: revert to using cid for paych wait sentinel 2020-08-12 16:29:44 -04:00
a881e58cd6 refactor: use special type for paych wait sentinel 2020-08-11 10:45:45 -04:00
e2d5451ffb Merge pull request #2715 from filecoin-project/schomatis/blocksync/review
Rewrite internal logic of block sync client
2020-08-06 19:46:58 +02:00
fdfccf0466 WIP: fix payment channel locking 2020-08-06 12:04:10 -04:00
76d40ec408 first pass, ready for review 2020-08-03 12:20:04 -03:00
ce4978d8c3 Reintroduce correct ticket randomness alongside ElectionProof
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-04-08 21:06:41 +02:00
7075eaba26 WIP: random beacon interface
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-04-07 15:32:23 -07:00
110c869dd3 cut over to storage-fsm, deleting local sealing package 2020-04-07 09:34:09 -07:00
3d1a5f4bf3 libs: Use go-statemachine 2020-03-06 20:01:03 +01:00
f83bbc2cbe Regen cbor marshalers 2020-02-28 00:34:48 +01:00
d787aa5007 Merge branch 'testnet/3' into feat/specs-actors 2020-02-24 18:32:02 +01:00