Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: backport changes for v1.30.0-rc2 #12598

Merged
merged 19 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
fbdd0ba
test(fvm): validate MCOPY opcode for FIP-0094 (#12556)
BigLep Oct 14, 2024
f523e2d
fix(events): event index unique for tipset during backfill
rvagg Oct 9, 2024
ece8b1b
fix(migrations): update actor code IDs to Version15 for NV24 invarian…
rjan90 Oct 10, 2024
2d64dd6
chore: set calibration epoch and F3-activation (#12573)
rjan90 Oct 10, 2024
115672a
Set address current network for non-mainnet since default is changed …
masih Oct 10, 2024
2581b7c
fix(f3): fix hot loop in F3 participation (#12575)
Kubuxu Oct 10, 2024
b90fc7e
fix(f3): improve log messages (#12576)
Stebalien Oct 10, 2024
c531108
fix(f3): send the last gpbft message for each new participant (#12577)
Stebalien Oct 11, 2024
c723b64
fix(f3): log the correct number of instances remaining (#12578)
Stebalien Oct 10, 2024
a88993c
feat(f3): log when gaining/losing participation leases (#12581)
Stebalien Oct 11, 2024
4158424
Fix address network override via env var (#12590)
masih Oct 11, 2024
5e4a529
fix(events): address API reverted semantics
aarshkshah1992 Oct 11, 2024
e013e32
fix(events): handle subscribe and get/fill cases separately
rvagg Oct 11, 2024
c0a8b93
fix bug in exclude reverted logic (#12588)
aarshkshah1992 Oct 11, 2024
1571d97
fix(f3): handle a case where we might receive no manifest (#12579)
Stebalien Oct 11, 2024
873000b
feat(f3): remove lease-check interval constants
Stebalien Oct 10, 2024
4e76c78
feat(f3): refactor the F3 participation module to improve testing (#1…
Stebalien Oct 11, 2024
8ce8016
fix(f3): don't return an error on stop if our context was canceled (#…
Stebalien Oct 12, 2024
1e1255b
fix(miner): fix new bug in StateMinerPreCommitDepositForPower calcula…
rvagg Oct 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions api/api_full.go
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,10 @@ type F3ParticipationLease struct {
ValidityTerm uint64
}

func (l *F3ParticipationLease) ToInstance() uint64 {
return l.FromInstance + l.ValidityTerm
}

// EthSubscriber is the reverse interface to the client, called after EthSubscribe
type EthSubscriber interface {
// note: the parameter is ethtypes.EthSubscriptionResponse serialized as json object
Expand Down
2 changes: 2 additions & 0 deletions build/buildconstants/params_2k.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

"github.com/ipfs/go-cid"

"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/network"
)
Expand Down Expand Up @@ -98,6 +99,7 @@ var ConsensusMinerMinPower = abi.NewStoragePower(2048)
var PreCommitChallengeDelay = abi.ChainEpoch(10)

func init() {
SetAddressNetwork(address.Testnet)
getGenesisNetworkVersion := func(ev string, def network.Version) network.Version {
hs, found := os.LookupEnv(ev)
if found {
Expand Down
16 changes: 16 additions & 0 deletions build/buildconstants/params_2k_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//go:build debug || 2k
// +build debug 2k

package buildconstants

import (
"testing"

"github.com/stretchr/testify/require"

"github.com/filecoin-project/go-address"
)

func Test_NetworkName(t *testing.T) {
require.Equal(t, address.CurrentNetwork, address.Testnet)
}
16 changes: 16 additions & 0 deletions build/buildconstants/params_butterfly_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//go:build butterflynet
// +build butterflynet

package buildconstants

import (
"testing"

"github.com/stretchr/testify/require"

"github.com/filecoin-project/go-address"
)

func Test_NetworkName(t *testing.T) {
require.Equal(t, address.CurrentNetwork, address.Testnet)
}
7 changes: 4 additions & 3 deletions build/buildconstants/params_calibnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ const UpgradeCalibrationDragonFixHeight = 1493854
// 2024-07-11T12:00:00Z
const UpgradeWaffleHeight = 1779094

// ??????
const UpgradeTuktukHeight = 999999999999999
// 2024-10-23T13:30:00Z
const UpgradeTuktukHeight = 2078794

// FIP-0081: for the power actor state for pledge calculations.
// UpgradeTuktukPowerRampDurationEpochs ends up in the power actor state after
Expand Down Expand Up @@ -162,7 +162,8 @@ var F3ManifestServerID = MustParseID("12D3KooWS9vD9uwm8u2uPyJV32QBAhKAmPYwmziAgr
// The initial F3 power table CID.
var F3InitialPowerTableCID cid.Cid = cid.Undef

const F3BootstrapEpoch abi.ChainEpoch = UpgradeWaffleHeight + 100
// Calibnet F3 activation epoch is 2024-10-24T13:30:00Z - Epoch 2081674
const F3BootstrapEpoch abi.ChainEpoch = UpgradeTuktukHeight + 2880

// F3Consensus set whether F3 should checkpoint tipsets finalized by F3. This
// flag has no effect if F3 is not enabled.
Expand Down
16 changes: 16 additions & 0 deletions build/buildconstants/params_calibnet_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//go:build calibnet
// +build calibnet

package buildconstants

import (
"testing"

"github.com/stretchr/testify/require"

"github.com/filecoin-project/go-address"
)

func Test_NetworkName(t *testing.T) {
require.Equal(t, address.CurrentNetwork, address.Testnet)
}
16 changes: 16 additions & 0 deletions build/buildconstants/params_interop_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//go:build interopnet
// +build interopnet

package buildconstants

import (
"testing"

"github.com/stretchr/testify/require"

"github.com/filecoin-project/go-address"
)

func Test_NetworkName(t *testing.T) {
require.Equal(t, address.CurrentNetwork, address.Testnet)
}
6 changes: 5 additions & 1 deletion build/buildconstants/params_mainnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,13 @@ var PropagationDelaySecs = uint64(10)
var EquivocationDelaySecs = uint64(2)

func init() {
var addrNetwork address.Network
if os.Getenv("LOTUS_USE_TEST_ADDRESSES") != "1" {
SetAddressNetwork(address.Mainnet)
addrNetwork = address.Mainnet
} else {
addrNetwork = address.Testnet
}
SetAddressNetwork(addrNetwork)

if os.Getenv("LOTUS_DISABLE_TUKTUK") == "1" {
UpgradeTuktukHeight = math.MaxInt64 - 1
Expand Down
16 changes: 16 additions & 0 deletions build/buildconstants/params_mainnet_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//go:build !debug && !2k && !testground && !calibnet && !butterflynet && !interopnet
// +build !debug,!2k,!testground,!calibnet,!butterflynet,!interopnet

package buildconstants

import (
"testing"

"github.com/stretchr/testify/require"

"github.com/filecoin-project/go-address"
)

func Test_NetworkName(t *testing.T) {
require.Equal(t, address.CurrentNetwork, address.Mainnet)
}
2 changes: 2 additions & 0 deletions build/buildconstants/params_testground.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/ipfs/go-cid"
"github.com/libp2p/go-libp2p/core/peer"

"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/network"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
Expand Down Expand Up @@ -137,6 +138,7 @@ var (
)

func init() {
SetAddressNetwork(address.Testnet)
Devnet = true
}

Expand Down
16 changes: 16 additions & 0 deletions build/buildconstants/params_testground_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//go:build testground
// +build testground

package buildconstants

import (
"testing"

"github.com/stretchr/testify/require"

"github.com/filecoin-project/go-address"
)

func Test_NetworkName(t *testing.T) {
require.Equal(t, address.CurrentNetwork, address.Testnet)
}
29 changes: 26 additions & 3 deletions chain/events/filter/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,14 @@ func (m *EventFilterManager) Revert(ctx context.Context, from, to *types.TipSet)
return nil
}

func (m *EventFilterManager) Install(ctx context.Context, minHeight, maxHeight abi.ChainEpoch, tipsetCid cid.Cid, addresses []address.Address,
keysWithCodec map[string][]types.ActorEventBlock, excludeReverted bool) (EventFilter, error) {
func (m *EventFilterManager) Fill(
ctx context.Context,
minHeight,
maxHeight abi.ChainEpoch,
tipsetCid cid.Cid,
addresses []address.Address,
keysWithCodec map[string][]types.ActorEventBlock,
) (EventFilter, error) {
m.mu.Lock()
if m.currentHeight == 0 {
// sync in progress, we haven't had an Apply
Expand Down Expand Up @@ -407,16 +413,33 @@ func (m *EventFilterManager) Install(ctx context.Context, minHeight, maxHeight a

if m.EventIndex != nil && minHeight != -1 && minHeight < currentHeight {
// Filter needs historic events
excludeReverted := tipsetCid == cid.Undef
if err := m.EventIndex.prefillFilter(ctx, f, excludeReverted); err != nil {
return nil, err
}
}

return f, nil
}

func (m *EventFilterManager) Install(
ctx context.Context,
minHeight,
maxHeight abi.ChainEpoch,
tipsetCid cid.Cid,
addresses []address.Address,
keysWithCodec map[string][]types.ActorEventBlock,
) (EventFilter, error) {
f, err := m.Fill(ctx, minHeight, maxHeight, tipsetCid, addresses, keysWithCodec)
if err != nil {
return nil, err
}

m.mu.Lock()
if m.filters == nil {
m.filters = make(map[types.FilterID]EventFilter)
}
m.filters[id] = f
m.filters[f.(*eventFilter).id] = f
m.mu.Unlock()

return f, nil
Expand Down
26 changes: 17 additions & 9 deletions chain/lf3/f3.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,20 +141,28 @@ func (fff *F3) runSigningLoop(ctx context.Context) {

msgCh := fff.inner.MessagesToSign()

loop:
var mb *gpbft.MessageBuilder
alreadyParticipated := make(map[uint64]struct{})
for ctx.Err() == nil {
select {
case <-ctx.Done():
return
case mb, ok := <-msgCh:
if !ok {
continue loop
case <-fff.leaser.notifyParticipation:
if mb == nil {
continue
}
participants := fff.leaser.getParticipantsByInstance(mb.Payload.Instance)
for _, id := range participants {
if err := participateOnce(ctx, mb, id); err != nil {
log.Errorf("while participating for miner f0%d: %+v", id, err)
}
case mb = <-msgCh: // never closed
clear(alreadyParticipated)
}

participants := fff.leaser.getParticipantsByInstance(mb.Payload.Instance)
for _, id := range participants {
if _, ok := alreadyParticipated[id]; ok {
continue
} else if err := participateOnce(ctx, mb, id); err != nil {
log.Errorf("while participating for miner f0%d: %+v", id, err)
} else {
alreadyParticipated[id] = struct{}{}
}
}
}
Expand Down
Loading
Loading