Merge pull request #10318 from filecoin-project/raulk/merge-v1.20.0-into-hyperspace
Merge pull request #10318 from filecoin-project/raulk/merge-v1.20.0-into-hyperspace
This commit is contained in:
+13
-6
@@ -1,8 +1,8 @@
|
||||
# Lotus changelog
|
||||
|
||||
# 1.20.0-rc1 / 2023-02-14
|
||||
# 1.20.0-rc2 / 2023-02-17
|
||||
|
||||
This is the first release candidate for the upcoming MANDATORY 1.20.0 release of Lotus. This release will deliver the Hygge network upgrade, introducing Filecoin network version 18. The centerpiece of the upgrade is the introduction of the [Filecoin Virtual Machine (FVM)’s Milestone 2.1](https://fvm.filecoin.io/), which will allow for EVM-compatible contracts to be deployed on the Filecoin network. This upgrade delivers user-programmablity to the Filecoin network for the first time!
|
||||
This is the second release candidate for the upcoming MANDATORY 1.20.0 release of Lotus. This release will deliver the Hygge network upgrade, introducing Filecoin network version 18. The centerpiece of the upgrade is the introduction of the [Filecoin Virtual Machine (FVM)’s Milestone 2.1](https://fvm.filecoin.io/), which will allow for EVM-compatible contracts to be deployed on the Filecoin network. This upgrade delivers user-programmablity to the Filecoin network for the first time!
|
||||
|
||||
Note that this release candidate does NOT set the epoch at which mainnet will upgrade; that detail will be finalized in the 1.20.0 release.
|
||||
|
||||
@@ -15,6 +15,14 @@ The Hygge upgrade introduces the following Filecoin Improvement Proposals (FIPs)
|
||||
- [FIP-0055](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0055.md): Supporting Ethereum Accounts, Addresses, and Transactions
|
||||
- [FIP-0057](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0057.md): Update gas charging schedule and system limits for FEVM
|
||||
|
||||
## Changes since v1.20.0-rc1
|
||||
|
||||
- feat: API: Add an endpoint to convert Ethereum-like addresses to Filecoin (f410) addresses (#10286)
|
||||
- fix: EthAPI: correctly decode EthGetStorageAt output (#10284)
|
||||
- feat: EthAPI: parse revert data in EthCall (#10295)
|
||||
- chore: deps: bump go-libipfs to v0.4.1
|
||||
- feat: EthAPI: return revert data on failed gas estimation #10298
|
||||
|
||||
## Filecoin Ethereum Virtual Machine (FEVM)
|
||||
|
||||
The Filecoin Ethereum Virtual Machine (FEVM) is built on top of the WASM-based execution environment introduced in the Skyr v16 upgrade. The chief feature introduced is the ability for anyone participating in the Filecoin network to deploy their own EVM-compatible contracts onto the blockchain, and invoke them as appropriate.
|
||||
@@ -27,8 +35,8 @@ The creation of EVM actors is managed by **the new** [Ethereum Address Manager a
|
||||
|
||||
## Calibration nv18 Hygge Upgrade
|
||||
|
||||
This release candidate sets the calibration-net nv18 Hygge upgrade at epoch 322354, 22023-02-21T16:30:00Z. The bundle the network will be using is [v10.0.0 actors](https://github.com/filecoin-project/builtin-actors/releases/tag/v10.0.0-rc.1)
|
||||
(located at `build/actors/v10.tar.zst`) upon/post migration, manifest CID `bafy2bzaced25ta3j6ygs34roprilbtb3f6mxifyfnm7z7ndquaruxzdq3y7lo`.
|
||||
This release candidate sets the calibration-net nv18 Hygge upgrade at epoch 322354, 2023-02-21T16:30:00Z. The bundle the network will be using is [v10.0.0 actors](https://github.com/filecoin-project/builtin-actors/releases/tag/v10.0.0-rc.1)
|
||||
(located at `build/actors/v10.tar.zst`) upon/post migration, manifest CID `bafy2bzaced25ta3j6ygs34roprilbtb3f6mxifyfnm7z7ndquaruxzdq3y7lo`.
|
||||
|
||||
## Node Operators
|
||||
|
||||
@@ -44,12 +52,11 @@ Note that Ethereum APIs are only supported in the lotus v1 API, meaning that any
|
||||
|
||||
Most of the Eth APIs take Eth accounts and tx has as an input, and they start with `0x` , and that is what Ethereum tooling support. However, in Filecoin, we have Filecoin account formats where things start with `f` (`f410` specifically for eth accounts on Filecoin) and the messages are in the format of CIDs. To enable a smooth developer experience, Lotus internally converts between Ethereum address and Filecoin account address as needed. In addition, lotus also keeps a Eth tx hash <> Filecoin message CID map and stores them in a SQLite database as node sees a FEVM messages. The database is initiated and the maps are populated automatically in `~/<lotus_repo>/sqlite/txhash.db` for any node that as Eth RPC enabled. Node operators can configure how many historical mappings they wanna store by configuring `EthTxHashMappingLifetimeDays` .
|
||||
|
||||
**Events***
|
||||
**Events**
|
||||
|
||||
[FIP-0049 introduces actor events](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0049.md) that can be emitted and externally observable during message execution. An `events.db` is created automatically under `~/<lotus_repo>/sqlite` to store these events if the node has Eth RPC enabled. Node operators can configure the events support base on their needs by configuration `Events` configurations.
|
||||
|
||||
Note: All three features are new and we welcome user feedbacks, create an issue if you have any enhancements that you’d like to see!
|
||||
|
||||
# 1.19.0 / 2022-12-07
|
||||
|
||||
This is an optional feature release of Lotus. This feature release includes the SplitStore beta, the experimental Lotus node cluster feature, as well as numerous enhancments and bugfixes.
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1
-1
@@ -40,7 +40,7 @@ func BuildTypeString() string {
|
||||
}
|
||||
|
||||
// BuildVersion is the local build version
|
||||
const BuildVersion = "1.20.0-rc1"
|
||||
const BuildVersion = "1.20.0-rc2"
|
||||
|
||||
func UserVersion() string {
|
||||
if os.Getenv("LOTUS_VERSION_IGNORE_COMMIT") == "1" {
|
||||
|
||||
@@ -240,8 +240,8 @@ func DefaultUpgradeSchedule() stmgr.UpgradeSchedule {
|
||||
Migration: UpgradeActorsV10,
|
||||
PreMigrations: []stmgr.PreMigration{{
|
||||
PreMigration: PreUpgradeActorsV10,
|
||||
StartWithin: 180,
|
||||
DontStartWithin: 60,
|
||||
StartWithin: 60,
|
||||
DontStartWithin: 10,
|
||||
StopWithin: 5,
|
||||
}},
|
||||
Expensive: true,
|
||||
|
||||
@@ -17,6 +17,7 @@ import (
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
"github.com/filecoin-project/go-state-types/builtin"
|
||||
v10 "github.com/filecoin-project/go-state-types/builtin/v10"
|
||||
market8 "github.com/filecoin-project/go-state-types/builtin/v8/market"
|
||||
adt8 "github.com/filecoin-project/go-state-types/builtin/v8/util/adt"
|
||||
v9 "github.com/filecoin-project/go-state-types/builtin/v9"
|
||||
@@ -151,7 +152,7 @@ var migrationsCmd = &cli.Command{
|
||||
if !cctx.IsSet("skip-pre-migration") {
|
||||
cache := mutil.NewMemMigrationCache()
|
||||
|
||||
ts1, err := cs.GetTipsetByHeight(ctx, blk.Height-240, migrationTs, false)
|
||||
ts1, err := cs.GetTipsetByHeight(ctx, blk.Height-60, migrationTs, false)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -163,21 +164,7 @@ var migrationsCmd = &cli.Command{
|
||||
return err
|
||||
}
|
||||
|
||||
preMigration1Time := time.Since(startTime)
|
||||
|
||||
ts2, err := cs.GetTipsetByHeight(ctx, blk.Height-15, migrationTs, false)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
startTime = time.Now()
|
||||
|
||||
err = preUpgradeActorsFunc(ctx, sm, cache, ts2.ParentState(), ts2.Height()-1, ts2)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
preMigration2Time := time.Since(startTime)
|
||||
preMigrationTime := time.Since(startTime)
|
||||
|
||||
startTime = time.Now()
|
||||
|
||||
@@ -192,8 +179,7 @@ var migrationsCmd = &cli.Command{
|
||||
return xerrors.Errorf("got different results with and without the cache: %s, %s", newCid1,
|
||||
newCid2)
|
||||
}
|
||||
fmt.Println("completed premigration 1, took ", preMigration1Time)
|
||||
fmt.Println("completed premigration 2, took ", preMigration2Time)
|
||||
fmt.Println("completed premigration, took ", preMigrationTime)
|
||||
fmt.Println("completed round actual (with cache), took ", cachedMigrationTime)
|
||||
}
|
||||
|
||||
@@ -216,7 +202,7 @@ func getMigrationFuncsForNetwork(nv network.Version) (UpgradeActorsFunc, PreUpgr
|
||||
case network.Version17:
|
||||
return filcns.UpgradeActorsV9, filcns.PreUpgradeActorsV9, checkNv17Invariants, nil
|
||||
case network.Version18:
|
||||
return filcns.UpgradeActorsV10, filcns.PreUpgradeActorsV10, nil, nil
|
||||
return filcns.UpgradeActorsV10, filcns.PreUpgradeActorsV10, checkNv18Invariants, nil
|
||||
default:
|
||||
return nil, nil, nil, xerrors.Errorf("migration not implemented for nv%d", nv)
|
||||
}
|
||||
@@ -226,6 +212,40 @@ type UpgradeActorsFunc = func(context.Context, *stmgr.StateManager, stmgr.Migrat
|
||||
type PreUpgradeActorsFunc = func(context.Context, *stmgr.StateManager, stmgr.MigrationCache, cid.Cid, abi.ChainEpoch, *types.TipSet) error
|
||||
type CheckInvariantsFunc = func(context.Context, cid.Cid, cid.Cid, blockstore.Blockstore, abi.ChainEpoch) error
|
||||
|
||||
func checkNv18Invariants(ctx context.Context, oldStateRootCid cid.Cid, newStateRootCid cid.Cid, bs blockstore.Blockstore, epoch abi.ChainEpoch) error {
|
||||
actorStore := store.ActorStore(ctx, bs)
|
||||
startTime := time.Now()
|
||||
|
||||
// Load the new state root.
|
||||
var newStateRoot types.StateRoot
|
||||
if err := actorStore.Get(ctx, newStateRootCid, &newStateRoot); err != nil {
|
||||
return xerrors.Errorf("failed to decode state root: %w", err)
|
||||
}
|
||||
|
||||
actorCodeCids, err := actors.GetActorCodeIDs(actorstypes.Version10)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
newActorTree, err := builtin.LoadTree(actorStore, newStateRoot.Actors)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
messages, err := v10.CheckStateInvariants(newActorTree, epoch, actorCodeCids)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("checking state invariants: %w", err)
|
||||
}
|
||||
|
||||
for _, message := range messages.Messages() {
|
||||
fmt.Println("got the following error: ", message)
|
||||
}
|
||||
|
||||
fmt.Println("completed invariant checks, took ", time.Since(startTime))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
/// NV17 and earlier stuff
|
||||
|
||||
func checkNv17Invariants(ctx context.Context, v8StateRootCid cid.Cid, v9StateRootCid cid.Cid, bs blockstore.Blockstore, epoch abi.ChainEpoch) error {
|
||||
actorStore := store.ActorStore(ctx, bs)
|
||||
startTime := time.Now()
|
||||
|
||||
@@ -7,7 +7,7 @@ USAGE:
|
||||
lotus-miner [global options] command [command options] [arguments...]
|
||||
|
||||
VERSION:
|
||||
1.20.0-rc1
|
||||
1.20.0-rc2
|
||||
|
||||
COMMANDS:
|
||||
init Initialize a lotus miner repo
|
||||
|
||||
@@ -7,7 +7,7 @@ USAGE:
|
||||
lotus-worker [global options] command [command options] [arguments...]
|
||||
|
||||
VERSION:
|
||||
1.20.0-rc1
|
||||
1.20.0-rc2
|
||||
|
||||
COMMANDS:
|
||||
run Start lotus worker
|
||||
|
||||
@@ -7,7 +7,7 @@ USAGE:
|
||||
lotus [global options] command [command options] [arguments...]
|
||||
|
||||
VERSION:
|
||||
1.20.0-rc1
|
||||
1.20.0-rc2
|
||||
|
||||
COMMANDS:
|
||||
daemon Start a lotus daemon process
|
||||
|
||||
@@ -39,16 +39,15 @@ require (
|
||||
github.com/filecoin-project/go-data-transfer v1.15.2
|
||||
github.com/filecoin-project/go-fil-commcid v0.1.0
|
||||
github.com/filecoin-project/go-fil-commp-hashhash v0.1.0
|
||||
github.com/filecoin-project/go-fil-markets v1.25.2
|
||||
github.com/filecoin-project/go-fil-markets v1.25.3
|
||||
github.com/filecoin-project/go-jsonrpc v0.2.1
|
||||
github.com/filecoin-project/go-legs v0.4.4
|
||||
github.com/filecoin-project/go-padreader v0.0.1
|
||||
github.com/filecoin-project/go-paramfetch v0.0.4
|
||||
github.com/filecoin-project/go-state-types v0.10.0-rc3.0.20230217201043-5366f0960838
|
||||
github.com/filecoin-project/go-state-types v0.10.0-rc3.0.20230220124418-91b4419c9b6e
|
||||
github.com/filecoin-project/go-statemachine v1.0.2
|
||||
github.com/filecoin-project/go-statestore v0.2.0
|
||||
github.com/filecoin-project/go-storedcounter v0.1.0
|
||||
github.com/filecoin-project/index-provider v0.9.1
|
||||
github.com/filecoin-project/pubsub v1.0.0
|
||||
github.com/filecoin-project/specs-actors v0.9.15
|
||||
github.com/filecoin-project/specs-actors/v2 v2.3.6
|
||||
@@ -111,6 +110,7 @@ require (
|
||||
github.com/ipld/go-codec-dagpb v1.5.0
|
||||
github.com/ipld/go-ipld-prime v0.20.0
|
||||
github.com/ipld/go-ipld-selector-text-lite v0.0.1
|
||||
github.com/ipni/index-provider v0.10.0
|
||||
github.com/kelseyhightower/envconfig v1.4.0
|
||||
github.com/koalacxr/quantile v0.0.1
|
||||
github.com/libp2p/go-buffer-pool v0.1.0
|
||||
@@ -204,7 +204,6 @@ require (
|
||||
github.com/filecoin-project/go-hamt-ipld v0.1.5 // indirect
|
||||
github.com/filecoin-project/go-hamt-ipld/v2 v2.0.0 // indirect
|
||||
github.com/filecoin-project/go-hamt-ipld/v3 v3.1.0 // indirect
|
||||
github.com/filecoin-project/storetheindex v0.4.30-0.20221114113647-683091f8e893 // indirect
|
||||
github.com/flynn/noise v1.0.0 // indirect
|
||||
github.com/francoispqt/gojay v1.2.13 // indirect
|
||||
github.com/fsnotify/fsnotify v1.5.4 // indirect
|
||||
@@ -248,6 +247,7 @@ require (
|
||||
github.com/ipfs/go-peertaskqueue v0.8.1 // indirect
|
||||
github.com/ipfs/go-verifcid v0.0.2 // indirect
|
||||
github.com/ipld/go-ipld-adl-hamt v0.0.0-20220616142416-9004dbd839e0 // indirect
|
||||
github.com/ipni/storetheindex v0.5.3-0.20221203123030-16745cb63f15 // indirect
|
||||
github.com/ipsn/go-secp256k1 v0.0.0-20180726113642-9d62b9f0bc52 // indirect
|
||||
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
|
||||
github.com/jbenet/go-random v0.0.0-20190219211222-123a90aedc0c // indirect
|
||||
|
||||
@@ -331,8 +331,8 @@ github.com/filecoin-project/go-fil-commcid v0.1.0 h1:3R4ds1A9r6cr8mvZBfMYxTS88Oq
|
||||
github.com/filecoin-project/go-fil-commcid v0.1.0/go.mod h1:Eaox7Hvus1JgPrL5+M3+h7aSPHc0cVqpSxA+TxIEpZQ=
|
||||
github.com/filecoin-project/go-fil-commp-hashhash v0.1.0 h1:imrrpZWEHRnNqqv0tN7LXep5bFEVOVmQWHJvl2mgsGo=
|
||||
github.com/filecoin-project/go-fil-commp-hashhash v0.1.0/go.mod h1:73S8WSEWh9vr0fDJVnKADhfIv/d6dCbAGaAGWbdJEI8=
|
||||
github.com/filecoin-project/go-fil-markets v1.25.2 h1:kVfgaamTC7dkn8KwS5zRJBNEBSNvVqdG3BCoDaUYuCI=
|
||||
github.com/filecoin-project/go-fil-markets v1.25.2/go.mod h1:dc2oTPU6GH3Qk1nA+Er+hSX64rg+NVykkPIWFBYxcZU=
|
||||
github.com/filecoin-project/go-fil-markets v1.25.3 h1:50kK+2VBmyh9SuuS/MgcTRaWlVdBdTZLPCzMxw8ONBg=
|
||||
github.com/filecoin-project/go-fil-markets v1.25.3/go.mod h1:eOIYHfPwyqc64O1HiapvcelfnrTfU7gLQgBf55IYleQ=
|
||||
github.com/filecoin-project/go-hamt-ipld v0.1.5 h1:uoXrKbCQZ49OHpsTCkrThPNelC4W3LPEk0OrS/ytIBM=
|
||||
github.com/filecoin-project/go-hamt-ipld v0.1.5/go.mod h1:6Is+ONR5Cd5R6XZoCse1CWaXZc0Hdb/JeX+EQCQzX24=
|
||||
github.com/filecoin-project/go-hamt-ipld/v2 v2.0.0 h1:b3UDemBYN2HNfk3KOXNuxgTTxlWi3xVvbQP0IT38fvM=
|
||||
@@ -356,8 +356,8 @@ github.com/filecoin-project/go-state-types v0.1.0/go.mod h1:ezYnPf0bNkTsDibL/psS
|
||||
github.com/filecoin-project/go-state-types v0.1.6/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q=
|
||||
github.com/filecoin-project/go-state-types v0.1.8/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q=
|
||||
github.com/filecoin-project/go-state-types v0.1.10/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q=
|
||||
github.com/filecoin-project/go-state-types v0.10.0-rc3.0.20230217201043-5366f0960838 h1:VSccjnMEVMpG3KCUJOBNjKJpMiHhELf3h6XGKYaSMvE=
|
||||
github.com/filecoin-project/go-state-types v0.10.0-rc3.0.20230217201043-5366f0960838/go.mod h1:aLIas+W8BWAfpLWEPUOGMPBdhcVwoCG4pIQSQk26024=
|
||||
github.com/filecoin-project/go-state-types v0.10.0-rc3.0.20230220124418-91b4419c9b6e h1:/BOy8CdtzKaPRi81OFxTNDLOWq2dO5P2GPD45pslp8Y=
|
||||
github.com/filecoin-project/go-state-types v0.10.0-rc3.0.20230220124418-91b4419c9b6e/go.mod h1:aLIas+W8BWAfpLWEPUOGMPBdhcVwoCG4pIQSQk26024=
|
||||
github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe/go.mod h1:FGwQgZAt2Gh5mjlwJUlVB62JeYdo+if0xWxSEfBD9ig=
|
||||
github.com/filecoin-project/go-statemachine v1.0.2 h1:421SSWBk8GIoCoWYYTE/d+qCWccgmRH0uXotXRDjUbc=
|
||||
github.com/filecoin-project/go-statemachine v1.0.2/go.mod h1:jZdXXiHa61n4NmgWFG4w8tnqgvZVHYbJ3yW7+y8bF54=
|
||||
@@ -366,8 +366,6 @@ github.com/filecoin-project/go-statestore v0.2.0 h1:cRRO0aPLrxKQCZ2UOQbzFGn4WDNd
|
||||
github.com/filecoin-project/go-statestore v0.2.0/go.mod h1:8sjBYbS35HwPzct7iT4lIXjLlYyPor80aU7t7a/Kspo=
|
||||
github.com/filecoin-project/go-storedcounter v0.1.0 h1:Mui6wSUBC+cQGHbDUBcO7rfh5zQkWJM/CpAZa/uOuus=
|
||||
github.com/filecoin-project/go-storedcounter v0.1.0/go.mod h1:4ceukaXi4vFURIoxYMfKzaRF5Xv/Pinh2oTnoxpv+z8=
|
||||
github.com/filecoin-project/index-provider v0.9.1 h1:Jnh9dviIHvQxZ2baNoYu3n8z6F9O62ksnVlyREgPyyM=
|
||||
github.com/filecoin-project/index-provider v0.9.1/go.mod h1:NlHxQcy2iMGfUoUGUzrRxntcpiC50QSnvp68u2VTT40=
|
||||
github.com/filecoin-project/pubsub v1.0.0 h1:ZTmT27U07e54qV1mMiQo4HDr0buo8I1LDHBYLXlsNXM=
|
||||
github.com/filecoin-project/pubsub v1.0.0/go.mod h1:GkpB33CcUtUNrLPhJgfdy4FDx4OMNR9k+46DHx/Lqrg=
|
||||
github.com/filecoin-project/specs-actors v0.9.13/go.mod h1:TS1AW/7LbG+615j4NsjMK1qlpAwaFsG9w0V2tg2gSao=
|
||||
@@ -388,8 +386,6 @@ github.com/filecoin-project/specs-actors/v7 v7.0.1 h1:w72xCxijK7xs1qzmJiw+WYJaVt
|
||||
github.com/filecoin-project/specs-actors/v7 v7.0.1/go.mod h1:tPLEYXoXhcpyLh69Ccq91SOuLXsPWjHiY27CzawjUEk=
|
||||
github.com/filecoin-project/specs-actors/v8 v8.0.1 h1:4u0tIRJeT5G7F05lwLRIsDnsrN+bJ5Ixj6h49Q7uE2Y=
|
||||
github.com/filecoin-project/specs-actors/v8 v8.0.1/go.mod h1:UYIPg65iPWoFw5NEftREdJwv9b/5yaLKdCgTvNI/2FA=
|
||||
github.com/filecoin-project/storetheindex v0.4.30-0.20221114113647-683091f8e893 h1:6GCuzxLVHBzlz7y+FkbHh6n0UyoEGWqDwJKQPJoz7bE=
|
||||
github.com/filecoin-project/storetheindex v0.4.30-0.20221114113647-683091f8e893/go.mod h1:S7590oDimBvXMUtzWsBXoshu9HtYKwtXl47zAK9rcP8=
|
||||
github.com/filecoin-project/test-vectors/schema v0.0.5 h1:w3zHQhzM4pYxJDl21avXjOKBLF8egrvwUwjpT8TquDg=
|
||||
github.com/filecoin-project/test-vectors/schema v0.0.5/go.mod h1:iQ9QXLpYWL3m7warwvK1JC/pTri8mnfEmKygNDqqY6E=
|
||||
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
|
||||
@@ -910,6 +906,10 @@ github.com/ipld/go-ipld-prime/storage/bsadapter v0.0.0-20211210234204-ce2a1c70cd
|
||||
github.com/ipld/go-ipld-prime/storage/bsadapter v0.0.0-20211210234204-ce2a1c70cd73/go.mod h1:2PJ0JgxyB08t0b2WKrcuqI3di0V+5n6RS/LTUJhkoxY=
|
||||
github.com/ipld/go-ipld-selector-text-lite v0.0.1 h1:lNqFsQpBHc3p5xHob2KvEg/iM5dIFn6iw4L/Hh+kS1Y=
|
||||
github.com/ipld/go-ipld-selector-text-lite v0.0.1/go.mod h1:U2CQmFb+uWzfIEF3I1arrDa5rwtj00PrpiwwCO+k1RM=
|
||||
github.com/ipni/index-provider v0.10.0 h1:nu8YBxzRopdjwZHsgCUuC4AHpq88VVHJYrbkqUDx7eg=
|
||||
github.com/ipni/index-provider v0.10.0/go.mod h1:InSXbZp2p/ZhAwiDElG/wzjnA1ea1iJ3hhyiAHrD+Vo=
|
||||
github.com/ipni/storetheindex v0.5.3-0.20221203123030-16745cb63f15 h1:qJq6QtLk+9nQi3CDBhNfJ1cjZ4pghjCHcQUZ1mWbF0k=
|
||||
github.com/ipni/storetheindex v0.5.3-0.20221203123030-16745cb63f15/go.mod h1:c/NS640Iu2NrCCIErnUhsUM5KVEyeXymgtNnx6eDwMU=
|
||||
github.com/ipsn/go-secp256k1 v0.0.0-20180726113642-9d62b9f0bc52 h1:QG4CGBqCeuBo6aZlGAamSkxWdgWfZGeE49eUOWJPA4c=
|
||||
github.com/ipsn/go-secp256k1 v0.0.0-20180726113642-9d62b9f0bc52/go.mod h1:fdg+/X9Gg4AsAIzWpEHwnqd+QY3b7lajxyjE1m4hkq4=
|
||||
github.com/jackpal/gateway v1.0.5/go.mod h1:lTpwd4ACLXmpyiCTRtfiNyVnUmqT9RivzCDQetPfnjA=
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
608060405234801561001057600080fd5b5061024d806100206000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c806311dcda5214610067578063188ec356146100715780633e64a6961461008f57806342cbb15c146100ad578063564b81ef146100cb578063bfc6ac54146100e9575b600080fd5b61006f610107565b005b610079610117565b6040516100869190610165565b60405180910390f35b61009761011f565b6040516100a49190610165565b60405180910390f35b6100b5610127565b6040516100c29190610165565b60405180910390f35b6100d361012f565b6040516100e09190610165565b60405180910390f35b6100f1610137565b6040516100fe9190610199565b60405180910390f35b61013a461461011557600080fd5b565b600042905090565b600048905090565b600043905090565b600046905090565b600060014361014691906101e3565b40905090565b6000819050919050565b61015f8161014c565b82525050565b600060208201905061017a6000830184610156565b92915050565b6000819050919050565b61019381610180565b82525050565b60006020820190506101ae600083018461018a565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006101ee8261014c565b91506101f98361014c565b9250828203905081811115610211576102106101b4565b5b9291505056fea264697066735822122015a2d5fbebc013a5c3ece3d5bbf98707100b155793f6d340c3df6a736a3f1dfa64736f6c63430008110033
|
||||
@@ -0,0 +1,24 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity >=0.8.17;
|
||||
|
||||
contract BlockTest {
|
||||
|
||||
function testChainID() public view{
|
||||
require(block.chainid == 314);
|
||||
}
|
||||
|
||||
function getBlockhashPrevious() public view returns (bytes32) {
|
||||
return blockhash(block.number-1);
|
||||
}
|
||||
|
||||
function getBasefee() public view returns (uint256){
|
||||
return block.basefee;
|
||||
}
|
||||
|
||||
function getBlockNumber() public view returns (uint256){
|
||||
return block.number;
|
||||
}
|
||||
function getTimestamp() public view returns (uint256){
|
||||
return block.timestamp;
|
||||
}
|
||||
}
|
||||
@@ -8,12 +8,12 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
provider "github.com/ipni/index-provider"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
datatransfer "github.com/filecoin-project/go-data-transfer"
|
||||
"github.com/filecoin-project/go-fil-markets/shared_testutil"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
provider "github.com/filecoin-project/index-provider"
|
||||
|
||||
"github.com/filecoin-project/lotus/api"
|
||||
"github.com/filecoin-project/lotus/itests/kit"
|
||||
|
||||
@@ -883,6 +883,96 @@ func TestFEVMGetBlockDifficulty(t *testing.T) {
|
||||
require.Equal(t, len(ret), 32)
|
||||
}
|
||||
|
||||
func TestFEVMTestCorrectChainID(t *testing.T) {
|
||||
ctx, cancel, client := kit.SetupFEVMTest(t)
|
||||
defer cancel()
|
||||
|
||||
//install contract
|
||||
filenameActor := "contracts/Blocktest.hex"
|
||||
fromAddr, contractAddr := client.EVM().DeployContractFromFilename(ctx, filenameActor)
|
||||
|
||||
//run test
|
||||
_, _, err := client.EVM().InvokeContractByFuncName(ctx, fromAddr, contractAddr, "testChainID()", []byte{})
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
func TestFEVMGetChainPropertiesBlockTimestamp(t *testing.T) {
|
||||
ctx, cancel, client := kit.SetupFEVMTest(t)
|
||||
defer cancel()
|
||||
|
||||
//install contract
|
||||
filenameActor := "contracts/Blocktest.hex"
|
||||
fromAddr, contractAddr := client.EVM().DeployContractFromFilename(ctx, filenameActor)
|
||||
|
||||
// block number check
|
||||
ret, wait, err := client.EVM().InvokeContractByFuncName(ctx, fromAddr, contractAddr, "getTimestamp()", []byte{})
|
||||
require.NoError(t, err)
|
||||
|
||||
timestampFromSolidity, err := decodeOutputToUint64(ret)
|
||||
require.NoError(t, err)
|
||||
|
||||
ethBlock := client.EVM().GetEthBlockFromWait(ctx, wait)
|
||||
|
||||
require.Equal(t, ethBlock.Timestamp, ethtypes.EthUint64(timestampFromSolidity))
|
||||
}
|
||||
|
||||
func TestFEVMGetChainPropertiesBlockNumber(t *testing.T) {
|
||||
ctx, cancel, client := kit.SetupFEVMTest(t)
|
||||
defer cancel()
|
||||
|
||||
//install contract
|
||||
filenameActor := "contracts/Blocktest.hex"
|
||||
fromAddr, contractAddr := client.EVM().DeployContractFromFilename(ctx, filenameActor)
|
||||
|
||||
// block number check
|
||||
ret, wait, err := client.EVM().InvokeContractByFuncName(ctx, fromAddr, contractAddr, "getBlockNumber()", []byte{})
|
||||
require.NoError(t, err)
|
||||
|
||||
blockHeightFromSolidity, err := decodeOutputToUint64(ret)
|
||||
require.NoError(t, err)
|
||||
|
||||
ethBlock := client.EVM().GetEthBlockFromWait(ctx, wait)
|
||||
|
||||
require.Equal(t, ethBlock.Number, ethtypes.EthUint64(blockHeightFromSolidity))
|
||||
}
|
||||
|
||||
func TestFEVMGetChainPropertiesBlockHash(t *testing.T) {
|
||||
ctx, cancel, client := kit.SetupFEVMTest(t)
|
||||
defer cancel()
|
||||
|
||||
//install contract
|
||||
filenameActor := "contracts/Blocktest.hex"
|
||||
fromAddr, contractAddr := client.EVM().DeployContractFromFilename(ctx, filenameActor)
|
||||
|
||||
//block hash check
|
||||
ret, wait, err := client.EVM().InvokeContractByFuncName(ctx, fromAddr, contractAddr, "getBlockhashPrevious()", []byte{})
|
||||
expectedBlockHash := hex.EncodeToString(ret)
|
||||
require.NoError(t, err)
|
||||
|
||||
ethBlock := client.EVM().GetEthBlockFromWait(ctx, wait)
|
||||
//in solidity we get the parent block hash because the current block hash doesnt exist at that execution context yet
|
||||
//so we compare the parent hash here in the test
|
||||
require.Equal(t, "0x"+expectedBlockHash, ethBlock.ParentHash.String())
|
||||
}
|
||||
|
||||
func TestFEVMGetChainPropertiesBaseFee(t *testing.T) {
|
||||
ctx, cancel, client := kit.SetupFEVMTest(t)
|
||||
defer cancel()
|
||||
|
||||
//install contract
|
||||
filenameActor := "contracts/Blocktest.hex"
|
||||
fromAddr, contractAddr := client.EVM().DeployContractFromFilename(ctx, filenameActor)
|
||||
|
||||
ret, wait, err := client.EVM().InvokeContractByFuncName(ctx, fromAddr, contractAddr, "getBasefee()", []byte{})
|
||||
require.NoError(t, err)
|
||||
baseFeeRet, err := decodeOutputToUint64(ret)
|
||||
require.NoError(t, err)
|
||||
|
||||
ethBlock := client.EVM().GetEthBlockFromWait(ctx, wait)
|
||||
|
||||
require.Equal(t, ethBlock.BaseFeePerGas, ethtypes.EthBigInt(big.NewInt(int64(baseFeeRet))))
|
||||
}
|
||||
|
||||
func TestFEVMErrorParsing(t *testing.T) {
|
||||
ctx, cancel, client := kit.SetupFEVMTest(t)
|
||||
defer cancel()
|
||||
|
||||
@@ -235,6 +235,22 @@ func (e *EVM) ComputeContractAddress(deployer ethtypes.EthAddress, nonce uint64)
|
||||
return *(*ethtypes.EthAddress)(hasher.Sum(nil)[12:])
|
||||
}
|
||||
|
||||
// return eth block from a wait return
|
||||
// this necessarily goes back one parent in the chain because wait is one block ahead of execution
|
||||
func (e *EVM) GetEthBlockFromWait(ctx context.Context, wait *api.MsgLookup) ethtypes.EthBlock {
|
||||
c, err := wait.TipSet.Cid()
|
||||
require.NoError(e.t, err)
|
||||
hash, err := ethtypes.EthHashFromCid(c)
|
||||
require.NoError(e.t, err)
|
||||
|
||||
ethBlockParent, err := e.EthGetBlockByHash(ctx, hash, true)
|
||||
require.NoError(e.t, err)
|
||||
ethBlock, err := e.EthGetBlockByHash(ctx, ethBlockParent.ParentHash, true)
|
||||
require.NoError(e.t, err)
|
||||
|
||||
return ethBlock
|
||||
}
|
||||
|
||||
func (e *EVM) InvokeContractByFuncName(ctx context.Context, fromAddr address.Address, idAddr address.Address, funcSignature string, inputData []byte) ([]byte, *api.MsgLookup, error) {
|
||||
entryPoint := CalcFuncSignature(funcSignature)
|
||||
wait, err := e.InvokeSolidity(ctx, fromAddr, idAddr, entryPoint, inputData)
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
provider "github.com/ipni/index-provider"
|
||||
"go.uber.org/fx"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
@@ -12,7 +13,6 @@ import (
|
||||
"github.com/filecoin-project/go-fil-markets/storagemarket"
|
||||
"github.com/filecoin-project/go-fil-markets/storagemarket/impl/storedask"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
provider "github.com/filecoin-project/index-provider"
|
||||
|
||||
"github.com/filecoin-project/lotus/api"
|
||||
"github.com/filecoin-project/lotus/api/v1api"
|
||||
|
||||
@@ -940,7 +940,7 @@ func (a *EthModule) EthEstimateGas(ctx context.Context, tx ethtypes.EthCall) (et
|
||||
|
||||
expectedGas, err := ethGasSearch(ctx, a.Chain, a.Stmgr, a.Mpool, gassedMsg, ts)
|
||||
if err != nil {
|
||||
log.Errorw("expected gas", "err", err)
|
||||
return 0, xerrors.Errorf("gas search failed: %w", err)
|
||||
}
|
||||
|
||||
return ethtypes.EthUint64(expectedGas), nil
|
||||
@@ -2202,11 +2202,13 @@ func (m *EthTxHashManager) ProcessSignedMessage(ctx context.Context, msg *types.
|
||||
ethTx, err := newEthTxFromSignedMessage(ctx, msg, m.StateAPI)
|
||||
if err != nil {
|
||||
log.Errorf("error converting filecoin message to eth tx: %s", err)
|
||||
return
|
||||
}
|
||||
|
||||
err = m.TransactionHashLookup.UpsertHash(ethTx.Hash, msg.Cid())
|
||||
if err != nil {
|
||||
log.Errorf("error inserting tx mapping to db: %s", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ import (
|
||||
graphsync "github.com/ipfs/go-graphsync/impl"
|
||||
gsnet "github.com/ipfs/go-graphsync/network"
|
||||
"github.com/ipfs/go-graphsync/storeutil"
|
||||
provider "github.com/ipni/index-provider"
|
||||
"github.com/libp2p/go-libp2p/core/host"
|
||||
"go.uber.org/fx"
|
||||
"go.uber.org/multierr"
|
||||
@@ -42,7 +43,6 @@ import (
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/big"
|
||||
"github.com/filecoin-project/go-statestore"
|
||||
provider "github.com/filecoin-project/index-provider"
|
||||
|
||||
"github.com/filecoin-project/lotus/api"
|
||||
"github.com/filecoin-project/lotus/api/v0api"
|
||||
|
||||
@@ -5,14 +5,14 @@ import (
|
||||
|
||||
"github.com/ipfs/go-datastore"
|
||||
"github.com/ipfs/go-datastore/namespace"
|
||||
provider "github.com/ipni/index-provider"
|
||||
"github.com/ipni/index-provider/engine"
|
||||
pubsub "github.com/libp2p/go-libp2p-pubsub"
|
||||
"github.com/libp2p/go-libp2p/core/host"
|
||||
"go.uber.org/fx"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
provider "github.com/filecoin-project/index-provider"
|
||||
"github.com/filecoin-project/index-provider/engine"
|
||||
|
||||
"github.com/filecoin-project/lotus/build"
|
||||
"github.com/filecoin-project/lotus/node/config"
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/ipfs/go-datastore"
|
||||
provider "github.com/ipni/index-provider"
|
||||
"github.com/libp2p/go-libp2p"
|
||||
pubsub "github.com/libp2p/go-libp2p-pubsub"
|
||||
"github.com/libp2p/go-libp2p/core/host"
|
||||
@@ -14,7 +15,6 @@ import (
|
||||
"go.uber.org/fx"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
provider "github.com/filecoin-project/index-provider"
|
||||
|
||||
"github.com/filecoin-project/lotus/node/config"
|
||||
"github.com/filecoin-project/lotus/node/modules"
|
||||
|
||||
Reference in New Issue
Block a user