diff --git a/CHANGELOG.md b/CHANGELOG.md index fbf66945a..64a560bd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,12 @@ # Lotus changelog -# v1.24.0-rc3 / 2023-10-31 +# 1.24.0-rc4 / 2023-11-02 -This is the third release candidate of the upcoming **MANDATORY Lotus v1.24.0** release, which will deliver the Filecoin network version 21, codenamed Watermelon 🍉. +This is the 4th release candidate of the upcoming **MANDATORY Lotus v1.24.0** release, which will deliver the Filecoin network version 21, codenamed Watermelon 🍉. -**This release candidate does NOT set an upgrade epoch for mainnet. However, it includes a patch for the calibration testnet to fix an issue where partitions with expired sectors had to be compacted before they could be moved. Unfortunately, this bug impacts consensus and necessitates a coordinated upgrade on the Calibration network to deploy the new code. The calibration network is scheduled to upgrade all miner actors to the new, fixed miner actor CID at epoch 1070494, which is expected to occur at 2023-11-07T13:00:00Z.** +This release candidate also sets an upgrade epoch for mainnet at `3431940` 2023-11-29T13:30:00Z. + +**It includes a patch for the calibration testnet to fix an issue where partitions with expired sectors had to be compacted before they could be moved. Unfortunately, this bug impacts consensus and necessitates a coordinated upgrade on the Calibration network to deploy the new code. The calibration network is scheduled to upgrade all miner actors to the new, fixed miner actor CID at epoch 1070494, which is expected to occur at 2023-11-07T13:00:00Z.** The Filecoin network version 21 delivers the following FIPs: @@ -20,6 +22,7 @@ The Filecoin network version 21 delivers the following FIPs: The actor bundles for the calibration network can be checked as follows: +**before 1070494** ``` lotus state actor-cids --network-version=21 Network Version: 21 @@ -45,6 +48,14 @@ cron bafk2bzacec4gdxxkqwxqqodsv6ug5dmdbqdfqwyqfek3yhxc2wweh5psxaeq6 datacap bafk2bzacecq5ppfskxgv3iea3jarsix6jdduuhwsn4fbvngtbmzelzmlygorm ``` +**after 1070494** +``` +lotus state actor-cids --network-version=21 +Network Version: 21 +Actor Version: 12 +Manifest CID: bafy2bzacedrunxfqta5skb7q7x32lnp4efz2oq7fn226ffm7fu5iqs62jkmvs +``` + ## New features - Implement and support [FIP0052: Increase Max Sector Commitment to 3.5 years](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0052.md) - fix: docs: Update SectorLifetime to be in line with FIP-0052 ([filecoin-project/lotus#11314](https://github.com/filecoin-project/lotus/pull/11314)) @@ -99,7 +110,7 @@ This feature release requires a **minimum Go version of v1.19.12 or higher to su - feat: sealing: flag to run data_cid untied from addpiece ([filecoin-project/lotus#10797](https://github.com/filecoin-project/lotus/pull/10797)) - feat: Lotus Gateway: add MpoolPending, ChainGetBlock and MinerGetBaseInfo ([filecoin-project/lotus#10929](https://github.com/filecoin-project/lotus/pull/10929)) -## Improvements +## Improvements && Bug Fixe - chore: update ffi & fvm ([filecoin-project/lotus#11040](https://github.com/filecoin-project/lotus/pull/11040)) - feat: Make sure we don't store duplidate actor events caused to reorgs in events.db ([filecoin-project/lotus#11015](https://github.com/filecoin-project/lotus/pull/11015)) - sealing: Use only non-assigned deals when selecting snap sectors ([filecoin-project/lotus#11002](https://github.com/filecoin-project/lotus/pull/11002)) @@ -177,6 +188,10 @@ This feature release requires a **minimum Go version of v1.19.12 or higher to su - fix: cli: Change arg wording in change-beneficiary cmd ([filecoin-project/lotus#10823](https://github.com/filecoin-project/lotus/pull/10823)) - refactor: streamline error handling in CheckPendingMessages (#10818) ([filecoin-project/lotus#10818](https://github.com/filecoin-project/lotus/pull/10818)) - feat: Add tmp indices to events table while performing migration to V2 + - fix: sync: iterate over returned messages directly #11373 + - fix: api: compute the effective gas cost with the correct base-fee #11357 + - fix: check invariants: v12 check #11371 + - fix: api: compute gasUsedRatio based on max gas in the tipset #11354 # v1.23.2 / 2023-06-28 diff --git a/build/openrpc/full.json.gz b/build/openrpc/full.json.gz index f27d90997..bc7aab363 100644 Binary files a/build/openrpc/full.json.gz and b/build/openrpc/full.json.gz differ diff --git a/build/openrpc/gateway.json.gz b/build/openrpc/gateway.json.gz index 9d0257326..5c4a3acb2 100644 Binary files a/build/openrpc/gateway.json.gz and b/build/openrpc/gateway.json.gz differ diff --git a/build/openrpc/miner.json.gz b/build/openrpc/miner.json.gz index fba28b074..71ffd7615 100644 Binary files a/build/openrpc/miner.json.gz and b/build/openrpc/miner.json.gz differ diff --git a/build/openrpc/worker.json.gz b/build/openrpc/worker.json.gz index d09b408d9..e09dc29c1 100644 Binary files a/build/openrpc/worker.json.gz and b/build/openrpc/worker.json.gz differ diff --git a/build/params_mainnet.go b/build/params_mainnet.go index be7116103..b4fe5e701 100644 --- a/build/params_mainnet.go +++ b/build/params_mainnet.go @@ -95,8 +95,8 @@ const UpgradeLightningHeight = 2809800 // 2023-05-18T13:00:00Z const UpgradeThunderHeight = UpgradeLightningHeight + 2880*21 -// ??????? -var UpgradeWatermelonHeight = abi.ChainEpoch(9999999999) +// 2023-11-29T13:30:00Z +var UpgradeWatermelonHeight = abi.ChainEpoch(3431940) // This fix upgrade only ran on calibrationnet const UpgradeWatermelonFixHeight = -1 diff --git a/build/version.go b/build/version.go index 99f5b9500..c4ec6ff81 100644 --- a/build/version.go +++ b/build/version.go @@ -37,7 +37,7 @@ func BuildTypeString() string { } // BuildVersion is the local build version -const BuildVersion = "1.24.0-rc3" +const BuildVersion = "1.24.0-rc4" func UserVersion() string { if os.Getenv("LOTUS_VERSION_IGNORE_COMMIT") == "1" { diff --git a/chain/sync.go b/chain/sync.go index 7830a9771..d8892a84e 100644 --- a/chain/sync.go +++ b/chain/sync.go @@ -1094,8 +1094,8 @@ func (syncer *Syncer) fetchMessages(ctx context.Context, headers []*types.TipSet requestErr = multierror.Append(requestErr, err) } else { isGood := true - for index, ts := range headers[nextI:lastI] { - cm := result[index] + for index, cm := range result { + ts := headers[nextI+index] if err := checkMsgMeta(ts, cm.Bls, cm.Secpk, cm.BlsIncludes, cm.SecpkIncludes); err != nil { log.Errorf("fetched messages not as expected: %s", err) isGood = false diff --git a/cmd/lotus-shed/invariants.go b/cmd/lotus-shed/invariants.go index 51d746f79..e74a0dd24 100644 --- a/cmd/lotus-shed/invariants.go +++ b/cmd/lotus-shed/invariants.go @@ -16,6 +16,7 @@ import ( "github.com/filecoin-project/go-state-types/builtin" v10 "github.com/filecoin-project/go-state-types/builtin/v10" v11 "github.com/filecoin-project/go-state-types/builtin/v11" + v12 "github.com/filecoin-project/go-state-types/builtin/v12" v8 "github.com/filecoin-project/go-state-types/builtin/v8" v9 "github.com/filecoin-project/go-state-types/builtin/v9" @@ -149,6 +150,13 @@ var invariantsCmd = &cli.Command{ if err != nil { return xerrors.Errorf("checking state invariants: %w", err) } + case actorstypes.Version12: + messages, err = v12.CheckStateInvariants(actorTree, abi.ChainEpoch(epoch), actorCodeCids) + if err != nil { + return xerrors.Errorf("checking state invariants: %w", err) + } + default: + return xerrors.Errorf("unsupported actor version: %v", av) } fmt.Println("completed, took ", time.Since(startTime)) diff --git a/documentation/en/cli-lotus-miner.md b/documentation/en/cli-lotus-miner.md index 63f655b96..a8f59fadf 100644 --- a/documentation/en/cli-lotus-miner.md +++ b/documentation/en/cli-lotus-miner.md @@ -7,7 +7,7 @@ USAGE: lotus-miner [global options] command [command options] [arguments...] VERSION: - 1.24.0-rc3 + 1.24.0-rc4 COMMANDS: init Initialize a lotus miner repo diff --git a/documentation/en/cli-lotus-worker.md b/documentation/en/cli-lotus-worker.md index 186e42401..dc70d8314 100644 --- a/documentation/en/cli-lotus-worker.md +++ b/documentation/en/cli-lotus-worker.md @@ -7,7 +7,7 @@ USAGE: lotus-worker [global options] command [command options] [arguments...] VERSION: - 1.24.0-rc3 + 1.24.0-rc4 COMMANDS: run Start lotus worker diff --git a/documentation/en/cli-lotus.md b/documentation/en/cli-lotus.md index 71a0a2ba7..8aab199e3 100644 --- a/documentation/en/cli-lotus.md +++ b/documentation/en/cli-lotus.md @@ -7,7 +7,7 @@ USAGE: lotus [global options] command [command options] [arguments...] VERSION: - 1.24.0-rc3 + 1.24.0-rc4 COMMANDS: daemon Start a lotus daemon process diff --git a/itests/eth_transactions_test.go b/itests/eth_transactions_test.go index 8d836573d..3c131a256 100644 --- a/itests/eth_transactions_test.go +++ b/itests/eth_transactions_test.go @@ -81,12 +81,16 @@ func TestValueTransferValidSignature(t *testing.T) { receipt, err := waitForEthTxReceipt(ctx, client, hash) require.NoError(t, err) require.NotNil(t, receipt) + require.EqualValues(t, ethAddr, receipt.From) + require.EqualValues(t, ethAddr2, *receipt.To) + require.EqualValues(t, hash, receipt.TransactionHash) // Success. require.EqualValues(t, ethtypes.EthUint64(0x1), receipt.Status) + // Validate that we sent the expected transaction. ethTx, err := client.EthGetTransactionByHash(ctx, &hash) - require.Nil(t, err) + require.NoError(t, err) require.EqualValues(t, ethAddr, ethTx.From) require.EqualValues(t, ethAddr2, *ethTx.To) require.EqualValues(t, tx.ChainID, ethTx.ChainID) @@ -269,6 +273,17 @@ func TestContractInvocation(t *testing.T) { // Success. require.EqualValues(t, ethtypes.EthUint64(0x1), receipt.Status) + + // Validate that we correctly computed the gas outputs. + mCid, err := client.EthGetMessageCidByTransactionHash(ctx, &hash) + require.NoError(t, err) + require.NotNil(t, mCid) + + invokResult, err := client.StateReplay(ctx, types.EmptyTSK, *mCid) + require.NoError(t, err) + require.EqualValues(t, invokResult.GasCost.GasUsed, big.NewInt(int64(receipt.GasUsed))) + effectiveGasPrice := big.Div(invokResult.GasCost.TotalCost, invokResult.GasCost.GasUsed) + require.EqualValues(t, effectiveGasPrice, big.Int(receipt.EffectiveGasPrice)) } func TestGetBlockByNumber(t *testing.T) { diff --git a/node/impl/full/eth.go b/node/impl/full/eth.go index 424756f81..f4d9d8371 100644 --- a/node/impl/full/eth.go +++ b/node/impl/full/eth.go @@ -825,10 +825,11 @@ func (a *EthModule) EthFeeHistory(ctx context.Context, p jsonrpc.RawParams) (eth } rewards, totalGasUsed := calculateRewardsAndGasUsed(rewardPercentiles, txGasRewards) + maxGas := build.BlockGasLimit * int64(len(ts.Blocks())) // arrays should be reversed at the end baseFeeArray = append(baseFeeArray, ethtypes.EthBigInt(basefee)) - gasUsedRatioArray = append(gasUsedRatioArray, float64(totalGasUsed)/float64(build.BlockGasLimit)) + gasUsedRatioArray = append(gasUsedRatioArray, float64(totalGasUsed)/float64(maxGas)) rewardsArray = append(rewardsArray, rewards) oldestBlkHeight = uint64(ts.Height()) blocksIncluded++ @@ -2277,7 +2278,13 @@ func newEthTxReceipt(ctx context.Context, tx ethtypes.EthTx, lookup *api.MsgLook return api.EthTxReceipt{}, xerrors.Errorf("failed to lookup tipset %s when constructing the eth txn receipt: %w", lookup.TipSet, err) } - baseFee := ts.Blocks()[0].ParentBaseFee + // The tx is located in the parent tipset + parentTs, err := cs.LoadTipSet(ctx, ts.Parents()) + if err != nil { + return api.EthTxReceipt{}, xerrors.Errorf("failed to lookup tipset %s when constructing the eth txn receipt: %w", ts.Parents(), err) + } + + baseFee := parentTs.Blocks()[0].ParentBaseFee gasOutputs := vm.ComputeGasOutputs(lookup.Receipt.GasUsed, int64(tx.Gas), baseFee, big.Int(tx.MaxFeePerGas), big.Int(tx.MaxPriorityFeePerGas), true) totalSpent := big.Sum(gasOutputs.BaseFeeBurn, gasOutputs.MinerTip, gasOutputs.OverEstimationBurn)