Skip to content

Commit 1b79bbf

Browse files
authored
Merge pull request #6436 from filecoin-project/feat/nv25
Feat/nv25
2 parents 27912af + 32a4727 commit 1b79bbf

File tree

97 files changed

+3790
-226
lines changed

Some content is hidden

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

97 files changed

+3790
-226
lines changed

app/submodule/chain/chain_submodule.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"github.com/filecoin-project/venus/pkg/vmsupport"
2222
v0api "github.com/filecoin-project/venus/venus-shared/api/chain/v0"
2323
v1api "github.com/filecoin-project/venus/venus-shared/api/chain/v1"
24-
"github.com/filecoin-project/venus/venus-shared/types"
2524
)
2625

2726
// ChainSubmodule enhances the `Node` with chain capabilities.
@@ -33,8 +32,7 @@ type ChainSubmodule struct { //nolint
3332
SystemCall vm.SyscallsImpl
3433
CirculatingSupplyCalculator *chain.CirculatingSupplyCalculator
3534

36-
CheckPoint types.TipSetKey
37-
Drand beacon.Schedule
35+
Drand beacon.Schedule
3836

3937
config chainConfig
4038

@@ -92,7 +90,6 @@ func NewChainSubmodule(ctx context.Context,
9290
Drand: drand,
9391
config: config,
9492
Waiter: waiter,
95-
CheckPoint: chainStore.GetCheckPoint(),
9693
}
9794
err = store.ChainReader.Load(context.TODO())
9895
if err != nil {

app/submodule/chain/chaininfo_api.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,7 @@ func (cia *chainInfoAPI) StateGetNetworkParams(ctx context.Context) (*types.Netw
761761
UpgradePhoenixHeight: cfg.NetworkParams.ForkUpgradeParam.UpgradePhoenixHeight,
762762
UpgradeWaffleHeight: cfg.NetworkParams.ForkUpgradeParam.UpgradeWaffleHeight,
763763
UpgradeTuktukHeight: cfg.NetworkParams.ForkUpgradeParam.UpgradeTuktukHeight,
764+
UpgradeTeepHeight: cfg.NetworkParams.ForkUpgradeParam.UpgradeTeepHeight,
764765
},
765766
Eip155ChainID: cfg.NetworkParams.Eip155ChainID,
766767
}
@@ -942,3 +943,22 @@ func (cia *chainInfoAPI) StateCompute(ctx context.Context, height abi.ChainEpoch
942943
Trace: t,
943944
}, nil
944945
}
946+
947+
func (cia *chainInfoAPI) StateMarketProposalPending(ctx context.Context, proposalCid cid.Cid, tsk types.TipSetKey) (bool, error) {
948+
ts, err := cia.ChainGetTipSet(ctx, tsk)
949+
if err != nil {
950+
return false, fmt.Errorf("loading tipset %s: %w", tsk, err)
951+
}
952+
953+
st, err := cia.chain.Stmgr.GetMarketState(ctx, ts)
954+
if err != nil {
955+
return false, err
956+
}
957+
958+
props, err := st.PendingProposals()
959+
if err != nil {
960+
return false, err
961+
}
962+
963+
return props.Has(proposalCid)
964+
}

app/submodule/chain/miner_api.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -730,12 +730,12 @@ func (msa *minerStateAPI) calculateSectorWeight(ctx context.Context, maddr addre
730730
return types.EmptyInt, fmt.Errorf("market actor not found")
731731
} else if s, err := market.Load(store, act); err != nil {
732732
return types.EmptyInt, fmt.Errorf("loading market actor state: %w", err)
733-
} else if w, vw, err := s.VerifyDealsForActivation(maddr, pci.DealIDs, height, pci.Expiration); err != nil {
733+
} else if vw, err := s.VerifyDealsForActivation(maddr, pci.DealIDs, height, pci.Expiration); err != nil {
734734
return types.EmptyInt, fmt.Errorf("verifying deals for activation: %w", err)
735735
} else {
736736
// NB: not exactly accurate, but should always lead us to *over* estimate, not under
737737
duration := pci.Expiration - height
738-
sectorWeight = builtin.QAPowerForWeight(ssize, duration, w, vw)
738+
sectorWeight = builtin.QAPowerForWeight(ssize, duration, vw)
739739
}
740740

741741
return sectorWeight, nil
@@ -937,7 +937,7 @@ func (msa *minerStateAPI) StateMinerInitialPledgeForSector(ctx context.Context,
937937
}
938938

939939
verifiedWeight := big.Mul(big.NewIntUnsigned(verifiedSize), big.NewInt(int64(sectorDuration)))
940-
sectorWeight := builtin.QAPowerForWeight(sectorSize, sectorDuration, big.Zero(), verifiedWeight)
940+
sectorWeight := builtin.QAPowerForWeight(sectorSize, sectorDuration, verifiedWeight)
941941

942942
epochsSinceRampStart, rampDurationEpochs, err := msa.getPledgeRampParams(ctx, ts.Height(), state)
943943
if err != nil {

app/submodule/eth/eth_api.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,6 +1436,9 @@ func (a *ethAPI) EthTraceFilter(ctx context.Context, filter types.EthTraceFilter
14361436
for blkNum := fromBlock; blkNum <= toBlock; blkNum++ {
14371437
blockTraces, err := a.EthTraceBlock(ctx, strconv.FormatUint(uint64(blkNum), 10))
14381438
if err != nil {
1439+
if errors.Is(err, &types.ErrNullRound{}) {
1440+
continue
1441+
}
14391442
return nil, fmt.Errorf("cannot get trace for block %d: %w", blkNum, err)
14401443
}
14411444

app/submodule/eth/eth_trace.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -444,11 +444,14 @@ func decodeCreateViaEAM(et *types.ExecutionTrace) (initcode []byte, addr *types.
444444
default:
445445
return nil, nil, fmt.Errorf("unexpected CREATE method %d", et.Msg.Method)
446446
}
447-
ret, err := decodeReturn[eam12.CreateReturn](&et.MsgRct)
448-
if err != nil {
449-
return nil, nil, err
447+
if et.MsgRct.ExitCode.IsSuccess() {
448+
ret, err := decodeReturn[eam12.CreateReturn](&et.MsgRct)
449+
if err != nil {
450+
return nil, nil, fmt.Errorf("failed to decode EAM create return: %w", err)
451+
}
452+
addr = (*types.EthAddress)(&ret.EthAddress)
450453
}
451-
return initcode, (*types.EthAddress)(&ret.EthAddress), nil
454+
return initcode, addr, nil
452455
}
453456

454457
// Build an EthTrace for an EVM "create" operation. This should only be called with an

fixtures/networks/butterfly.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func ButterflySnapNet() *NetworkConf {
2121
Network: config.NetworkParamsConfig{
2222
DevNet: true,
2323
NetworkType: types.NetworkButterfly,
24-
GenesisNetworkVersion: network.Version22,
24+
GenesisNetworkVersion: network.Version24,
2525
ReplaceProofTypes: []abi.RegisteredSealProof{
2626
abi.RegisteredSealProof_StackedDrg512MiBV1,
2727
abi.RegisteredSealProof_StackedDrg32GiBV1,
@@ -63,8 +63,9 @@ func ButterflySnapNet() *NetworkConf {
6363
UpgradeCalibrationDragonFixHeight: -102, // This fix upgrade only ran on calibrationnet
6464
UpgradePhoenixHeight: -26,
6565
UpgradeWaffleHeight: -27,
66-
UpgradeTuktukHeight: 9999999,
66+
UpgradeTuktukHeight: -28,
6767
UpgradeTuktukPowerRampDurationEpochs: builtin.EpochsInYear,
68+
UpgradeTeepHeight: 100,
6869
},
6970
DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: config.DrandQuicknet},
7071
AddressNetwork: address.Testnet,

fixtures/networks/calibration.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ func Calibration() *NetworkConf {
7373
UpgradeWaffleHeight: 1779094, // 2024-07-11T12:00:00Z
7474
UpgradeTuktukHeight: 2078794, // 2024-10-23T13:30:00Z
7575
UpgradeTuktukPowerRampDurationEpochs: builtin.EpochsInDay * 3,
76+
UpgradeTeepHeight: 2235454, // 2024-12-16T23:00:00Z
7677
},
7778
DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: 1},
7879
AddressNetwork: address.Testnet,

fixtures/networks/forcenet.go

Lines changed: 3 additions & 2 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.Version23,
22+
GenesisNetworkVersion: network.Version24,
2323
ReplaceProofTypes: []abi.RegisteredSealProof{
2424
abi.RegisteredSealProof_StackedDrg8MiBV1,
2525
abi.RegisteredSealProof_StackedDrg512MiBV1,
@@ -65,8 +65,9 @@ func ForceNet() *NetworkConf {
6565
UpgradeCalibrationDragonFixHeight: -102, // This fix upgrade only ran on calibrationnet
6666
UpgradePhoenixHeight: -26,
6767
UpgradeWaffleHeight: -27,
68-
UpgradeTuktukHeight: 200,
68+
UpgradeTuktukHeight: -28,
6969
UpgradeTuktukPowerRampDurationEpochs: 200,
70+
UpgradeTeepHeight: 200,
7071
},
7172
DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: config.DrandQuicknet},
7273
AddressNetwork: address.Testnet,

fixtures/networks/integrationtestnet.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ func IntegrationNet() *NetworkConf {
5858
UpgradeCalibrationDragonFixHeight: -102, // This fix upgrade only ran on calibrationnet
5959
UpgradeWaffleHeight: 4154640,
6060
UpgradeTuktukHeight: 4461240,
61+
UpgradeTeepHeight: 99999999,
6162
},
6263
DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: 5, 51000: 1},
6364
AddressNetwork: address.Testnet,

0 commit comments

Comments
 (0)