-
Notifications
You must be signed in to change notification settings - Fork 649
/
config.go
44 lines (31 loc) · 1013 Bytes
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package proposervm
import (
"crypto"
"time"
"github.com/prometheus/client_golang/prometheus"
"github.com/ava-labs/avalanchego/staking"
)
type Config struct {
// Time at which proposerVM activates its congestion control mechanism
ActivationTime time.Time
// Durango fork activation time
DurangoTime time.Time
// Minimal P-chain height referenced upon block building
MinimumPChainHeight uint64
// Configurable minimal delay among blocks issued consecutively
MinBlkDelay time.Duration
// Maximal number of block indexed.
// Zero signals all blocks are indexed.
NumHistoricalBlocks uint64
// Block signer
StakingLeafSigner crypto.Signer
// Block certificate
StakingCertLeaf *staking.Certificate
// Registerer for prometheus metrics
Registerer prometheus.Registerer
}
func (c *Config) IsDurangoActivated(timestamp time.Time) bool {
return !timestamp.Before(c.DurangoTime)
}