Skip to content

Commit

Permalink
Merge pull request #6403 from filecoin-project/fix/test
Browse files Browse the repository at this point in the history
chore: disable f3 in integration test
  • Loading branch information
simlecode authored Oct 11, 2024
2 parents edc71c7 + 04dd905 commit fc99bfd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion fixtures/networks/integrationtestnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func IntegrationNet() *NetworkConf {
AllowableClockDriftSecs: 1,
Eip155ChainID: 314,
ActorDebugging: false,
F3Enabled: true,
F3Enabled: false,
F3BootstrapEpoch: -1,
ManifestServerID: "12D3KooWHcNBkqXEBrsjoveQvj6zDF3vK5S9tAfqyYaQF1LGSJwG",
F3Consensus: true,
Expand Down
4 changes: 2 additions & 2 deletions pkg/vf3/participation_lease.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func (l *leaser) getParticipantsByInstance(instance uint64) []uint64 {
defer l.mutex.Unlock()
var participants []uint64
for id, lease := range l.leases {
if instance > lease.FromInstance+lease.ValidityTerm {
if instance > lease.ToInstance() {
// Lazily delete the expired leases.
delete(l.leases, id)
} else {
Expand Down Expand Up @@ -144,7 +144,7 @@ func (l *leaser) validate(currentNetwork gpbft.NetworkName, currentInstance uint
// Combine the errors to remove significance of the order by which they are
// checked outside if this function.
var err error
if currentNetwork != lease.Network || currentInstance > lease.FromInstance+lease.ValidityTerm {
if currentNetwork != lease.Network || currentInstance > lease.ToInstance() {
err = multierr.Append(err, types.ErrF3ParticipationTicketExpired)
}
if l.issuer != lease.Issuer {
Expand Down
4 changes: 4 additions & 0 deletions venus-shared/types/api_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,10 @@ type F3ParticipationLease struct {
ValidityTerm uint64
}

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

var (
// ErrF3Disabled signals that F3 consensus process is disabled.
ErrF3Disabled = errF3Disabled{}
Expand Down

0 comments on commit fc99bfd

Please sign in to comment.