Skip to content

Commit

Permalink
Merge branch 'master' into feat/better-list-formats
Browse files Browse the repository at this point in the history
  • Loading branch information
Kubuxu authored Dec 6, 2024
2 parents 087dd5a + 872c3b7 commit 55e1a0c
Show file tree
Hide file tree
Showing 255 changed files with 6,943 additions and 2,334 deletions.
2 changes: 1 addition & 1 deletion .github/actions/install-go/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ runs:
working-directory: ${{ inputs.working-directory || github.workspace }}
- uses: actions/setup-go@v5
with:
go-version: ${{ fromJSON(steps.go-mod.outputs.json).Go }}.x
go-version: ${{ fromJSON(steps.go-mod.outputs.json).Go }}
cache: false
70 changes: 70 additions & 0 deletions .github/workflows/create-release-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Create Release Issue

on:
workflow_dispatch:
inputs:
type:
description: "What's the type of the release?"
required: true
type: choice
options:
- node
- miner
- both
tag:
description: "What's the tag of the release? (e.g., 1.30.1)"
required: true
level:
description: "What's the level of the release?"
required: true
default: 'warning'
type: choice
options:
- major
- minor
- patch
network-upgrade:
description: "What's the version of the network upgrade this release is related to? (e.g. 25)"
required: false
discussion-link:
description: "What's a link to the GitHub Discussions topic for the network upgrade?"
required: false
changelog-link:
description: "What's a link to the Lotus CHANGELOG entry for the network upgrade?"
required: false
rc1-date:
description: "What's the expected shipping date for RC1?"
required: false
stable-date:
description: "What's the expected shipping date for the stable release?"
required: false

defaults:
run:
shell: bash

permissions:
contents: read
issues: write

jobs:
create-issue:
name: Create Release Issue
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-go
- env:
GITHUB_TOKEN: ${{ github.token }}
run: |
go run cmd/release/main.go create-issue \
--create-on-github true \
--type "${{ github.event.inputs.type }}" \
--tag "${{ github.event.inputs.tag }}" \
--level "${{ github.event.inputs.level }}" \
--network-upgrade "${{ github.event.inputs.network-upgrade }}" \
--discussion-link "${{ github.event.inputs.discussion-link }}" \
--changelog-link "${{ github.event.inputs.changelog-link }}" \
--rc1-date "${{ github.event.inputs.rc1-date }}" \
--stable-date "${{ github.event.inputs.stable-date }}" \
--repo "filecoin-project/lotus"
52 changes: 50 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,57 @@

- Add json output of tipsets to `louts chain list`. ([filecoin-project/lotus#12691](https://github.com/filecoin-project/lotus/pull/12691))

# UNRELEASED v1.31.0

See https://github.com/filecoin-project/lotus/blob/release/v1.31.0/CHANGELOG.md
See https://github.com/filecoin-project/lotus/blob/release/v1.32.0/CHANGELOG.md

# Node and Miner v1.31.0 / 2024-12-02

The Lotus v1.31.0 release introduces the new `ChainIndexer` subsystem, enhancing the indexing of Filecoin chain state for improved RPC performance. Several bug fixes in the block production loop are also included. Please review the upgrade warnings and documentation for any important changes affecting RPC providers, node operators and storage providers.

## ⭐ New Feature Highlights:
- New ChainIndexer subsystem to index Filecoin chain state such as tipsets, messages, events and ETH transactions for accurate and faster RPC responses. The `ChainIndexer` replaces the existing `MsgIndex`, `EthTxHashLookup` and `EventIndex` implementations in Lotus, which [suffer from a multitude of known problems](https://github.com/filecoin-project/lotus/issues/12293). If you are an RPC provider or a node operator who uses or exposes Ethereum and/or events APIs, please refer to the [ChainIndexer documentation for operators](./documentation/en/chain-indexer-overview-for-operators.md) for information on how to enable, configure and use the new Indexer. While there is no automated data migration and one can upgrade and downgrade without backups, there are manual steps that need to be taken to backfill data when upgrading to this Lotus version, or downgrading to the previous version without ChainIndexer. Please be aware that that this feature removes some options in the Lotus configuration file, if these have been set, Lotus will report an error when starting. See the documentation for more information
- `lotus chain head` now supports a `--height` flag to print just the epoch number of the current chain head ([filecoin-project/lotus#12609](https://github.com/filecoin-project/lotus/pull/12609))
- Implement `EthGetTransactionByBlockNumberAndIndex` (`eth_getTransactionByBlockNumberAndIndex`) and `EthGetTransactionByBlockHashAndIndex` (`eth_getTransactionByBlockHashAndIndex`) methods. ([filecoin-project/lotus#12618](https://github.com/filecoin-project/lotus/pull/12618))
- `lotus-shed indexes inspect-indexes` now performs a comprehensive comparison of the event index data for each message by comparing the AMT root CID from the message receipt with the root of a reconstructed AMT. Previously `inspect-indexes` simply compared event counts. Comparing AMT roots instead confirms all the event data is byte-perfect. ([filecoin-project/lotus#12570](https://github.com/filecoin-project/lotus/pull/12570))
- Return a "data" field on the "error" returned from RPC when `eth_call` and `eth_estimateGas` APIs encounter `execution reverted` errors. This is a standard expectation of Ethereum RPC tooling and may improve compatibility in some cases. ([filecoin-project/lotus#12553](https://github.com/filecoin-project/lotus/pull/12553))
- Improve ETH-filter performance for nodes serving many clients. ([filecoin-project/lotus#12603](https://github.com/filecoin-project/lotus/pull/12603))
- Implement F3 utility CLIs to list the power table for a given instance and sum the proportional power of a set of actors that participate in a given instance. ([filecoin-project/lotus#12698](https://github.com/filecoin-project/lotus/pull/12698))

## 🐛 Bug Fix Highlights
- Add logic to check if the miner's owner address is delegated (f4 address). If it is delegated, the `lotus-shed sectors termination-estimate` command now sends the termination state call using the worker ID. This fix resolves the issue where termination-estimate did not function correctly for miners with delegated owner addresses. ([filecoin-project/lotus#12569](https://github.com/filecoin-project/lotus/pull/12569))
- The Lotus Miner will now always mine on the latest chain head returned by lotus, even if that head has less "weight" than the previously seen head. This is necessary because F3 may end up finalizing a tipset with a lower weight, although this situation should be rare on the Filecoin mainnet. ([filecoin-project/lotus#12659](https://github.com/filecoin-project/lotus/pull/12659)) and ([filecoin-project/lotus#12690](https://github.com/filecoin-project/lotus/pull/12690))
- Make the ordering of event output for `eth_` APIs and `GetActorEventsRaw` consistent, sorting ascending on: epoch, message index, event index and original event entry order. ([filecoin-project/lotus#12623](https://github.com/filecoin-project/lotus/pull/12623))
- Return a consistent error when encountering null rounds in ETH RPC method calls. ([filecoin-project/lotus#12655](https://github.com/filecoin-project/lotus/pull/12655))
- Correct erroneous sector QAP-calculation upon sector extension in lotus-miner cli. ([filecoin-project/lotus#12720](https://github.com/filecoin-project/lotus/pull/12720))

## 📝 Changelog

For the full set of changes since the last stable release:

* Node: https://github.com/filecoin-project/lotus/compare/v1.30.0...v1.31.0
* Miner: https://github.com/filecoin-project/lotus/compare/v1.30.0...miner/v1.31.0

## 👨‍👩‍👧‍👦 Contributors

| Contributor | Commits | Lines ± | Files Changed |
|-------------|---------|---------|---------------|
| Aarsh Shah | 2 | +6725/-5410 | 84 |
| Masih H. Derkani | 13 | +1924/-867 | 61 |
| Viraj Bhartiya | 6 | +2048/-703 | 41 |
| Steven Allen | 25 | +1394/-404 | 53 |
| Rod Vagg | 13 | +502/-272 | 39 |
| Phi-rjan | 8 | +175/-64 | 20 |
| Jakub Sztandera | 7 | +107/-66 | 15 |
| aarshkshah1992 | 1 | +61/-30 | 5 |
| Steve Loeppky | 1 | +78/-2 | 4 |
| Krishang Shah | 1 | +7/-17 | 1 |
| Łukasz Magiera | 1 | +9/-10 | 3 |
| Phi | 1 | +9/-9 | 8 |
| Danial Ahn | 1 | +14/-1 | 2 |
| hanabi1224 | 1 | +7/-6 | 1 |
| web3-bot | 1 | +1/-1 | 1 |
| asamuj | 1 | +1/-1 | 1 |
| Andrew Jackson (Ajax) | 1 | +2/-0 | 1 |

# Node and Miner v1.30.0 / 2024-11-06

Expand Down
4 changes: 3 additions & 1 deletion api/api_full.go
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,8 @@ type FullNode interface {
StateMarketDeals(context.Context, types.TipSetKey) (map[string]*MarketDeal, error) //perm:read
// StateMarketStorageDeal returns information about the indicated deal
StateMarketStorageDeal(context.Context, abi.DealID, types.TipSetKey) (*MarketDeal, error) //perm:read
// StateMarketProposalPending returns whether a given proposal CID is marked as pending in the market actor
StateMarketProposalPending(ctx context.Context, proposalCid cid.Cid, tsk types.TipSetKey) (bool, error) //perm:read
// StateGetAllocationForPendingDeal returns the allocation for a given deal ID of a pending deal. Returns nil if
// pending allocation is not found.
StateGetAllocationForPendingDeal(ctx context.Context, dealId abi.DealID, tsk types.TipSetKey) (*verifreg.Allocation, error) //perm:read
Expand Down Expand Up @@ -618,7 +620,7 @@ type FullNode interface {
// StateGetRandomnessFromBeacon is used to sample the beacon for randomness.
StateGetRandomnessFromBeacon(ctx context.Context, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte, tsk types.TipSetKey) (abi.Randomness, error) //perm:read

// StateGetRandomnessDigestFromTickets. is used to sample the chain for randomness.
// StateGetRandomnessDigestFromTickets is used to sample the chain for randomness.
StateGetRandomnessDigestFromTickets(ctx context.Context, randEpoch abi.ChainEpoch, tsk types.TipSetKey) (abi.Randomness, error) //perm:read
// StateGetRandomnessDigestFromBeacon is used to sample the beacon for randomness.
StateGetRandomnessDigestFromBeacon(ctx context.Context, randEpoch abi.ChainEpoch, tsk types.TipSetKey) (abi.Randomness, error) //perm:read
Expand Down
4 changes: 2 additions & 2 deletions api/api_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type StorageMiner interface {
ActorSectorSize(context.Context, address.Address) (abi.SectorSize, error) //perm:read
ActorAddressConfig(ctx context.Context) (AddressConfig, error) //perm:read

// WithdrawBalance allows to withdraw balance from miner actor to owner address
// ActorWithdrawBalance allows to withdraw balance from miner actor to owner address
// Specify amount as "0" to withdraw full balance. This method returns a message CID
// and does not wait for message execution
ActorWithdrawBalance(ctx context.Context, amount abi.TokenAmount) (cid.Cid, error) //perm:admin
Expand Down Expand Up @@ -172,7 +172,7 @@ type StorageMiner interface {
// SealingSchedDiag dumps internal sealing scheduler state
SealingSchedDiag(ctx context.Context, doSched bool) (interface{}, error) //perm:admin
SealingAbort(ctx context.Context, call storiface.CallID) error //perm:admin
// SealingSchedRemove removes a request from sealing pipeline
// SealingRemoveRequest removes a request from sealing pipeline
SealingRemoveRequest(ctx context.Context, schedId uuid.UUID) error //perm:admin

// paths.SectorIndex
Expand Down
5 changes: 0 additions & 5 deletions api/api_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// stm: #unit
package api

import (
Expand Down Expand Up @@ -30,7 +29,6 @@ func goCmd() string {
}

func TestDoesntDependOnFFI(t *testing.T) {
//stm: @OTHER_IMPLEMENTATION_FFI_DEPENDENCE_001
deps, err := exec.Command(goCmd(), "list", "-deps", "github.com/filecoin-project/lotus/api").Output()
if err != nil {
t.Fatal(err)
Expand All @@ -43,7 +41,6 @@ func TestDoesntDependOnFFI(t *testing.T) {
}

func TestDoesntDependOnBuild(t *testing.T) {
//stm: @OTHER_IMPLEMENTATION_FFI_DEPENDENCE_002
deps, err := exec.Command(goCmd(), "list", "-deps", "github.com/filecoin-project/lotus/api").Output()
if err != nil {
t.Fatal(err)
Expand All @@ -56,7 +53,6 @@ func TestDoesntDependOnBuild(t *testing.T) {
}

func TestReturnTypes(t *testing.T) {
//stm: @OTHER_IMPLEMENTATION_001
errType := reflect.TypeOf(new(error)).Elem()
bareIface := reflect.TypeOf(new(interface{})).Elem()
jmarsh := reflect.TypeOf(new(json.Marshaler)).Elem()
Expand Down Expand Up @@ -122,7 +118,6 @@ func TestReturnTypes(t *testing.T) {
}

func TestPermTags(t *testing.T) {
//stm: @OTHER_IMPLEMENTATION_PERM_TAGS_001
_ = PermissionedFullAPI(&FullNodeStruct{})
_ = PermissionedStorMinerAPI(&StorageMinerStruct{})
_ = PermissionedWorkerAPI(&WorkerStruct{})
Expand Down
26 changes: 25 additions & 1 deletion api/docgen/docgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,31 @@ func init() {
addExample(f3Lease)
addExample(&f3Lease)

f3Cert := certs.FinalityCertificate{
GPBFTInstance: 0,
ECChain: []gpbft.TipSet{
{
Epoch: 0,
Key: tsk.Bytes(),
PowerTable: c,
},
},
SupplementalData: gpbft.SupplementalData{
PowerTable: c,
},
Signers: bitfield.NewFromSet([]uint64{2, 3, 5, 7}),
Signature: []byte("UnDadaSeA"),
PowerTableDelta: []certs.PowerTableDelta{
{
ParticipantID: 0,
PowerDelta: gpbft.StoragePower{},
SigningKey: []byte("BaRrelEYe"),
},
},
}
addExample(f3Cert)
addExample(&f3Cert)

block := blocks.Block(&blocks.BasicBlock{})
ExampleValues[reflect.TypeOf(&block).Elem()] = block

Expand Down Expand Up @@ -429,7 +454,6 @@ func init() {
FromHeight: epochPtr(1010),
ToHeight: epochPtr(1020),
})
addExample(&certs.FinalityCertificate{})
addExample(&manifest.Manifest{})
addExample(gpbft.NetworkName("filecoin"))
addExample(gpbft.ActorID(1000))
Expand Down
15 changes: 15 additions & 0 deletions api/mocks/mock_full.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions api/proxy_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions api/proxy_util_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// stm: #unit
package api

import (
Expand Down Expand Up @@ -30,7 +29,6 @@ type StrC struct {
}

func TestGetInternalStructs(t *testing.T) {
//stm: @OTHER_IMPLEMENTATION_API_STRUCTS_001
var proxy StrA

sts := GetInternalStructs(&proxy)
Expand All @@ -46,7 +44,6 @@ func TestGetInternalStructs(t *testing.T) {
}

func TestNestedInternalStructs(t *testing.T) {
//stm: @OTHER_IMPLEMENTATION_API_STRUCTS_001
var proxy StrC

// check that only the top-level internal struct gets picked up
Expand Down
1 change: 1 addition & 0 deletions api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ type ForkUpgradeParams struct {
UpgradePhoenixHeight abi.ChainEpoch
UpgradeWaffleHeight abi.ChainEpoch
UpgradeTuktukHeight abi.ChainEpoch
UpgradeTeepHeight abi.ChainEpoch
}

// ChainExportConfig holds configuration for chain ranged exports.
Expand Down
11 changes: 0 additions & 11 deletions blockstore/badger/blockstore_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// stm: #unit
package badgerbs

import (
Expand All @@ -19,8 +18,6 @@ import (
)

func TestBadgerBlockstore(t *testing.T) {
//stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
(&Suite{
NewBlockstore: newBlockstore(DefaultOptions),
OpenBlockstore: openBlockstore(DefaultOptions),
Expand All @@ -39,8 +36,6 @@ func TestBadgerBlockstore(t *testing.T) {
}

func TestStorageKey(t *testing.T) {
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
//stm: @SPLITSTORE_BADGER_STORAGE_KEY_001
bs, _ := newBlockstore(DefaultOptions)(t)
bbs := bs.(*Blockstore)
defer bbs.Close() //nolint:errcheck
Expand Down Expand Up @@ -254,16 +249,10 @@ func testMove(t *testing.T, optsF func(string) Options) {
}

func TestMoveNoPrefix(t *testing.T) {
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
//stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
//stm: @SPLITSTORE_BADGER_DELETE_001, @SPLITSTORE_BADGER_COLLECT_GARBAGE_001
testMove(t, DefaultOptions)
}

func TestMoveWithPrefix(t *testing.T) {
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
//stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
//stm: @SPLITSTORE_BADGER_DELETE_001, @SPLITSTORE_BADGER_COLLECT_GARBAGE_001
testMove(t, func(path string) Options {
opts := DefaultOptions(path)
opts.Prefix = "/prefixed/"
Expand Down
Loading

0 comments on commit 55e1a0c

Please sign in to comment.