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