Skip to content

Commit 124b5a7

Browse files
authored
Merge pull request #6491 from filecoin-project/feat/nv27
Feat/nv27
2 parents bfc995d + 7e5db98 commit 124b5a7

File tree

98 files changed

+3888
-634
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+3888
-634
lines changed

app/submodule/chain/chaininfo_api.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,7 @@ func (cia *chainInfoAPI) StateGetNetworkParams(ctx context.Context) (*types.Netw
763763
UpgradeTuktukHeight: cfg.NetworkParams.ForkUpgradeParam.UpgradeTuktukHeight,
764764
UpgradeTeepHeight: cfg.NetworkParams.ForkUpgradeParam.UpgradeTeepHeight,
765765
UpgradeTockHeight: cfg.NetworkParams.ForkUpgradeParam.UpgradeTockHeight,
766+
UpgradeXxHeight: cfg.NetworkParams.ForkUpgradeParam.UpgradeXxHeight,
766767
},
767768
Eip155ChainID: cfg.NetworkParams.Eip155ChainID,
768769
}

app/submodule/eth/eth_api.go

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,13 @@ func (a *ethAPI) EthGetTransactionCount(ctx context.Context, sender types.EthAdd
417417
return types.EthUint64(0), fmt.Errorf("failed to process block param: %v, %w", blkParam, err)
418418
}
419419

420+
stateCid, _, err := a.em.chainModule.Stmgr.StateView(ctx, ts)
421+
if err != nil {
422+
return 0, err
423+
}
424+
420425
// Get the actor state at the specified tipset
421-
actor, err := a.em.chainModule.Stmgr.GetActorAt(ctx, addr, ts)
426+
actor, err := a.em.chainModule.Stmgr.GetActorRaw(ctx, addr, stateCid)
422427
if err != nil {
423428
if errors.Is(err, types.ErrActorNotFound) {
424429
return 0, nil
@@ -464,8 +469,10 @@ func (a *ethAPI) EthGetTransactionReceiptLimited(ctx context.Context, txHash typ
464469
return nil, fmt.Errorf("failed to lookup Eth Txn %s as %s: %w", txHash, c, err)
465470
}
466471
if msgLookup == nil {
467-
// This is the best we can do. In theory, we could have just not indexed this
468-
// transaction, but there's no way to check that here.
472+
// This is the best we can do. We may just not have indexed this transaction, or we may have a
473+
// limit applied and not searched far back enough, but we don't have a way to go. Because
474+
// Ethereum tooling expects an empty response for transaction-not-found, we don't have a way of
475+
// differentiating between "can't find" and "doesn't exist".
469476
return nil, nil
470477
}
471478

@@ -509,6 +516,14 @@ func (a *ethAPI) EthGetBlockReceiptsLimited(ctx context.Context, blockParam type
509516
return nil, fmt.Errorf("failed to get tipset: %w", err)
510517
}
511518

519+
head, err := a.chain.ChainHead(ctx)
520+
if err != nil {
521+
return nil, fmt.Errorf("failed to get head: %v", err)
522+
}
523+
if limit > constants.LookbackNoLimit && ts.Height() < head.Height() {
524+
return nil, fmt.Errorf("tipset %s is older than the allowed lookback limit", ts.Key())
525+
}
526+
512527
tsCid, err := ts.Key().Cid()
513528
if err != nil {
514529
return nil, fmt.Errorf("failed to get tipset key cid: %w", err)
@@ -577,7 +592,12 @@ func (a *ethAPI) EthGetCode(ctx context.Context, ethAddr types.EthAddress, blkPa
577592
return nil, errors.New("block param must not specify genesis block")
578593
}
579594

580-
actor, err := a.em.chainModule.Stmgr.GetActorAt(ctx, to, ts)
595+
stateCid, _, err := a.em.chainModule.Stmgr.StateView(ctx, ts)
596+
if err != nil {
597+
return nil, err
598+
}
599+
600+
actor, err := a.em.chainModule.Stmgr.GetActorRaw(ctx, to, stateCid)
581601
if err != nil {
582602
if errors.Is(err, types.ErrActorNotFound) {
583603
return nil, nil
@@ -605,7 +625,7 @@ func (a *ethAPI) EthGetCode(ctx context.Context, ethAddr types.EthAddress, blkPa
605625
// Try calling until we find a height with no migration.
606626
var res *types.InvocResult
607627
for {
608-
res, err = a.em.chainModule.Stmgr.Call(ctx, msg, ts)
628+
res, err = a.em.chainModule.Stmgr.CallOnState(ctx, stateCid, msg, ts)
609629
if err != fork.ErrExpensiveFork {
610630
break
611631
}
@@ -664,13 +684,12 @@ func (a *ethAPI) EthGetStorageAt(ctx context.Context, ethAddr types.EthAddress,
664684
return nil, fmt.Errorf("cannot get Filecoin address: %w", err)
665685
}
666686

667-
// use the system actor as the caller
668-
from, err := address.NewIDAddress(0)
687+
stateCid, _, err := a.em.chainModule.Stmgr.StateView(ctx, ts)
669688
if err != nil {
670-
return nil, fmt.Errorf("failed to construct system sender address: %w", err)
689+
return nil, err
671690
}
672691

673-
actor, err := a.em.chainModule.Stmgr.GetActorAt(ctx, to, ts)
692+
actor, err := a.em.chainModule.Stmgr.GetActorRaw(ctx, to, stateCid)
674693
if err != nil {
675694
if errors.Is(err, types.ErrActorNotFound) {
676695
return types.EthBytes(make([]byte, 32)), nil
@@ -690,7 +709,7 @@ func (a *ethAPI) EthGetStorageAt(ctx context.Context, ethAddr types.EthAddress,
690709
}
691710

692711
msg := &types.Message{
693-
From: from,
712+
From: builtinactors.SystemActorAddr,
694713
To: to,
695714
Value: big.Zero(),
696715
Method: builtin.MethodsEVM.GetStorageAt,
@@ -703,7 +722,7 @@ func (a *ethAPI) EthGetStorageAt(ctx context.Context, ethAddr types.EthAddress,
703722
// Try calling until we find a height with no migration.
704723
var res *types.InvocResult
705724
for {
706-
res, err = a.em.chainModule.Stmgr.Call(ctx, msg, ts)
725+
res, err = a.em.chainModule.Stmgr.CallOnState(ctx, stateCid, msg, ts)
707726
if err != fork.ErrExpensiveFork {
708727
break
709728
}

fixtures/networks/butterfly.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,10 @@ func ButterflySnapNet() *NetworkConf {
6565
UpgradeWaffleHeight: -27,
6666
UpgradeTuktukHeight: -28,
6767
UpgradeTuktukPowerRampDurationEpochs: builtin.EpochsInYear,
68-
UpgradeTeepHeight: 100,
68+
UpgradeTeepHeight: -30,
6969
UpgradeTockFixHeight: -29,
70+
UpgradeTockHeight: -31,
71+
UpgradeXxHeight: 9999999999,
7072
},
7173
DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: config.DrandQuicknet},
7274
AddressNetwork: address.Testnet,
@@ -80,7 +82,5 @@ func ButterflySnapNet() *NetworkConf {
8082
},
8183
}
8284

83-
nc.Network.ForkUpgradeParam.UpgradeTockHeight = nc.Network.ForkUpgradeParam.UpgradeTeepHeight + builtin.EpochsInDay*2
84-
8585
return nc
8686
}

fixtures/networks/calibration.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func Calibration() *NetworkConf {
2020
nc := &NetworkConf{
2121
Bootstrap: config.BootstrapConfig{
2222
Addresses: []string{
23-
"/dns/calibration.node.glif.io/tcp/1237/p2p/12D3KooWQPYouEAsUQKzvFUA9sQ8tz4rfpqtTzh2eL6USd9bwg7x",
23+
"/dns/bootstrap.calibration.filecoin.chain.love/tcp/1237/p2p/12D3KooWQPYouEAsUQKzvFUA9sQ8tz4rfpqtTzh2eL6USd9bwg7x",
2424
"/dns/bootstrap-calibnet-0.chainsafe-fil.io/tcp/34000/p2p/12D3KooWABQ5gTDHPWyvhJM7jPhtNwNJruzTEo32Lo4gcS5ABAMm",
2525
"/dns/bootstrap-calibnet-1.chainsafe-fil.io/tcp/34000/p2p/12D3KooWS3ZRhMYL67b4bD5XQ6fcpTyVQXnDe8H89LvwrDqaSbiT",
2626
"/dns/bootstrap-calibnet-2.chainsafe-fil.io/tcp/34000/p2p/12D3KooWEiBN8jBX8EBoM3M47pVRLRWV812gDRUJhMxgyVkUoR48",
@@ -75,6 +75,7 @@ func Calibration() *NetworkConf {
7575
UpgradeTuktukPowerRampDurationEpochs: builtin.EpochsInDay * 3,
7676
UpgradeTeepHeight: 2523454, // 2025-03-26T23:00:00Z
7777
UpgradeTockFixHeight: 2558014, // 2025-04-07T23:00:00Z
78+
UpgradeXxHeight: 99999999,
7879
},
7980
DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: 1},
8081
AddressNetwork: address.Testnet,

fixtures/networks/forcenet.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func ForceNet() *NetworkConf {
1919
Network: config.NetworkParamsConfig{
2020
DevNet: true,
2121
NetworkType: types.NetworkForce,
22-
GenesisNetworkVersion: network.Version24,
22+
GenesisNetworkVersion: network.Version26,
2323
ReplaceProofTypes: []abi.RegisteredSealProof{
2424
abi.RegisteredSealProof_StackedDrg8MiBV1,
2525
abi.RegisteredSealProof_StackedDrg512MiBV1,
@@ -67,9 +67,10 @@ func ForceNet() *NetworkConf {
6767
UpgradeWaffleHeight: -27,
6868
UpgradeTuktukHeight: -28,
6969
UpgradeTuktukPowerRampDurationEpochs: 200,
70-
UpgradeTeepHeight: 200,
71-
UpgradeTockHeight: 300,
70+
UpgradeTeepHeight: -30,
71+
UpgradeTockHeight: -31,
7272
UpgradeTockFixHeight: -29,
73+
UpgradeXxHeight: 200,
7374
},
7475
DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: config.DrandQuicknet},
7576
AddressNetwork: address.Testnet,

fixtures/networks/integrationtestnet.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ func IntegrationNet() *NetworkConf {
6161
UpgradeTuktukHeight: 4461240,
6262
UpgradeTeepHeight: 4867320,
6363
UpgradeTockFixHeight: -29,
64+
UpgradeXxHeight: 999999999,
6465
},
6566
DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: 5, 51000: 1},
6667
AddressNetwork: address.Testnet,

fixtures/networks/interopnet.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,10 @@ func InteropNet() *NetworkConf {
6666
UpgradeWaffleHeight: -27,
6767
UpgradeTuktukHeight: -28,
6868
UpgradeTuktukPowerRampDurationEpochs: builtin.EpochsInYear,
69-
UpgradeTeepHeight: 50,
70-
UpgradeTockHeight: 100,
69+
UpgradeTeepHeight: -30,
70+
UpgradeTockHeight: -31,
7171
UpgradeTockFixHeight: -29,
72+
UpgradeXxHeight: 50,
7273
},
7374
DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: config.DrandQuicknet},
7475
AddressNetwork: address.Testnet,

fixtures/networks/mainnet.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func Mainnet() *NetworkConf {
1717
nc := &NetworkConf{
1818
Bootstrap: config.BootstrapConfig{
1919
Addresses: []string{
20-
"/dns/node.glif.io/tcp/1235/p2p/12D3KooWBF8cpp65hp2u9LK5mh19x67ftAam84z9LsfaquTDSBpt",
20+
"/dns/bootstrap.filecoin.chain.love/tcp/1235/p2p/12D3KooWBF8cpp65hp2u9LK5mh19x67ftAam84z9LsfaquTDSBpt",
2121
"/dns/bootstrap-venus.mainnet.filincubator.com/tcp/8888/p2p/QmQu8C6deXwKvJP2D8B6QGyhngc3ZiDnFzEHBDx8yeBXST",
2222
"/dns/bootstrap-mainnet-0.chainsafe-fil.io/tcp/34000/p2p/12D3KooWKKkCZbcigsWTEu1cgNetNbZJqeNtysRtFpq7DTqw3eqH",
2323
"/dns/bootstrap-mainnet-1.chainsafe-fil.io/tcp/34000/p2p/12D3KooWGnkd9GQKo3apkShQDaq1d6cKJJmsVe6KiQkacUk1T8oZ",
@@ -78,6 +78,7 @@ func Mainnet() *NetworkConf {
7878
UpgradeTuktukPowerRampDurationEpochs: builtin2.EpochsInYear,
7979
UpgradeTeepHeight: 4878840, // 2025-04-14T23:00:00Z
8080
UpgradeTockFixHeight: -1,
81+
UpgradeXxHeight: 9999999999,
8182
},
8283
DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: 5, 51000: 1},
8384
AddressNetwork: address.Mainnet,

fixtures/networks/net_2k.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func Net2k() *NetworkConf {
1818
Network: config.NetworkParamsConfig{
1919
DevNet: true,
2020
NetworkType: types.Network2k,
21-
GenesisNetworkVersion: network.Version24,
21+
GenesisNetworkVersion: network.Version26,
2222
ReplaceProofTypes: []abi.RegisteredSealProof{
2323
abi.RegisteredSealProof_StackedDrg2KiBV1,
2424
abi.RegisteredSealProof_StackedDrg8MiBV1,
@@ -61,9 +61,10 @@ func Net2k() *NetworkConf {
6161
UpgradeWaffleHeight: -27,
6262
UpgradeTuktukPowerRampDurationEpochs: 200,
6363
UpgradeTuktukHeight: -28,
64-
UpgradeTeepHeight: 200,
65-
UpgradeTockHeight: 300,
64+
UpgradeTeepHeight: -30,
65+
UpgradeTockHeight: -31,
6666
UpgradeTockFixHeight: -29,
67+
UpgradeXxHeight: 200,
6768
},
6869
DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: config.DrandQuicknet},
6970
AddressNetwork: address.Testnet,

fixtures/networks/network_parse.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func SetConfigFromNetworkType(cfg *config.Config, networkType types.NetworkType)
5050

5151
if constants.DisableF3 {
5252
cfg.NetworkParams.F3Enabled = false
53-
log.Warnf("F3 is disabled")
53+
log.Warn("F3 is disabled")
5454
}
5555
return nil
5656
}

0 commit comments

Comments
 (0)