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

chore: disable f3 in integration test #6403

Merged
merged 1 commit into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
chore: disable f3 in integration test
  • Loading branch information
simlecode committed Oct 11, 2024
commit 04dd9052c15180d2583757996b334d1308d03254
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
Loading