From 040bcd84ecb234f601dc935eb90ecd7ead68ef50 Mon Sep 17 00:00:00 2001 From: Dhruba Basu <7675102+dhrubabasu@users.noreply.github.com> Date: Thu, 28 Dec 2023 16:10:14 -0500 Subject: [PATCH 01/57] Do not mark txs as dropped when mempool is full (#2557) --- vms/avm/txs/mempool/mempool.go | 4 ++++ vms/avm/txs/mempool/mempool_test.go | 15 +++++++++++++++ vms/platformvm/txs/mempool/mempool.go | 4 ++++ vms/platformvm/txs/mempool/mempool_test.go | 5 +++++ 4 files changed, 28 insertions(+) diff --git a/vms/avm/txs/mempool/mempool.go b/vms/avm/txs/mempool/mempool.go index b4b05a72d2a3..f7d9bc37262d 100644 --- a/vms/avm/txs/mempool/mempool.go +++ b/vms/avm/txs/mempool/mempool.go @@ -208,6 +208,10 @@ func (m *mempool) RequestBuildBlock() { } func (m *mempool) MarkDropped(txID ids.ID, reason error) { + if errors.Is(reason, ErrMempoolFull) { + return + } + m.lock.RLock() defer m.lock.RUnlock() diff --git a/vms/avm/txs/mempool/mempool_test.go b/vms/avm/txs/mempool/mempool_test.go index ae1a75dbba17..5691662cbaa0 100644 --- a/vms/avm/txs/mempool/mempool_test.go +++ b/vms/avm/txs/mempool/mempool_test.go @@ -26,36 +26,42 @@ func TestAdd(t *testing.T) { initialTxs []*txs.Tx tx *txs.Tx err error + dropReason error }{ { name: "successfully add tx", initialTxs: nil, tx: tx0, err: nil, + dropReason: nil, }, { name: "attempt adding duplicate tx", initialTxs: []*txs.Tx{tx0}, tx: tx0, err: ErrDuplicateTx, + dropReason: nil, }, { name: "attempt adding too large tx", initialTxs: nil, tx: newTx(0, MaxTxSize+1), err: ErrTxTooLarge, + dropReason: ErrTxTooLarge, }, { name: "attempt adding tx when full", initialTxs: newTxs(maxMempoolSize/MaxTxSize, MaxTxSize), tx: newTx(maxMempoolSize/MaxTxSize, MaxTxSize), err: ErrMempoolFull, + dropReason: nil, }, { name: "attempt adding conflicting tx", initialTxs: []*txs.Tx{tx0}, tx: newTx(0, 32), err: ErrConflictsWithOtherTx, + dropReason: ErrConflictsWithOtherTx, }, } for _, test := range tests { @@ -75,6 +81,15 @@ func TestAdd(t *testing.T) { err = mempool.Add(test.tx) require.ErrorIs(err, test.err) + + txID := test.tx.ID() + + if err != nil { + mempool.MarkDropped(txID, err) + } + + err = mempool.GetDropReason(txID) + require.ErrorIs(err, test.dropReason) }) } } diff --git a/vms/platformvm/txs/mempool/mempool.go b/vms/platformvm/txs/mempool/mempool.go index 37355b017d3f..148a804f9df6 100644 --- a/vms/platformvm/txs/mempool/mempool.go +++ b/vms/platformvm/txs/mempool/mempool.go @@ -212,6 +212,10 @@ func (m *mempool) Iterate(f func(tx *txs.Tx) bool) { } func (m *mempool) MarkDropped(txID ids.ID, reason error) { + if errors.Is(reason, ErrMempoolFull) { + return + } + m.lock.RLock() defer m.lock.RUnlock() diff --git a/vms/platformvm/txs/mempool/mempool_test.go b/vms/platformvm/txs/mempool/mempool_test.go index ffbb00359fc5..31420e94ecbb 100644 --- a/vms/platformvm/txs/mempool/mempool_test.go +++ b/vms/platformvm/txs/mempool/mempool_test.go @@ -40,6 +40,11 @@ func TestBlockBuilderMaxMempoolSizeHandling(t *testing.T) { err = mpool.Add(tx) require.ErrorIs(err, ErrMempoolFull) + // tx should not be marked as dropped if the mempool is full + txID := tx.ID() + mpool.MarkDropped(txID, err) + require.NoError(mpool.GetDropReason(txID)) + // shortcut to simulated almost filled mempool mpool.(*mempool).bytesAvailable = len(tx.Bytes()) From 7ca56e86742104b5d182eaa14de75ef000d5727d Mon Sep 17 00:00:00 2001 From: Stephen Buttolph Date: Thu, 28 Dec 2023 20:16:02 -0500 Subject: [PATCH 02/57] Update bug bounty program to immunefi (#2558) --- SECURITY.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index 26e938c8df29..9a04ba2528f5 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -4,13 +4,13 @@ Avalanche takes the security of the platform and of its users very seriously. We ## Reporting a Vulnerability -**Please do not file a public ticket** mentioning the vulnerability. To disclose a vulnerability submit it through our [Bug Bounty Program](https://hackenproof.com/avalanche). +**Please do not file a public ticket** mentioning the vulnerability. To disclose a vulnerability submit it through our [Bug Bounty Program](https://immunefi.com/bounty/avalanche/). Vulnerabilities must be disclosed to us privately with reasonable time to respond, and avoid compromise of other users and accounts, or loss of funds that are not your own. We do not reward spam or social engineering vulnerabilities. Do not test for or validate any security issues in the live Avalanche networks (Mainnet and Fuji testnet), confirm all exploits in a local private testnet. -Please refer to the [Bug Bounty Page](https://hackenproof.com/avalanche) for the most up-to-date program rules and scope. +Please refer to the [Bug Bounty Page](https://immunefi.com/bounty/avalanche/) for the most up-to-date program rules and scope. ## Supported Versions From 4bcf7eecabcd3e7382369fb43e60f65c483c9283 Mon Sep 17 00:00:00 2001 From: Stephen Buttolph Date: Fri, 29 Dec 2023 02:19:51 -0500 Subject: [PATCH 03/57] Fix p2p sdk metric labels (#2561) --- network/p2p/gossip/gossip.go | 25 +++++++++++-------------- network/p2p/gossip/handler.go | 16 ++++------------ 2 files changed, 15 insertions(+), 26 deletions(-) diff --git a/network/p2p/gossip/gossip.go b/network/p2p/gossip/gossip.go index c35d169c4259..17795759e063 100644 --- a/network/p2p/gossip/gossip.go +++ b/network/p2p/gossip/gossip.go @@ -40,6 +40,12 @@ var ( _ Accumulator[*testTx] = (*TestAccumulator[*testTx])(nil) metricLabels = []string{typeLabel} + pushLabels = prometheus.Labels{ + typeLabel: pushType, + } + pullLabels = prometheus.Labels{ + typeLabel: pullType, + } ) // Gossiper gossips Gossipables to other nodes @@ -131,9 +137,6 @@ func NewPullGossiper[T Gossipable]( client: client, metrics: metrics, pollSize: pollSize, - labels: prometheus.Labels{ - typeLabel: pullType, - }, } } @@ -144,7 +147,6 @@ type PullGossiper[T Gossipable] struct { client *p2p.Client metrics Metrics pollSize int - labels prometheus.Labels } func (p *PullGossiper[_]) Gossip(ctx context.Context) error { @@ -223,13 +225,13 @@ func (p *PullGossiper[_]) handleResponse( } } - receivedCountMetric, err := p.metrics.receivedCount.GetMetricWith(p.labels) + receivedCountMetric, err := p.metrics.receivedCount.GetMetricWith(pullLabels) if err != nil { p.log.Error("failed to get received count metric", zap.Error(err)) return } - receivedBytesMetric, err := p.metrics.receivedBytes.GetMetricWith(p.labels) + receivedBytesMetric, err := p.metrics.receivedBytes.GetMetricWith(pullLabels) if err != nil { p.log.Error("failed to get received bytes metric", zap.Error(err)) return @@ -246,10 +248,7 @@ func NewPushGossiper[T Gossipable](marshaller Marshaller[T], client *p2p.Client, client: client, metrics: metrics, targetGossipSize: targetGossipSize, - labels: prometheus.Labels{ - typeLabel: pushType, - }, - pending: buffer.NewUnboundedDeque[T](0), + pending: buffer.NewUnboundedDeque[T](0), } } @@ -260,8 +259,6 @@ type PushGossiper[T Gossipable] struct { metrics Metrics targetGossipSize int - labels prometheus.Labels - lock sync.Mutex pending buffer.Deque[T] } @@ -303,12 +300,12 @@ func (p *PushGossiper[T]) Gossip(ctx context.Context) error { return err } - sentCountMetric, err := p.metrics.sentCount.GetMetricWith(p.labels) + sentCountMetric, err := p.metrics.sentCount.GetMetricWith(pushLabels) if err != nil { return fmt.Errorf("failed to get sent count metric: %w", err) } - sentBytesMetric, err := p.metrics.sentBytes.GetMetricWith(p.labels) + sentBytesMetric, err := p.metrics.sentBytes.GetMetricWith(pushLabels) if err != nil { return fmt.Errorf("failed to get sent bytes metric: %w", err) } diff --git a/network/p2p/gossip/handler.go b/network/p2p/gossip/handler.go index 0cea0c98ab71..85d2d1413544 100644 --- a/network/p2p/gossip/handler.go +++ b/network/p2p/gossip/handler.go @@ -10,8 +10,6 @@ import ( bloomfilter "github.com/holiman/bloomfilter/v2" - "github.com/prometheus/client_golang/prometheus" - "go.uber.org/zap" "google.golang.org/protobuf/proto" @@ -40,9 +38,6 @@ func NewHandler[T Gossipable]( set: set, metrics: metrics, targetResponseSize: targetResponseSize, - pullLabels: prometheus.Labels{ - typeLabel: pullType, - }, } } @@ -54,9 +49,6 @@ type Handler[T Gossipable] struct { set Set[T] metrics Metrics targetResponseSize int - - pullLabels prometheus.Labels - pushLabels prometheus.Labels } func (h Handler[T]) AppRequest(_ context.Context, _ ids.NodeID, _ time.Time, requestBytes []byte) ([]byte, error) { @@ -108,12 +100,12 @@ func (h Handler[T]) AppRequest(_ context.Context, _ ids.NodeID, _ time.Time, req Gossip: gossipBytes, } - sentCountMetric, err := h.metrics.sentCount.GetMetricWith(h.pullLabels) + sentCountMetric, err := h.metrics.sentCount.GetMetricWith(pullLabels) if err != nil { return nil, fmt.Errorf("failed to get sent count metric: %w", err) } - sentBytesMetric, err := h.metrics.sentBytes.GetMetricWith(h.pullLabels) + sentBytesMetric, err := h.metrics.sentBytes.GetMetricWith(pullLabels) if err != nil { return nil, fmt.Errorf("failed to get sent bytes metric: %w", err) } @@ -162,13 +154,13 @@ func (h Handler[_]) AppGossip(ctx context.Context, nodeID ids.NodeID, gossipByte return } - receivedCountMetric, err := h.metrics.receivedCount.GetMetricWith(h.pushLabels) + receivedCountMetric, err := h.metrics.receivedCount.GetMetricWith(pushLabels) if err != nil { h.log.Error("failed to get received count metric", zap.Error(err)) return } - receivedBytesMetric, err := h.metrics.receivedBytes.GetMetricWith(h.pushLabels) + receivedBytesMetric, err := h.metrics.receivedBytes.GetMetricWith(pushLabels) if err != nil { h.log.Error("failed to get received bytes metric", zap.Error(err)) return From bbcc5f09b25611b59b244fabca739249ab089450 Mon Sep 17 00:00:00 2001 From: Stephen Buttolph Date: Fri, 29 Dec 2023 02:21:53 -0500 Subject: [PATCH 04/57] Suppress gossip warnings due to no sampled peers (#2562) --- network/p2p/gossip/gossip.go | 4 +++- network/p2p/validators.go | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/network/p2p/gossip/gossip.go b/network/p2p/gossip/gossip.go index 17795759e063..60eb5560babf 100644 --- a/network/p2p/gossip/gossip.go +++ b/network/p2p/gossip/gossip.go @@ -5,6 +5,7 @@ package gossip import ( "context" + "errors" "fmt" "sync" "time" @@ -165,7 +166,8 @@ func (p *PullGossiper[_]) Gossip(ctx context.Context) error { } for i := 0; i < p.pollSize; i++ { - if err := p.client.AppRequestAny(ctx, msgBytes, p.handleResponse); err != nil { + err := p.client.AppRequestAny(ctx, msgBytes, p.handleResponse) + if err != nil && !errors.Is(err, p2p.ErrNoPeers) { return err } } diff --git a/network/p2p/validators.go b/network/p2p/validators.go index a780c87f0d8c..06a1e913bd0f 100644 --- a/network/p2p/validators.go +++ b/network/p2p/validators.go @@ -86,6 +86,8 @@ func (v *Validators) Sample(ctx context.Context, limit int) []ids.NodeID { v.refresh(ctx) + // TODO: Account for peer connectivity during the sampling of validators + // rather than filtering sampled validators. validatorIDs := v.validatorIDs.Sample(limit) sampled := validatorIDs[:0] From 029867f92a5fc66e2990b2737cf36ba38e6a3a74 Mon Sep 17 00:00:00 2001 From: Stephen Buttolph Date: Fri, 29 Dec 2023 10:57:19 -0500 Subject: [PATCH 05/57] Remove dead code and unnecessary lock from reflect codec (#2560) --- codec/reflectcodec/struct_fielder.go | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/codec/reflectcodec/struct_fielder.go b/codec/reflectcodec/struct_fielder.go index 2fa9133b7d02..8aff2ea33139 100644 --- a/codec/reflectcodec/struct_fielder.go +++ b/codec/reflectcodec/struct_fielder.go @@ -48,7 +48,7 @@ func NewStructFielder(tagNames []string, maxSliceLen uint32) StructFielder { } type structFielder struct { - lock sync.Mutex + lock sync.RWMutex // multiple tags per field can be specified. A field is serialized/deserialized // if it has at least one of the specified tags. @@ -65,15 +65,13 @@ type structFielder struct { } func (s *structFielder) GetSerializedFields(t reflect.Type) ([]FieldDesc, error) { + if serializedFields, ok := s.getCachedSerializedFields(t); ok { // use pre-computed result + return serializedFields, nil + } + s.lock.Lock() defer s.lock.Unlock() - if s.serializedFieldIndices == nil { - s.serializedFieldIndices = make(map[reflect.Type][]FieldDesc) - } - if serializedFields, ok := s.serializedFieldIndices[t]; ok { // use pre-computed result - return serializedFields, nil - } numFields := t.NumField() serializedFields := make([]FieldDesc, 0, numFields) for i := 0; i < numFields; i++ { // Go through all fields of this struct @@ -82,9 +80,7 @@ func (s *structFielder) GetSerializedFields(t reflect.Type) ([]FieldDesc, error) // Multiple tags per fields can be specified. // Serialize/Deserialize field if it has // any tag with the right value - var ( - captureField bool - ) + var captureField bool for _, tag := range s.tags { if field.Tag.Get(tag) == TagValue { captureField = true @@ -114,3 +110,11 @@ func (s *structFielder) GetSerializedFields(t reflect.Type) ([]FieldDesc, error) s.serializedFieldIndices[t] = serializedFields // cache result return serializedFields, nil } + +func (s *structFielder) getCachedSerializedFields(t reflect.Type) ([]FieldDesc, bool) { + s.lock.RLock() + defer s.lock.RUnlock() + + cachedFields, ok := s.serializedFieldIndices[t] + return cachedFields, ok +} From cb840e9be7b28b52408d6cbb72b2693ae9f4f931 Mon Sep 17 00:00:00 2001 From: Stephen Buttolph Date: Fri, 29 Dec 2023 14:25:13 -0500 Subject: [PATCH 06/57] Remove unused index interface (#2564) --- indexer/index.go | 30 ++++++++++-------------------- indexer/index_test.go | 9 +++------ indexer/indexer.go | 16 ++++++++-------- indexer/service.go | 22 +++++++++++----------- 4 files changed, 32 insertions(+), 45 deletions(-) diff --git a/indexer/index.go b/indexer/index.go index 5361754bf73d..19ec2b38aa5f 100644 --- a/indexer/index.go +++ b/indexer/index.go @@ -6,7 +6,6 @@ package indexer import ( "errors" "fmt" - "io" "sync" "go.uber.org/zap" @@ -36,24 +35,14 @@ var ( errNumToFetchInvalid = fmt.Errorf("numToFetch must be in [1,%d]", MaxFetchedByRange) errNoContainerAtIndex = errors.New("no container at index") - _ Index = (*index)(nil) + _ snow.Acceptor = (*index)(nil) ) -// Index indexes containers in their order of acceptance -// Index is thread-safe. -// Index assumes that Accept is called before the container is committed to the -// database of the VM that the container exists in. -type Index interface { - snow.Acceptor - GetContainerByIndex(index uint64) (Container, error) - GetContainerRange(startIndex uint64, numToFetch uint64) ([]Container, error) - GetLastAccepted() (Container, error) - GetIndex(id ids.ID) (uint64, error) - GetContainerByID(id ids.ID) (Container, error) - io.Closer -} - -// indexer indexes all accepted transactions by the order in which they were accepted +// index indexes containers in their order of acceptance +// +// Invariant: index is thread-safe. +// Invariant: index assumes that Accept is called, before the container is +// committed to the database of the VM, in the order they were accepted. type index struct { codec codec.Manager clock mockable.Clock @@ -71,14 +60,15 @@ type index struct { log logging.Logger } -// Returns a new, thread-safe Index. -// Closes [baseDB] on close. +// Create a new thread-safe index. +// +// Invariant: Closes [baseDB] on close. func newIndex( baseDB database.Database, log logging.Logger, codec codec.Manager, clock mockable.Clock, -) (Index, error) { +) (*index, error) { vDB := versiondb.New(baseDB) indexToContainer := prefixdb.New(indexToContainerPrefix, vDB) containerToIndex := prefixdb.New(containerToIDPrefix, vDB) diff --git a/indexer/index_test.go b/indexer/index_test.go index dbac03430a3f..5c4c2f196a61 100644 --- a/indexer/index_test.go +++ b/indexer/index_test.go @@ -31,9 +31,8 @@ func TestIndex(t *testing.T) { snowCtx := snowtest.Context(t, snowtest.CChainID) ctx := snowtest.ConsensusContext(snowCtx) - indexIntf, err := newIndex(db, logging.NoLog{}, codec, mockable.Clock{}) + idx, err := newIndex(db, logging.NoLog{}, codec, mockable.Clock{}) require.NoError(err) - idx := indexIntf.(*index) // Populate "containers" with random IDs/bytes containers := map[ids.ID][]byte{} @@ -84,9 +83,8 @@ func TestIndex(t *testing.T) { require.NoError(db.Commit()) require.NoError(idx.Close()) db = versiondb.New(baseDB) - indexIntf, err = newIndex(db, logging.NoLog{}, codec, mockable.Clock{}) + idx, err = newIndex(db, logging.NoLog{}, codec, mockable.Clock{}) require.NoError(err) - idx = indexIntf.(*index) // Get all of the containers containersList, err := idx.GetContainerRange(0, pageSize) @@ -119,9 +117,8 @@ func TestIndexGetContainerByRangeMaxPageSize(t *testing.T) { db := memdb.New() snowCtx := snowtest.Context(t, snowtest.CChainID) ctx := snowtest.ConsensusContext(snowCtx) - indexIntf, err := newIndex(db, logging.NoLog{}, codec, mockable.Clock{}) + idx, err := newIndex(db, logging.NoLog{}, codec, mockable.Clock{}) require.NoError(err) - idx := indexIntf.(*index) // Insert [MaxFetchedByRange] + 1 containers for i := uint64(0); i < MaxFetchedByRange+1; i++ { diff --git a/indexer/indexer.go b/indexer/indexer.go index e6080c104c2a..8823c184fe14 100644 --- a/indexer/indexer.go +++ b/indexer/indexer.go @@ -88,9 +88,9 @@ func NewIndexer(config Config) (Indexer, error) { blockAcceptorGroup: config.BlockAcceptorGroup, txAcceptorGroup: config.TxAcceptorGroup, vertexAcceptorGroup: config.VertexAcceptorGroup, - txIndices: map[ids.ID]Index{}, - vtxIndices: map[ids.ID]Index{}, - blockIndices: map[ids.ID]Index{}, + txIndices: map[ids.ID]*index{}, + vtxIndices: map[ids.ID]*index{}, + blockIndices: map[ids.ID]*index{}, pathAdder: config.APIServer, shutdownF: config.ShutdownF, } @@ -134,11 +134,11 @@ type indexer struct { indexingEnabled bool // Chain ID --> index of blocks of that chain (if applicable) - blockIndices map[ids.ID]Index + blockIndices map[ids.ID]*index // Chain ID --> index of vertices of that chain (if applicable) - vtxIndices map[ids.ID]Index + vtxIndices map[ids.ID]*index // Chain ID --> index of txs of that chain (if applicable) - txIndices map[ids.ID]Index + txIndices map[ids.ID]*index // Notifies of newly accepted blocks blockAcceptorGroup snow.AcceptorGroup @@ -331,7 +331,7 @@ func (i *indexer) registerChainHelper( prefixEnd byte, name, endpoint string, acceptorGroup snow.AcceptorGroup, -) (Index, error) { +) (*index, error) { prefix := make([]byte, ids.IDLen+wrappers.ByteLen) copy(prefix, chainID[:]) prefix[ids.IDLen] = prefixEnd @@ -353,7 +353,7 @@ func (i *indexer) registerChainHelper( codec := json.NewCodec() apiServer.RegisterCodec(codec, "application/json") apiServer.RegisterCodec(codec, "application/json;charset=UTF-8") - if err := apiServer.RegisterService(&service{Index: index}, "index"); err != nil { + if err := apiServer.RegisterService(&service{index: index}, "index"); err != nil { _ = index.Close() return nil, err } diff --git a/indexer/service.go b/indexer/service.go index 98bc91e90787..5fae26bd3ee2 100644 --- a/indexer/service.go +++ b/indexer/service.go @@ -15,7 +15,7 @@ import ( ) type service struct { - Index + index *index } type FormattedContainer struct { @@ -46,11 +46,11 @@ type GetLastAcceptedArgs struct { } func (s *service) GetLastAccepted(_ *http.Request, args *GetLastAcceptedArgs, reply *FormattedContainer) error { - container, err := s.Index.GetLastAccepted() + container, err := s.index.GetLastAccepted() if err != nil { return err } - index, err := s.Index.GetIndex(container.ID) + index, err := s.index.GetIndex(container.ID) if err != nil { return fmt.Errorf("couldn't get index: %w", err) } @@ -64,11 +64,11 @@ type GetContainerByIndexArgs struct { } func (s *service) GetContainerByIndex(_ *http.Request, args *GetContainerByIndexArgs, reply *FormattedContainer) error { - container, err := s.Index.GetContainerByIndex(uint64(args.Index)) + container, err := s.index.GetContainerByIndex(uint64(args.Index)) if err != nil { return err } - index, err := s.Index.GetIndex(container.ID) + index, err := s.index.GetIndex(container.ID) if err != nil { return fmt.Errorf("couldn't get index: %w", err) } @@ -92,14 +92,14 @@ type GetContainerRangeResponse struct { // If [n] > [MaxFetchedByRange], returns an error. // If we run out of transactions, returns the ones fetched before running out. func (s *service) GetContainerRange(_ *http.Request, args *GetContainerRangeArgs, reply *GetContainerRangeResponse) error { - containers, err := s.Index.GetContainerRange(uint64(args.StartIndex), uint64(args.NumToFetch)) + containers, err := s.index.GetContainerRange(uint64(args.StartIndex), uint64(args.NumToFetch)) if err != nil { return err } reply.Containers = make([]FormattedContainer, len(containers)) for i, container := range containers { - index, err := s.Index.GetIndex(container.ID) + index, err := s.index.GetIndex(container.ID) if err != nil { return fmt.Errorf("couldn't get index: %w", err) } @@ -120,7 +120,7 @@ type GetIndexResponse struct { } func (s *service) GetIndex(_ *http.Request, args *GetIndexArgs, reply *GetIndexResponse) error { - index, err := s.Index.GetIndex(args.ID) + index, err := s.index.GetIndex(args.ID) reply.Index = json.Uint64(index) return err } @@ -134,7 +134,7 @@ type IsAcceptedResponse struct { } func (s *service) IsAccepted(_ *http.Request, args *IsAcceptedArgs, reply *IsAcceptedResponse) error { - _, err := s.Index.GetIndex(args.ID) + _, err := s.index.GetIndex(args.ID) if err == nil { reply.IsAccepted = true return nil @@ -152,11 +152,11 @@ type GetContainerByIDArgs struct { } func (s *service) GetContainerByID(_ *http.Request, args *GetContainerByIDArgs, reply *FormattedContainer) error { - container, err := s.Index.GetContainerByID(args.ID) + container, err := s.index.GetContainerByID(args.ID) if err != nil { return err } - index, err := s.Index.GetIndex(container.ID) + index, err := s.index.GetIndex(container.ID) if err != nil { return fmt.Errorf("couldn't get index: %w", err) } From 60a8158eb1848b2a4d1c837638ace879ff4b4fa0 Mon Sep 17 00:00:00 2001 From: Stephen Buttolph Date: Fri, 29 Dec 2023 15:36:35 -0500 Subject: [PATCH 07/57] Implement SetMap and use it in XP-chain mempools (#2555) Co-authored-by: Dan Laine --- utils/setmap/setmap.go | 138 +++++++ utils/setmap/setmap_test.go | 450 +++++++++++++++++++++ vms/avm/txs/mempool/mempool.go | 29 +- vms/avm/txs/mempool/mempool_test.go | 25 ++ vms/platformvm/txs/mempool/mempool.go | 33 +- vms/platformvm/txs/mempool/mempool_test.go | 25 ++ 6 files changed, 675 insertions(+), 25 deletions(-) create mode 100644 utils/setmap/setmap.go create mode 100644 utils/setmap/setmap_test.go diff --git a/utils/setmap/setmap.go b/utils/setmap/setmap.go new file mode 100644 index 000000000000..b5d694a967c6 --- /dev/null +++ b/utils/setmap/setmap.go @@ -0,0 +1,138 @@ +// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +package setmap + +import ( + "github.com/ava-labs/avalanchego/utils" + "github.com/ava-labs/avalanchego/utils/set" +) + +type Entry[K any, V comparable] struct { + Key K + Set set.Set[V] +} + +// SetMap is a map to a set where all sets are non-overlapping. +type SetMap[K, V comparable] struct { + keyToSet map[K]set.Set[V] + valueToKey map[V]K +} + +// New creates a new empty setmap. +func New[K, V comparable]() *SetMap[K, V] { + return &SetMap[K, V]{ + keyToSet: make(map[K]set.Set[V]), + valueToKey: make(map[V]K), + } +} + +// Put the new entry into the map. Removes and returns: +// * The existing entry for [key]. +// * Existing entries where the set overlaps with the [set]. +func (m *SetMap[K, V]) Put(key K, set set.Set[V]) []Entry[K, V] { + removed := m.DeleteOverlapping(set) + if removedSet, ok := m.DeleteKey(key); ok { + removed = append(removed, Entry[K, V]{ + Key: key, + Set: removedSet, + }) + } + + m.keyToSet[key] = set + for val := range set { + m.valueToKey[val] = key + } + return removed +} + +// GetKey that maps to the provided value. +func (m *SetMap[K, V]) GetKey(val V) (K, bool) { + key, ok := m.valueToKey[val] + return key, ok +} + +// GetSet that is mapped to by the provided key. +func (m *SetMap[K, V]) GetSet(key K) (set.Set[V], bool) { + val, ok := m.keyToSet[key] + return val, ok +} + +// HasKey returns true if [key] is in the map. +func (m *SetMap[K, _]) HasKey(key K) bool { + _, ok := m.keyToSet[key] + return ok +} + +// HasValue returns true if [val] is in a set in the map. +func (m *SetMap[_, V]) HasValue(val V) bool { + _, ok := m.valueToKey[val] + return ok +} + +// HasOverlap returns true if [set] overlaps with any of the sets in the map. +func (m *SetMap[_, V]) HasOverlap(set set.Set[V]) bool { + if set.Len() < len(m.valueToKey) { + for val := range set { + if _, ok := m.valueToKey[val]; ok { + return true + } + } + } else { + for val := range m.valueToKey { + if set.Contains(val) { + return true + } + } + } + return false +} + +// DeleteKey removes [key] from the map and returns the set it mapped to. +func (m *SetMap[K, V]) DeleteKey(key K) (set.Set[V], bool) { + set, ok := m.keyToSet[key] + if !ok { + return nil, false + } + + delete(m.keyToSet, key) + for val := range set { + delete(m.valueToKey, val) + } + return set, true +} + +// DeleteValue removes and returns the entry that contained [val]. +func (m *SetMap[K, V]) DeleteValue(val V) (K, set.Set[V], bool) { + key, ok := m.valueToKey[val] + if !ok { + return utils.Zero[K](), nil, false + } + set, _ := m.DeleteKey(key) + return key, set, true +} + +// DeleteOverlapping removes and returns all the entries where the set overlaps +// with [set]. +func (m *SetMap[K, V]) DeleteOverlapping(set set.Set[V]) []Entry[K, V] { + var removed []Entry[K, V] + for val := range set { + if k, removedSet, ok := m.DeleteValue(val); ok { + removed = append(removed, Entry[K, V]{ + Key: k, + Set: removedSet, + }) + } + } + return removed +} + +// Len return the number of sets in the map. +func (m *SetMap[K, V]) Len() int { + return len(m.keyToSet) +} + +// LenValues return the total number of values across all sets in the map. +func (m *SetMap[K, V]) LenValues() int { + return len(m.valueToKey) +} diff --git a/utils/setmap/setmap_test.go b/utils/setmap/setmap_test.go new file mode 100644 index 000000000000..7d140f5c69e2 --- /dev/null +++ b/utils/setmap/setmap_test.go @@ -0,0 +1,450 @@ +// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +package setmap + +import ( + "testing" + + "github.com/stretchr/testify/require" + + "github.com/ava-labs/avalanchego/utils/set" +) + +func TestSetMapPut(t *testing.T) { + tests := []struct { + name string + state *SetMap[int, int] + key int + value set.Set[int] + expectedRemoved []Entry[int, int] + expectedState *SetMap[int, int] + }{ + { + name: "none removed", + state: New[int, int](), + key: 1, + value: set.Of(2), + expectedRemoved: nil, + expectedState: &SetMap[int, int]{ + keyToSet: map[int]set.Set[int]{ + 1: set.Of(2), + }, + valueToKey: map[int]int{ + 2: 1, + }, + }, + }, + { + name: "key removed", + state: &SetMap[int, int]{ + keyToSet: map[int]set.Set[int]{ + 1: set.Of(2), + }, + valueToKey: map[int]int{ + 2: 1, + }, + }, + key: 1, + value: set.Of(3), + expectedRemoved: []Entry[int, int]{ + { + Key: 1, + Set: set.Of(2), + }, + }, + expectedState: &SetMap[int, int]{ + keyToSet: map[int]set.Set[int]{ + 1: set.Of(3), + }, + valueToKey: map[int]int{ + 3: 1, + }, + }, + }, + { + name: "value removed", + state: &SetMap[int, int]{ + keyToSet: map[int]set.Set[int]{ + 1: set.Of(2), + }, + valueToKey: map[int]int{ + 2: 1, + }, + }, + key: 3, + value: set.Of(2), + expectedRemoved: []Entry[int, int]{ + { + Key: 1, + Set: set.Of(2), + }, + }, + expectedState: &SetMap[int, int]{ + keyToSet: map[int]set.Set[int]{ + 3: set.Of(2), + }, + valueToKey: map[int]int{ + 2: 3, + }, + }, + }, + { + name: "key and value removed", + state: &SetMap[int, int]{ + keyToSet: map[int]set.Set[int]{ + 1: set.Of(2), + 3: set.Of(4), + }, + valueToKey: map[int]int{ + 2: 1, + 4: 3, + }, + }, + key: 1, + value: set.Of(4), + expectedRemoved: []Entry[int, int]{ + { + Key: 1, + Set: set.Of(2), + }, + { + Key: 3, + Set: set.Of(4), + }, + }, + expectedState: &SetMap[int, int]{ + keyToSet: map[int]set.Set[int]{ + 1: set.Of(4), + }, + valueToKey: map[int]int{ + 4: 1, + }, + }, + }, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + require := require.New(t) + + removed := test.state.Put(test.key, test.value) + require.ElementsMatch(test.expectedRemoved, removed) + require.Equal(test.expectedState, test.state) + }) + } +} + +func TestSetMapHasValueAndGetKeyAndSetOverlaps(t *testing.T) { + m := New[int, int]() + require.Empty(t, m.Put(1, set.Of(2))) + + tests := []struct { + name string + value int + expectedKey int + expectedExists bool + }{ + { + name: "fetch unknown", + value: 3, + expectedKey: 0, + expectedExists: false, + }, + { + name: "fetch known value", + value: 2, + expectedKey: 1, + expectedExists: true, + }, + { + name: "fetch known key", + value: 1, + expectedKey: 0, + expectedExists: false, + }, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + require := require.New(t) + + exists := m.HasValue(test.value) + require.Equal(test.expectedExists, exists) + + key, exists := m.GetKey(test.value) + require.Equal(test.expectedKey, key) + require.Equal(test.expectedExists, exists) + }) + } +} + +func TestSetMapHasOverlap(t *testing.T) { + m := New[int, int]() + require.Empty(t, m.Put(1, set.Of(2))) + require.Empty(t, m.Put(2, set.Of(3, 4))) + + tests := []struct { + name string + set set.Set[int] + expectedOverlaps bool + }{ + { + name: "small fetch unknown", + set: set.Of(5), + expectedOverlaps: false, + }, + { + name: "large fetch unknown", + set: set.Of(5, 6, 7, 8), + expectedOverlaps: false, + }, + { + name: "small fetch known", + set: set.Of(3), + expectedOverlaps: true, + }, + { + name: "large fetch known", + set: set.Of(3, 5, 6, 7, 8), + expectedOverlaps: true, + }, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + overlaps := m.HasOverlap(test.set) + require.Equal(t, test.expectedOverlaps, overlaps) + }) + } +} + +func TestSetMapHasKeyAndGetSet(t *testing.T) { + m := New[int, int]() + require.Empty(t, m.Put(1, set.Of(2))) + + tests := []struct { + name string + key int + expectedValue set.Set[int] + expectedExists bool + }{ + { + name: "fetch unknown", + key: 3, + expectedValue: nil, + expectedExists: false, + }, + { + name: "fetch known key", + key: 1, + expectedValue: set.Of(2), + expectedExists: true, + }, + { + name: "fetch known value", + key: 2, + expectedValue: nil, + expectedExists: false, + }, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + require := require.New(t) + + exists := m.HasKey(test.key) + require.Equal(test.expectedExists, exists) + + value, exists := m.GetSet(test.key) + require.Equal(test.expectedValue, value) + require.Equal(test.expectedExists, exists) + }) + } +} + +func TestSetMapDeleteKey(t *testing.T) { + tests := []struct { + name string + state *SetMap[int, int] + key int + expectedValue set.Set[int] + expectedRemoved bool + expectedState *SetMap[int, int] + }{ + { + name: "none removed", + state: New[int, int](), + key: 1, + expectedValue: nil, + expectedRemoved: false, + expectedState: New[int, int](), + }, + { + name: "key removed", + state: &SetMap[int, int]{ + keyToSet: map[int]set.Set[int]{ + 1: set.Of(2), + }, + valueToKey: map[int]int{ + 2: 1, + }, + }, + key: 1, + expectedValue: set.Of(2), + expectedRemoved: true, + expectedState: New[int, int](), + }, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + require := require.New(t) + + value, removed := test.state.DeleteKey(test.key) + require.Equal(test.expectedValue, value) + require.Equal(test.expectedRemoved, removed) + require.Equal(test.expectedState, test.state) + }) + } +} + +func TestSetMapDeleteValue(t *testing.T) { + tests := []struct { + name string + state *SetMap[int, int] + value int + expectedKey int + expectedSet set.Set[int] + expectedRemoved bool + expectedState *SetMap[int, int] + }{ + { + name: "none removed", + state: New[int, int](), + value: 1, + expectedKey: 0, + expectedSet: nil, + expectedRemoved: false, + expectedState: New[int, int](), + }, + { + name: "key removed", + state: &SetMap[int, int]{ + keyToSet: map[int]set.Set[int]{ + 1: set.Of(2), + }, + valueToKey: map[int]int{ + 2: 1, + }, + }, + value: 2, + expectedKey: 1, + expectedSet: set.Of(2), + expectedRemoved: true, + expectedState: New[int, int](), + }, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + require := require.New(t) + + key, set, removed := test.state.DeleteValue(test.value) + require.Equal(test.expectedKey, key) + require.Equal(test.expectedSet, set) + require.Equal(test.expectedRemoved, removed) + require.Equal(test.expectedState, test.state) + }) + } +} + +func TestSetMapDeleteOverlapping(t *testing.T) { + tests := []struct { + name string + state *SetMap[int, int] + set set.Set[int] + expectedRemoved []Entry[int, int] + expectedState *SetMap[int, int] + }{ + { + name: "none removed", + state: New[int, int](), + set: set.Of(1), + expectedRemoved: nil, + expectedState: New[int, int](), + }, + { + name: "key removed", + state: &SetMap[int, int]{ + keyToSet: map[int]set.Set[int]{ + 1: set.Of(2), + }, + valueToKey: map[int]int{ + 2: 1, + }, + }, + set: set.Of(2), + expectedRemoved: []Entry[int, int]{ + { + Key: 1, + Set: set.Of(2), + }, + }, + expectedState: New[int, int](), + }, + { + name: "multiple keys removed", + state: &SetMap[int, int]{ + keyToSet: map[int]set.Set[int]{ + 1: set.Of(2, 3), + 2: set.Of(4), + }, + valueToKey: map[int]int{ + 2: 1, + 3: 1, + 4: 2, + }, + }, + set: set.Of(2, 4), + expectedRemoved: []Entry[int, int]{ + { + Key: 1, + Set: set.Of(2, 3), + }, + { + Key: 2, + Set: set.Of(4), + }, + }, + expectedState: New[int, int](), + }, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + require := require.New(t) + + removed := test.state.DeleteOverlapping(test.set) + require.ElementsMatch(test.expectedRemoved, removed) + require.Equal(test.expectedState, test.state) + }) + } +} + +func TestSetMapLen(t *testing.T) { + require := require.New(t) + + m := New[int, int]() + require.Zero(m.Len()) + require.Zero(m.LenValues()) + + m.Put(1, set.Of(2)) + require.Equal(1, m.Len()) + require.Equal(1, m.LenValues()) + + m.Put(2, set.Of(3, 4)) + require.Equal(2, m.Len()) + require.Equal(3, m.LenValues()) + + m.Put(1, set.Of(4, 5)) + require.Equal(1, m.Len()) + require.Equal(2, m.LenValues()) + + m.DeleteKey(1) + require.Zero(m.Len()) + require.Zero(m.LenValues()) +} diff --git a/vms/avm/txs/mempool/mempool.go b/vms/avm/txs/mempool/mempool.go index f7d9bc37262d..3e0dd3793560 100644 --- a/vms/avm/txs/mempool/mempool.go +++ b/vms/avm/txs/mempool/mempool.go @@ -15,7 +15,7 @@ import ( "github.com/ava-labs/avalanchego/snow/engine/common" "github.com/ava-labs/avalanchego/utils" "github.com/ava-labs/avalanchego/utils/linkedhashmap" - "github.com/ava-labs/avalanchego/utils/set" + "github.com/ava-labs/avalanchego/utils/setmap" "github.com/ava-labs/avalanchego/utils/units" "github.com/ava-labs/avalanchego/vms/avm/txs" ) @@ -45,6 +45,7 @@ var ( type Mempool interface { Add(tx *txs.Tx) error Get(txID ids.ID) (*txs.Tx, bool) + // Remove [txs] and any conflicts of [txs] from the mempool. Remove(txs ...*txs.Tx) // Peek returns the oldest tx in the mempool. @@ -67,7 +68,7 @@ type Mempool interface { type mempool struct { lock sync.RWMutex unissuedTxs linkedhashmap.LinkedHashmap[ids.ID, *txs.Tx] - consumedUTXOs set.Set[ids.ID] + consumedUTXOs *setmap.SetMap[ids.ID, ids.ID] // TxID -> Consumed UTXOs bytesAvailable int droppedTxIDs *cache.LRU[ids.ID, error] // TxID -> Verification error @@ -84,6 +85,7 @@ func New( ) (Mempool, error) { m := &mempool{ unissuedTxs: linkedhashmap.New[ids.ID, *txs.Tx](), + consumedUTXOs: setmap.New[ids.ID, ids.ID](), bytesAvailable: maxMempoolSize, droppedTxIDs: &cache.LRU[ids.ID, error]{Size: droppedTxIDsCacheSize}, toEngine: toEngine, @@ -136,7 +138,7 @@ func (m *mempool) Add(tx *txs.Tx) error { } inputs := tx.Unsigned.InputIDs() - if m.consumedUTXOs.Overlaps(inputs) { + if m.consumedUTXOs.HasOverlap(inputs) { return fmt.Errorf("%w: %s", ErrConflictsWithOtherTx, txID) } @@ -147,7 +149,7 @@ func (m *mempool) Add(tx *txs.Tx) error { m.numTxs.Inc() // Mark these UTXOs as consumed in the mempool - m.consumedUTXOs.Union(inputs) + m.consumedUTXOs.Put(txID, inputs) // An added tx must not be marked as dropped. m.droppedTxIDs.Evict(txID) @@ -165,18 +167,23 @@ func (m *mempool) Remove(txs ...*txs.Tx) { for _, tx := range txs { txID := tx.ID() - if !m.unissuedTxs.Delete(txID) { + // If the transaction is in the mempool, remove it. + if _, ok := m.consumedUTXOs.DeleteKey(txID); ok { + m.unissuedTxs.Delete(txID) + m.bytesAvailable += len(tx.Bytes()) continue } - m.bytesAvailable += len(tx.Bytes()) - m.bytesAvailableMetric.Set(float64(m.bytesAvailable)) - - m.numTxs.Dec() - + // If the transaction isn't in the mempool, remove any conflicts it has. inputs := tx.Unsigned.InputIDs() - m.consumedUTXOs.Difference(inputs) + for _, removed := range m.consumedUTXOs.DeleteOverlapping(inputs) { + tx, _ := m.unissuedTxs.Get(removed.Key) + m.unissuedTxs.Delete(removed.Key) + m.bytesAvailable += len(tx.Bytes()) + } } + m.bytesAvailableMetric.Set(float64(m.bytesAvailable)) + m.numTxs.Set(float64(m.unissuedTxs.Len())) } func (m *mempool) Peek() (*txs.Tx, bool) { diff --git a/vms/avm/txs/mempool/mempool_test.go b/vms/avm/txs/mempool/mempool_test.go index 5691662cbaa0..d76caebbb2af 100644 --- a/vms/avm/txs/mempool/mempool_test.go +++ b/vms/avm/txs/mempool/mempool_test.go @@ -163,6 +163,31 @@ func TestPeek(t *testing.T) { require.False(exists) } +func TestRemoveConflict(t *testing.T) { + require := require.New(t) + + mempool, err := New( + "mempool", + prometheus.NewRegistry(), + nil, + ) + require.NoError(err) + + tx := newTx(0, 32) + txConflict := newTx(0, 32) + + require.NoError(mempool.Add(tx)) + + returnedTx, exists := mempool.Peek() + require.True(exists) + require.Equal(returnedTx, tx) + + mempool.Remove(txConflict) + + _, exists = mempool.Peek() + require.False(exists) +} + func TestIterate(t *testing.T) { require := require.New(t) diff --git a/vms/platformvm/txs/mempool/mempool.go b/vms/platformvm/txs/mempool/mempool.go index 148a804f9df6..63315d99c5fc 100644 --- a/vms/platformvm/txs/mempool/mempool.go +++ b/vms/platformvm/txs/mempool/mempool.go @@ -15,7 +15,7 @@ import ( "github.com/ava-labs/avalanchego/snow/engine/common" "github.com/ava-labs/avalanchego/utils" "github.com/ava-labs/avalanchego/utils/linkedhashmap" - "github.com/ava-labs/avalanchego/utils/set" + "github.com/ava-labs/avalanchego/utils/setmap" "github.com/ava-labs/avalanchego/utils/units" "github.com/ava-labs/avalanchego/vms/platformvm/txs" ) @@ -28,8 +28,6 @@ const ( // droppedTxIDsCacheSize is the maximum number of dropped txIDs to cache droppedTxIDsCacheSize = 64 - initialConsumedUTXOsSize = 512 - // maxMempoolSize is the maximum number of bytes allowed in the mempool maxMempoolSize = 64 * units.MiB ) @@ -48,6 +46,7 @@ var ( type Mempool interface { Add(tx *txs.Tx) error Get(txID ids.ID) (*txs.Tx, bool) + // Remove [txs] and any conflicts of [txs] from the mempool. Remove(txs ...*txs.Tx) // Peek returns the oldest tx in the mempool. @@ -75,7 +74,7 @@ type Mempool interface { type mempool struct { lock sync.RWMutex unissuedTxs linkedhashmap.LinkedHashmap[ids.ID, *txs.Tx] - consumedUTXOs set.Set[ids.ID] + consumedUTXOs *setmap.SetMap[ids.ID, ids.ID] // TxID -> Consumed UTXOs bytesAvailable int droppedTxIDs *cache.LRU[ids.ID, error] // TxID -> verification error @@ -92,7 +91,7 @@ func New( ) (Mempool, error) { m := &mempool{ unissuedTxs: linkedhashmap.New[ids.ID, *txs.Tx](), - consumedUTXOs: set.NewSet[ids.ID](initialConsumedUTXOsSize), + consumedUTXOs: setmap.New[ids.ID, ids.ID](), bytesAvailable: maxMempoolSize, droppedTxIDs: &cache.LRU[ids.ID, error]{Size: droppedTxIDsCacheSize}, toEngine: toEngine, @@ -153,17 +152,17 @@ func (m *mempool) Add(tx *txs.Tx) error { } inputs := tx.Unsigned.InputIDs() - if m.consumedUTXOs.Overlaps(inputs) { + if m.consumedUTXOs.HasOverlap(inputs) { return fmt.Errorf("%w: %s", ErrConflictsWithOtherTx, txID) } - m.unissuedTxs.Put(tx.ID(), tx) + m.unissuedTxs.Put(txID, tx) m.numTxs.Inc() m.bytesAvailable -= txSize m.bytesAvailableMetric.Set(float64(m.bytesAvailable)) // Mark these UTXOs as consumed in the mempool - m.consumedUTXOs.Union(inputs) + m.consumedUTXOs.Put(txID, inputs) // An explicitly added tx must not be marked as dropped. m.droppedTxIDs.Evict(txID) @@ -181,17 +180,23 @@ func (m *mempool) Remove(txs ...*txs.Tx) { for _, tx := range txs { txID := tx.ID() - if !m.unissuedTxs.Delete(txID) { + // If the transaction is in the mempool, remove it. + if _, ok := m.consumedUTXOs.DeleteKey(txID); ok { + m.unissuedTxs.Delete(txID) + m.bytesAvailable += len(tx.Bytes()) continue } - m.numTxs.Dec() - - m.bytesAvailable += len(tx.Bytes()) - m.bytesAvailableMetric.Set(float64(m.bytesAvailable)) + // If the transaction isn't in the mempool, remove any conflicts it has. inputs := tx.Unsigned.InputIDs() - m.consumedUTXOs.Difference(inputs) + for _, removed := range m.consumedUTXOs.DeleteOverlapping(inputs) { + tx, _ := m.unissuedTxs.Get(removed.Key) + m.unissuedTxs.Delete(removed.Key) + m.bytesAvailable += len(tx.Bytes()) + } } + m.bytesAvailableMetric.Set(float64(m.bytesAvailable)) + m.numTxs.Set(float64(m.unissuedTxs.Len())) } func (m *mempool) Peek() (*txs.Tx, bool) { diff --git a/vms/platformvm/txs/mempool/mempool_test.go b/vms/platformvm/txs/mempool/mempool_test.go index 31420e94ecbb..280dc5487ba6 100644 --- a/vms/platformvm/txs/mempool/mempool_test.go +++ b/vms/platformvm/txs/mempool/mempool_test.go @@ -239,3 +239,28 @@ func TestPeekTxs(t *testing.T) { require.False(exists) require.Nil(tx) } + +func TestRemoveConflicts(t *testing.T) { + require := require.New(t) + + registerer := prometheus.NewRegistry() + toEngine := make(chan common.Message, 100) + mempool, err := New("mempool", registerer, toEngine) + require.NoError(err) + + txs, err := createTestDecisionTxs(1) + require.NoError(err) + conflictTxs, err := createTestDecisionTxs(1) + require.NoError(err) + + require.NoError(mempool.Add(txs[0])) + + tx, exists := mempool.Peek() + require.True(exists) + require.Equal(tx, txs[0]) + + mempool.Remove(conflictTxs[0]) + + _, exists = mempool.Peek() + require.False(exists) +} From 6d28ae0fc0e1d22859ba2f4e6c7ae268c4ab4ecb Mon Sep 17 00:00:00 2001 From: Dhruba Basu <7675102+dhrubabasu@users.noreply.github.com> Date: Fri, 29 Dec 2023 16:06:30 -0500 Subject: [PATCH 08/57] `vms/platformvm`: Add `TestIterate` (#2565) --- vms/platformvm/txs/mempool/mempool_test.go | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/vms/platformvm/txs/mempool/mempool_test.go b/vms/platformvm/txs/mempool/mempool_test.go index 280dc5487ba6..c4af0fc1c6db 100644 --- a/vms/platformvm/txs/mempool/mempool_test.go +++ b/vms/platformvm/txs/mempool/mempool_test.go @@ -14,6 +14,7 @@ import ( "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/snow/engine/common" "github.com/ava-labs/avalanchego/utils/crypto/secp256k1" + "github.com/ava-labs/avalanchego/utils/set" "github.com/ava-labs/avalanchego/vms/components/avax" "github.com/ava-labs/avalanchego/vms/platformvm/txs" "github.com/ava-labs/avalanchego/vms/secp256k1fx" @@ -264,3 +265,36 @@ func TestRemoveConflicts(t *testing.T) { _, exists = mempool.Peek() require.False(exists) } + +func TestIterate(t *testing.T) { + require := require.New(t) + + registerer := prometheus.NewRegistry() + toEngine := make(chan common.Message, 100) + mempool, err := New("mempool", registerer, toEngine) + require.NoError(err) + + testDecisionTxs, err := createTestDecisionTxs(1) + require.NoError(err) + decisionTx := testDecisionTxs[0] + + testProposalTxs, err := createTestProposalTxs(1) + require.NoError(err) + proposalTx := testProposalTxs[0] + + require.NoError(mempool.Add(decisionTx)) + require.NoError(mempool.Add(proposalTx)) + + expectedSet := set.Of( + decisionTx.ID(), + proposalTx.ID(), + ) + + set := set.NewSet[ids.ID](2) + mempool.Iterate(func(tx *txs.Tx) bool { + set.Add(tx.ID()) + return true + }) + + require.Equal(expectedSet, set) +} From e89d9728b0cb62a5ec2a621f4aa8752de6debcb5 Mon Sep 17 00:00:00 2001 From: Stephen Buttolph Date: Fri, 29 Dec 2023 16:18:14 -0500 Subject: [PATCH 09/57] Cleanup codec usage (#2563) --- api/keystore/codec.go | 10 ++--- api/keystore/keystore.go | 10 ++--- chains/atomic/codec.go | 12 +++--- chains/atomic/memory.go | 2 +- chains/atomic/state.go | 6 +-- database/encdb/codec.go | 22 +++++++++++ database/encdb/db.go | 19 ++-------- database/linkeddb/codec.go | 13 ++----- database/linkeddb/linkeddb.go | 4 +- indexer/codec.go | 24 ++++++++++++ indexer/index.go | 8 +--- indexer/index_test.go | 16 ++------ indexer/indexer.go | 37 +++++-------------- indexer/indexer_test.go | 1 - snow/engine/avalanche/vertex/builder.go | 6 +-- snow/engine/avalanche/vertex/codec.go | 25 +++++++------ snow/engine/avalanche/vertex/parser.go | 2 +- .../avalanche/vertex/stateless_vertex.go | 8 ++-- vms/components/keystore/codec.go | 6 +-- vms/components/message/codec.go | 10 ++--- vms/components/message/message.go | 6 +-- vms/example/xsvm/api/client.go | 2 +- vms/example/xsvm/block/block.go | 2 +- vms/example/xsvm/block/codec.go | 3 +- vms/example/xsvm/chain/chain.go | 2 +- vms/example/xsvm/cmd/chain/create/cmd.go | 2 +- vms/example/xsvm/cmd/chain/genesis/cmd.go | 2 +- vms/example/xsvm/execute/block.go | 2 +- vms/example/xsvm/execute/genesis.go | 2 +- vms/example/xsvm/genesis/codec.go | 3 +- vms/example/xsvm/genesis/genesis.go | 2 +- vms/example/xsvm/genesis/genesis_test.go | 2 +- vms/example/xsvm/tx/codec.go | 5 +-- vms/example/xsvm/tx/payload.go | 2 +- vms/example/xsvm/tx/tx.go | 6 +-- vms/platformvm/api/static_service.go | 2 +- vms/platformvm/block/block.go | 2 +- .../block/builder/standard_block_test.go | 2 +- vms/platformvm/block/codec.go | 7 ++-- vms/platformvm/block/serialization_test.go | 2 +- vms/platformvm/genesis/codec.go | 2 +- vms/platformvm/service.go | 6 +-- vms/platformvm/service_test.go | 2 +- vms/platformvm/state/metadata_codec.go | 20 +++++----- vms/platformvm/state/metadata_delegator.go | 4 +- .../state/metadata_delegator_test.go | 8 ++-- vms/platformvm/state/metadata_validator.go | 6 +-- .../state/metadata_validator_test.go | 7 ++-- vms/platformvm/state/state.go | 20 +++++----- vms/platformvm/state/state_test.go | 2 +- .../add_permissionless_delegator_tx_test.go | 8 ++-- .../add_permissionless_validator_tx_test.go | 8 ++-- .../txs/add_subnet_validator_test.go | 2 +- vms/platformvm/txs/base_tx_test.go | 4 +- vms/platformvm/txs/codec.go | 7 ++-- .../txs/executor/advance_time_test.go | 2 +- vms/platformvm/txs/executor/import_test.go | 2 +- .../txs/executor/standard_tx_executor.go | 2 +- .../txs/remove_subnet_validator_tx_test.go | 4 +- .../txs/transfer_subnet_ownership_tx_test.go | 4 +- .../txs/transform_subnet_tx_test.go | 4 +- vms/platformvm/txs/tx.go | 10 ++--- vms/platformvm/utxo/handler.go | 4 +- vms/platformvm/vm_regression_test.go | 4 +- vms/platformvm/vm_test.go | 2 +- vms/platformvm/warp/codec.go | 9 ++--- vms/platformvm/warp/message.go | 4 +- vms/platformvm/warp/payload/codec.go | 9 ++--- vms/platformvm/warp/payload/payload.go | 4 +- vms/platformvm/warp/unsigned_message.go | 4 +- vms/proposervm/block/build.go | 10 ++--- vms/proposervm/block/codec.go | 21 +++++------ vms/proposervm/block/parse.go | 12 +++--- vms/proposervm/state/block_state.go | 6 +-- vms/proposervm/state/codec.go | 8 ++-- vms/proposervm/summary/build.go | 2 +- vms/proposervm/summary/codec.go | 8 ++-- vms/proposervm/summary/parse.go | 4 +- wallet/chain/p/signer_visitor.go | 4 +- 79 files changed, 265 insertions(+), 283 deletions(-) create mode 100644 database/encdb/codec.go create mode 100644 indexer/codec.go diff --git a/api/keystore/codec.go b/api/keystore/codec.go index ebb196ccbfff..68025c140564 100644 --- a/api/keystore/codec.go +++ b/api/keystore/codec.go @@ -10,18 +10,18 @@ import ( ) const ( + CodecVersion = 0 + maxPackerSize = 1 * units.GiB // max size, in bytes, of something being marshalled by Marshal() maxSliceLength = linearcodec.DefaultMaxSliceLength - - codecVersion = 0 ) -var c codec.Manager +var Codec codec.Manager func init() { lc := linearcodec.NewCustomMaxLength(maxSliceLength) - c = codec.NewManager(maxPackerSize) - if err := c.RegisterCodec(codecVersion, lc); err != nil { + Codec = codec.NewManager(maxPackerSize) + if err := Codec.RegisterCodec(CodecVersion, lc); err != nil { panic(err) } } diff --git a/api/keystore/keystore.go b/api/keystore/keystore.go index cd7f0b8a8f21..02d5f5dc6238 100644 --- a/api/keystore/keystore.go +++ b/api/keystore/keystore.go @@ -188,7 +188,7 @@ func (ks *keystore) CreateUser(username, pw string) error { return err } - passwordBytes, err := c.Marshal(codecVersion, passwordHash) + passwordBytes, err := Codec.Marshal(CodecVersion, passwordHash) if err != nil { return err } @@ -288,14 +288,14 @@ func (ks *keystore) ImportUser(username, pw string, userBytes []byte) error { } userData := user{} - if _, err := c.Unmarshal(userBytes, &userData); err != nil { + if _, err := Codec.Unmarshal(userBytes, &userData); err != nil { return err } if !userData.Hash.Check(pw) { return fmt.Errorf("%w: user %q", errIncorrectPassword, username) } - usrBytes, err := c.Marshal(codecVersion, &userData.Hash) + usrBytes, err := Codec.Marshal(CodecVersion, &userData.Hash) if err != nil { return err } @@ -355,7 +355,7 @@ func (ks *keystore) ExportUser(username, pw string) ([]byte, error) { } // Return the byte representation of the user - return c.Marshal(codecVersion, &userData) + return Codec.Marshal(CodecVersion, &userData) } func (ks *keystore) getPassword(username string) (*password.Hash, error) { @@ -377,6 +377,6 @@ func (ks *keystore) getPassword(username string) (*password.Hash, error) { } passwordHash = &password.Hash{} - _, err = c.Unmarshal(userBytes, passwordHash) + _, err = Codec.Unmarshal(userBytes, passwordHash) return passwordHash, err } diff --git a/chains/atomic/codec.go b/chains/atomic/codec.go index bc2e93c27213..49bfd4bf9323 100644 --- a/chains/atomic/codec.go +++ b/chains/atomic/codec.go @@ -8,15 +8,15 @@ import ( "github.com/ava-labs/avalanchego/codec/linearcodec" ) -const codecVersion = 0 +const CodecVersion = 0 -// codecManager is used to marshal and unmarshal dbElements and chain IDs. -var codecManager codec.Manager +// Codec is used to marshal and unmarshal dbElements and chain IDs. +var Codec codec.Manager func init() { - linearCodec := linearcodec.NewDefault() - codecManager = codec.NewDefaultManager() - if err := codecManager.RegisterCodec(codecVersion, linearCodec); err != nil { + lc := linearcodec.NewDefault() + Codec = codec.NewDefaultManager() + if err := Codec.RegisterCodec(CodecVersion, lc); err != nil { panic(err) } } diff --git a/chains/atomic/memory.go b/chains/atomic/memory.go index a8aa703fe217..77c1bb78cec6 100644 --- a/chains/atomic/memory.go +++ b/chains/atomic/memory.go @@ -107,7 +107,7 @@ func sharedID(id1, id2 ids.ID) ids.ID { id1, id2 = id2, id1 } - combinedBytes, err := codecManager.Marshal(codecVersion, [2]ids.ID{id1, id2}) + combinedBytes, err := Codec.Marshal(CodecVersion, [2]ids.ID{id1, id2}) if err != nil { panic(err) } diff --git a/chains/atomic/state.go b/chains/atomic/state.go index 402477299c21..7751d452b510 100644 --- a/chains/atomic/state.go +++ b/chains/atomic/state.go @@ -112,7 +112,7 @@ func (s *state) SetValue(e *Element) error { Traits: e.Traits, } - valueBytes, err := codecManager.Marshal(codecVersion, &dbElem) + valueBytes, err := Codec.Marshal(CodecVersion, &dbElem) if err != nil { return err } @@ -156,7 +156,7 @@ func (s *state) RemoveValue(key []byte) error { // The value doesn't exist, so we should optimistically delete it dbElem := dbElement{Present: false} - valueBytes, err := codecManager.Marshal(codecVersion, &dbElem) + valueBytes, err := Codec.Marshal(CodecVersion, &dbElem) if err != nil { return err } @@ -189,7 +189,7 @@ func (s *state) loadValue(key []byte) (*dbElement, error) { // The key was in the database value := &dbElement{} - _, err = codecManager.Unmarshal(valueBytes, value) + _, err = Codec.Unmarshal(valueBytes, value) return value, err } diff --git a/database/encdb/codec.go b/database/encdb/codec.go new file mode 100644 index 000000000000..ab9977945f6d --- /dev/null +++ b/database/encdb/codec.go @@ -0,0 +1,22 @@ +// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +package encdb + +import ( + "github.com/ava-labs/avalanchego/codec" + "github.com/ava-labs/avalanchego/codec/linearcodec" +) + +const CodecVersion = 0 + +var Codec codec.Manager + +func init() { + lc := linearcodec.NewDefault() + Codec = codec.NewDefaultManager() + + if err := Codec.RegisterCodec(CodecVersion, lc); err != nil { + panic(err) + } +} diff --git a/database/encdb/db.go b/database/encdb/db.go index 42518bef9fc9..27565c87f99b 100644 --- a/database/encdb/db.go +++ b/database/encdb/db.go @@ -13,16 +13,10 @@ import ( "golang.org/x/exp/slices" - "github.com/ava-labs/avalanchego/codec" - "github.com/ava-labs/avalanchego/codec/linearcodec" "github.com/ava-labs/avalanchego/database" "github.com/ava-labs/avalanchego/utils/hashing" ) -const ( - codecVersion = 0 -) - var ( _ database.Database = (*Database)(nil) _ database.Batch = (*batch)(nil) @@ -32,7 +26,6 @@ var ( // Database encrypts all values that are provided type Database struct { lock sync.RWMutex - codec codec.Manager cipher cipher.AEAD db database.Database closed bool @@ -42,16 +35,10 @@ type Database struct { func New(password []byte, db database.Database) (*Database, error) { h := hashing.ComputeHash256(password) aead, err := chacha20poly1305.NewX(h) - if err != nil { - return nil, err - } - c := linearcodec.NewDefault() - manager := codec.NewDefaultManager() return &Database{ - codec: manager, cipher: aead, db: db, - }, manager.RegisterCodec(codecVersion, c) + }, err } func (db *Database) Has(key []byte) (bool, error) { @@ -297,7 +284,7 @@ func (db *Database) encrypt(plaintext []byte) ([]byte, error) { return nil, err } ciphertext := db.cipher.Seal(nil, nonce, plaintext, nil) - return db.codec.Marshal(codecVersion, &encryptedValue{ + return Codec.Marshal(CodecVersion, &encryptedValue{ Ciphertext: ciphertext, Nonce: nonce, }) @@ -305,7 +292,7 @@ func (db *Database) encrypt(plaintext []byte) ([]byte, error) { func (db *Database) decrypt(ciphertext []byte) ([]byte, error) { val := encryptedValue{} - if _, err := db.codec.Unmarshal(ciphertext, &val); err != nil { + if _, err := Codec.Unmarshal(ciphertext, &val); err != nil { return nil, err } return db.cipher.Open(nil, val.Nonce, val.Ciphertext, nil) diff --git a/database/linkeddb/codec.go b/database/linkeddb/codec.go index 7780690b2e92..b2607dfbb045 100644 --- a/database/linkeddb/codec.go +++ b/database/linkeddb/codec.go @@ -10,20 +10,15 @@ import ( "github.com/ava-labs/avalanchego/codec/linearcodec" ) -const ( - codecVersion = 0 -) +const CodecVersion = 0 -// c does serialization and deserialization -var ( - c codec.Manager -) +var Codec codec.Manager func init() { lc := linearcodec.NewCustomMaxLength(math.MaxUint32) - c = codec.NewManager(math.MaxInt32) + Codec = codec.NewManager(math.MaxInt32) - if err := c.RegisterCodec(codecVersion, lc); err != nil { + if err := Codec.RegisterCodec(CodecVersion, lc); err != nil { panic(err) } } diff --git a/database/linkeddb/linkeddb.go b/database/linkeddb/linkeddb.go index 597e1258367e..6120d182fbc2 100644 --- a/database/linkeddb/linkeddb.go +++ b/database/linkeddb/linkeddb.go @@ -316,7 +316,7 @@ func (ldb *linkedDB) getNode(key []byte) (node, error) { return node{}, err } n := node{} - _, err = c.Unmarshal(nodeBytes, &n) + _, err = Codec.Unmarshal(nodeBytes, &n) if err == nil { ldb.nodeCache.Put(keyStr, &n) } @@ -325,7 +325,7 @@ func (ldb *linkedDB) getNode(key []byte) (node, error) { func (ldb *linkedDB) putNode(key []byte, n node) error { ldb.updatedNodes[string(key)] = &n - nodeBytes, err := c.Marshal(codecVersion, n) + nodeBytes, err := Codec.Marshal(CodecVersion, n) if err != nil { return err } diff --git a/indexer/codec.go b/indexer/codec.go new file mode 100644 index 000000000000..f41cb8fa80f1 --- /dev/null +++ b/indexer/codec.go @@ -0,0 +1,24 @@ +// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +package indexer + +import ( + "math" + + "github.com/ava-labs/avalanchego/codec" + "github.com/ava-labs/avalanchego/codec/linearcodec" +) + +const CodecVersion = 0 + +var Codec codec.Manager + +func init() { + lc := linearcodec.NewCustomMaxLength(math.MaxUint32) + Codec = codec.NewManager(math.MaxInt) + + if err := Codec.RegisterCodec(CodecVersion, lc); err != nil { + panic(err) + } +} diff --git a/indexer/index.go b/indexer/index.go index 19ec2b38aa5f..d182c6938d8e 100644 --- a/indexer/index.go +++ b/indexer/index.go @@ -10,7 +10,6 @@ import ( "go.uber.org/zap" - "github.com/ava-labs/avalanchego/codec" "github.com/ava-labs/avalanchego/database" "github.com/ava-labs/avalanchego/database/prefixdb" "github.com/ava-labs/avalanchego/database/versiondb" @@ -44,7 +43,6 @@ var ( // Invariant: index assumes that Accept is called, before the container is // committed to the database of the VM, in the order they were accepted. type index struct { - codec codec.Manager clock mockable.Clock lock sync.RWMutex // The index of the next accepted transaction @@ -66,7 +64,6 @@ type index struct { func newIndex( baseDB database.Database, log logging.Logger, - codec codec.Manager, clock mockable.Clock, ) (*index, error) { vDB := versiondb.New(baseDB) @@ -75,7 +72,6 @@ func newIndex( i := &index{ clock: clock, - codec: codec, baseDB: baseDB, vDB: vDB, indexToContainer: indexToContainer, @@ -140,7 +136,7 @@ func (i *index) Accept(ctx *snow.ConsensusContext, containerID ids.ID, container ) // Persist index --> Container nextAcceptedIndexBytes := database.PackUInt64(i.nextAcceptedIndex) - bytes, err := i.codec.Marshal(codecVersion, Container{ + bytes, err := Codec.Marshal(CodecVersion, Container{ ID: containerID, Bytes: containerBytes, Timestamp: i.clock.Time().UnixNano(), @@ -199,7 +195,7 @@ func (i *index) getContainerByIndexBytes(indexBytes []byte) (Container, error) { return Container{}, fmt.Errorf("couldn't read from database: %w", err) } var container Container - if _, err := i.codec.Unmarshal(containerBytes, &container); err != nil { + if _, err := Codec.Unmarshal(containerBytes, &container); err != nil { return Container{}, fmt.Errorf("couldn't unmarshal container: %w", err) } return container, nil diff --git a/indexer/index_test.go b/indexer/index_test.go index 5c4c2f196a61..0007c8ae4e12 100644 --- a/indexer/index_test.go +++ b/indexer/index_test.go @@ -8,8 +8,6 @@ import ( "github.com/stretchr/testify/require" - "github.com/ava-labs/avalanchego/codec" - "github.com/ava-labs/avalanchego/codec/linearcodec" "github.com/ava-labs/avalanchego/database/memdb" "github.com/ava-labs/avalanchego/database/versiondb" "github.com/ava-labs/avalanchego/ids" @@ -24,14 +22,12 @@ func TestIndex(t *testing.T) { // Setup pageSize := uint64(64) require := require.New(t) - codec := codec.NewDefaultManager() - require.NoError(codec.RegisterCodec(codecVersion, linearcodec.NewDefault())) baseDB := memdb.New() db := versiondb.New(baseDB) snowCtx := snowtest.Context(t, snowtest.CChainID) ctx := snowtest.ConsensusContext(snowCtx) - idx, err := newIndex(db, logging.NoLog{}, codec, mockable.Clock{}) + idx, err := newIndex(db, logging.NoLog{}, mockable.Clock{}) require.NoError(err) // Populate "containers" with random IDs/bytes @@ -83,7 +79,7 @@ func TestIndex(t *testing.T) { require.NoError(db.Commit()) require.NoError(idx.Close()) db = versiondb.New(baseDB) - idx, err = newIndex(db, logging.NoLog{}, codec, mockable.Clock{}) + idx, err = newIndex(db, logging.NoLog{}, mockable.Clock{}) require.NoError(err) // Get all of the containers @@ -112,12 +108,10 @@ func TestIndex(t *testing.T) { func TestIndexGetContainerByRangeMaxPageSize(t *testing.T) { // Setup require := require.New(t) - codec := codec.NewDefaultManager() - require.NoError(codec.RegisterCodec(codecVersion, linearcodec.NewDefault())) db := memdb.New() snowCtx := snowtest.Context(t, snowtest.CChainID) ctx := snowtest.ConsensusContext(snowCtx) - idx, err := newIndex(db, logging.NoLog{}, codec, mockable.Clock{}) + idx, err := newIndex(db, logging.NoLog{}, mockable.Clock{}) require.NoError(err) // Insert [MaxFetchedByRange] + 1 containers @@ -152,12 +146,10 @@ func TestIndexGetContainerByRangeMaxPageSize(t *testing.T) { func TestDontIndexSameContainerTwice(t *testing.T) { // Setup require := require.New(t) - codec := codec.NewDefaultManager() - require.NoError(codec.RegisterCodec(codecVersion, linearcodec.NewDefault())) db := memdb.New() snowCtx := snowtest.Context(t, snowtest.CChainID) ctx := snowtest.ConsensusContext(snowCtx) - idx, err := newIndex(db, logging.NoLog{}, codec, mockable.Clock{}) + idx, err := newIndex(db, logging.NoLog{}, mockable.Clock{}) require.NoError(err) // Accept the same container twice diff --git a/indexer/indexer.go b/indexer/indexer.go index 8823c184fe14..99f475892562 100644 --- a/indexer/indexer.go +++ b/indexer/indexer.go @@ -6,7 +6,6 @@ package indexer import ( "fmt" "io" - "math" "sync" "github.com/gorilla/rpc/v2" @@ -15,8 +14,6 @@ import ( "github.com/ava-labs/avalanchego/api/server" "github.com/ava-labs/avalanchego/chains" - "github.com/ava-labs/avalanchego/codec" - "github.com/ava-labs/avalanchego/codec/linearcodec" "github.com/ava-labs/avalanchego/database" "github.com/ava-labs/avalanchego/database/prefixdb" "github.com/ava-labs/avalanchego/ids" @@ -32,26 +29,18 @@ import ( ) const ( - indexNamePrefix = "index-" - codecVersion = uint16(0) - // Max size, in bytes, of something serialized by this indexer - // Assumes no containers are larger than math.MaxUint32 - // wrappers.IntLen accounts for the size of the container bytes - // wrappers.LongLen accounts for the timestamp of the container - // ids.IDLen accounts for the container ID - // wrappers.ShortLen accounts for the codec version - codecMaxSize = int(constants.DefaultMaxMessageSize) + wrappers.IntLen + wrappers.LongLen + ids.IDLen + wrappers.ShortLen + indexNamePrefix = "index-" + txPrefix = 0x01 + vtxPrefix = 0x02 + blockPrefix = 0x03 + isIncompletePrefix = 0x04 + previouslyIndexedPrefix = 0x05 ) var ( - txPrefix = byte(0x01) - vtxPrefix = byte(0x02) - blockPrefix = byte(0x03) - isIncompletePrefix = byte(0x04) - previouslyIndexedPrefix = byte(0x05) - hasRunKey = []byte{0x07} - _ Indexer = (*indexer)(nil) + + hasRunKey = []byte{0x07} ) // Config for an indexer @@ -80,7 +69,6 @@ type Indexer interface { // NewIndexer returns a new Indexer and registers a new endpoint on the given API server. func NewIndexer(config Config) (Indexer, error) { indexer := &indexer{ - codec: codec.NewManager(codecMaxSize), log: config.Log, db: config.DB, allowIncompleteIndex: config.AllowIncompleteIndex, @@ -95,12 +83,6 @@ func NewIndexer(config Config) (Indexer, error) { shutdownF: config.ShutdownF, } - if err := indexer.codec.RegisterCodec( - codecVersion, - linearcodec.NewCustomMaxLength(math.MaxUint32), - ); err != nil { - return nil, fmt.Errorf("couldn't register codec: %w", err) - } hasRun, err := indexer.hasRun() if err != nil { return nil, err @@ -110,7 +92,6 @@ func NewIndexer(config Config) (Indexer, error) { } type indexer struct { - codec codec.Manager clock mockable.Clock lock sync.RWMutex log logging.Logger @@ -336,7 +317,7 @@ func (i *indexer) registerChainHelper( copy(prefix, chainID[:]) prefix[ids.IDLen] = prefixEnd indexDB := prefixdb.New(prefix, i.db) - index, err := newIndex(indexDB, i.log, i.codec, i.clock) + index, err := newIndex(indexDB, i.log, i.clock) if err != nil { _ = indexDB.Close() return nil, err diff --git a/indexer/indexer_test.go b/indexer/indexer_test.go index fd5abe1ddc6b..df9bce500eff 100644 --- a/indexer/indexer_test.go +++ b/indexer/indexer_test.go @@ -68,7 +68,6 @@ func TestNewIndexer(t *testing.T) { require.NoError(err) require.IsType(&indexer{}, idxrIntf) idxr := idxrIntf.(*indexer) - require.NotNil(idxr.codec) require.NotNil(idxr.log) require.NotNil(idxr.db) require.False(idxr.closed) diff --git a/snow/engine/avalanche/vertex/builder.go b/snow/engine/avalanche/vertex/builder.go index 34ee26763849..dd83016d7ee6 100644 --- a/snow/engine/avalanche/vertex/builder.go +++ b/snow/engine/avalanche/vertex/builder.go @@ -62,10 +62,10 @@ func buildVtx( utils.Sort(parentIDs) utils.SortByHash(txs) - codecVer := codecVersion + codecVer := CodecVersion if stopVertex { // use new codec version for the "StopVertex" - codecVer = codecVersionWithStopVtx + codecVer = CodecVersionWithStopVtx } innerVtx := innerStatelessVertex{ @@ -80,7 +80,7 @@ func buildVtx( return nil, err } - vtxBytes, err := c.Marshal(innerVtx.Version, innerVtx) + vtxBytes, err := Codec.Marshal(innerVtx.Version, innerVtx) vtx := statelessVertex{ innerStatelessVertex: innerVtx, id: hashing.ComputeHash256Array(vtxBytes), diff --git a/snow/engine/avalanche/vertex/codec.go b/snow/engine/avalanche/vertex/codec.go index 564d699a25e9..65c0ff84cdc2 100644 --- a/snow/engine/avalanche/vertex/codec.go +++ b/snow/engine/avalanche/vertex/codec.go @@ -7,29 +7,30 @@ import ( "github.com/ava-labs/avalanchego/codec" "github.com/ava-labs/avalanchego/codec/linearcodec" "github.com/ava-labs/avalanchego/codec/reflectcodec" + "github.com/ava-labs/avalanchego/utils" "github.com/ava-labs/avalanchego/utils/units" ) const ( + CodecVersion uint16 = 0 + CodecVersionWithStopVtx uint16 = 1 + // maxSize is the maximum allowed vertex size. It is necessary to deter DoS maxSize = units.MiB - - codecVersion uint16 = 0 - codecVersionWithStopVtx uint16 = 1 ) -var c codec.Manager +var Codec codec.Manager func init() { - lc := linearcodec.New([]string{reflectcodec.DefaultTagName + "V0"}, maxSize) - lc2 := linearcodec.New([]string{reflectcodec.DefaultTagName + "V1"}, maxSize) + lc0 := linearcodec.New([]string{reflectcodec.DefaultTagName + "V0"}, maxSize) + lc1 := linearcodec.New([]string{reflectcodec.DefaultTagName + "V1"}, maxSize) - c = codec.NewManager(maxSize) - // for backward compatibility, still register the initial codec version - if err := c.RegisterCodec(codecVersion, lc); err != nil { - panic(err) - } - if err := c.RegisterCodec(codecVersionWithStopVtx, lc2); err != nil { + Codec = codec.NewManager(maxSize) + err := utils.Err( + Codec.RegisterCodec(CodecVersion, lc0), + Codec.RegisterCodec(CodecVersionWithStopVtx, lc1), + ) + if err != nil { panic(err) } } diff --git a/snow/engine/avalanche/vertex/parser.go b/snow/engine/avalanche/vertex/parser.go index cd409c7edc65..f0b7a8aa5571 100644 --- a/snow/engine/avalanche/vertex/parser.go +++ b/snow/engine/avalanche/vertex/parser.go @@ -19,7 +19,7 @@ type Parser interface { // Parse parses the provided vertex bytes into a stateless vertex func Parse(bytes []byte) (StatelessVertex, error) { vtx := innerStatelessVertex{} - version, err := c.Unmarshal(bytes, &vtx) + version, err := Codec.Unmarshal(bytes, &vtx) if err != nil { return nil, err } diff --git a/snow/engine/avalanche/vertex/stateless_vertex.go b/snow/engine/avalanche/vertex/stateless_vertex.go index cef298c9b90f..ca772ed8670a 100644 --- a/snow/engine/avalanche/vertex/stateless_vertex.go +++ b/snow/engine/avalanche/vertex/stateless_vertex.go @@ -73,7 +73,7 @@ func (v statelessVertex) ChainID() ids.ID { } func (v statelessVertex) StopVertex() bool { - return v.innerStatelessVertex.Version == codecVersionWithStopVtx + return v.innerStatelessVertex.Version == CodecVersionWithStopVtx } func (v statelessVertex) Height() uint64 { @@ -102,7 +102,7 @@ type innerStatelessVertex struct { } func (v innerStatelessVertex) Verify() error { - if v.Version == codecVersionWithStopVtx { + if v.Version == CodecVersionWithStopVtx { return v.verifyStopVertex() } return v.verify() @@ -110,7 +110,7 @@ func (v innerStatelessVertex) Verify() error { func (v innerStatelessVertex) verify() error { switch { - case v.Version != codecVersion: + case v.Version != CodecVersion: return errBadVersion case v.Epoch != 0: return errBadEpoch @@ -131,7 +131,7 @@ func (v innerStatelessVertex) verify() error { func (v innerStatelessVertex) verifyStopVertex() error { switch { - case v.Version != codecVersionWithStopVtx: + case v.Version != CodecVersionWithStopVtx: return errBadVersion case v.Epoch != 0: return errBadEpoch diff --git a/vms/components/keystore/codec.go b/vms/components/keystore/codec.go index 5acb1725aa6e..9739dc4328a4 100644 --- a/vms/components/keystore/codec.go +++ b/vms/components/keystore/codec.go @@ -11,12 +11,8 @@ import ( "github.com/ava-labs/avalanchego/utils" ) -const ( - // CodecVersion is the current default codec version - CodecVersion = 0 -) +const CodecVersion = 0 -// Codecs do serialization and deserialization var ( Codec codec.Manager LegacyCodec codec.Manager diff --git a/vms/components/message/codec.go b/vms/components/message/codec.go index 3a5eee5416ca..db47a18fc9a5 100644 --- a/vms/components/message/codec.go +++ b/vms/components/message/codec.go @@ -11,21 +11,21 @@ import ( ) const ( - codecVersion = 0 + CodecVersion = 0 + maxMessageSize = 512 * units.KiB maxSliceLen = maxMessageSize ) -// Codec does serialization and deserialization -var c codec.Manager +var Codec codec.Manager func init() { - c = codec.NewManager(maxMessageSize) + Codec = codec.NewManager(maxMessageSize) lc := linearcodec.NewCustomMaxLength(maxSliceLen) err := utils.Err( lc.RegisterType(&Tx{}), - c.RegisterCodec(codecVersion, lc), + Codec.RegisterCodec(CodecVersion, lc), ) if err != nil { panic(err) diff --git a/vms/components/message/message.go b/vms/components/message/message.go index 009cf67f4884..f0e13aab3d10 100644 --- a/vms/components/message/message.go +++ b/vms/components/message/message.go @@ -65,11 +65,11 @@ func Parse(bytes []byte) (Message, error) { // It must have been encoded with avalanchego's codec. // TODO remove else statement remove once all nodes support proto encoding. // i.e. when all nodes are on v1.11.0 or later. - version, err := c.Unmarshal(bytes, &msg) + version, err := Codec.Unmarshal(bytes, &msg) if err != nil { return nil, err } - if version != codecVersion { + if version != CodecVersion { return nil, ErrUnexpectedCodecVersion } } @@ -78,7 +78,7 @@ func Parse(bytes []byte) (Message, error) { } func Build(msg Message) ([]byte, error) { - bytes, err := c.Marshal(codecVersion, &msg) + bytes, err := Codec.Marshal(CodecVersion, &msg) msg.initialize(bytes) return bytes, err } diff --git a/vms/example/xsvm/api/client.go b/vms/example/xsvm/api/client.go index 785b092faed1..d8d6a94f1b4b 100644 --- a/vms/example/xsvm/api/client.go +++ b/vms/example/xsvm/api/client.go @@ -170,7 +170,7 @@ func (c *client) IssueTx( newTx *tx.Tx, options ...rpc.Option, ) (ids.ID, error) { - txBytes, err := tx.Codec.Marshal(tx.Version, newTx) + txBytes, err := tx.Codec.Marshal(tx.CodecVersion, newTx) if err != nil { return ids.Empty, err } diff --git a/vms/example/xsvm/block/block.go b/vms/example/xsvm/block/block.go index 2db314ea1a5a..fee3c801de2f 100644 --- a/vms/example/xsvm/block/block.go +++ b/vms/example/xsvm/block/block.go @@ -26,7 +26,7 @@ func (b *Stateless) Time() time.Time { } func (b *Stateless) ID() (ids.ID, error) { - bytes, err := Codec.Marshal(Version, b) + bytes, err := Codec.Marshal(CodecVersion, b) return hashing.ComputeHash256Array(bytes), err } diff --git a/vms/example/xsvm/block/codec.go b/vms/example/xsvm/block/codec.go index 0ffbc98d58e7..0edbcaee5302 100644 --- a/vms/example/xsvm/block/codec.go +++ b/vms/example/xsvm/block/codec.go @@ -5,7 +5,6 @@ package block import "github.com/ava-labs/avalanchego/vms/example/xsvm/tx" -// Version is the current default codec version -const Version = tx.Version +const CodecVersion = tx.CodecVersion var Codec = tx.Codec diff --git a/vms/example/xsvm/chain/chain.go b/vms/example/xsvm/chain/chain.go index ef6a59de2dbb..954cd3729291 100644 --- a/vms/example/xsvm/chain/chain.go +++ b/vms/example/xsvm/chain/chain.go @@ -80,7 +80,7 @@ func (c *chain) NewBlock(blk *xsblock.Stateless) (Block, error) { return blk, nil } - blkBytes, err := xsblock.Codec.Marshal(xsblock.Version, blk) + blkBytes, err := xsblock.Codec.Marshal(xsblock.CodecVersion, blk) if err != nil { return nil, err } diff --git a/vms/example/xsvm/cmd/chain/create/cmd.go b/vms/example/xsvm/cmd/chain/create/cmd.go index 1f00491a4ce6..e562c8567b06 100644 --- a/vms/example/xsvm/cmd/chain/create/cmd.go +++ b/vms/example/xsvm/cmd/chain/create/cmd.go @@ -55,7 +55,7 @@ func createFunc(c *cobra.Command, args []string) error { // Get the P-chain wallet pWallet := wallet.P() - genesisBytes, err := genesis.Codec.Marshal(genesis.Version, &genesis.Genesis{ + genesisBytes, err := genesis.Codec.Marshal(genesis.CodecVersion, &genesis.Genesis{ Timestamp: 0, Allocations: []genesis.Allocation{ { diff --git a/vms/example/xsvm/cmd/chain/genesis/cmd.go b/vms/example/xsvm/cmd/chain/genesis/cmd.go index ae18e1db85e3..8ef49baa77ab 100644 --- a/vms/example/xsvm/cmd/chain/genesis/cmd.go +++ b/vms/example/xsvm/cmd/chain/genesis/cmd.go @@ -34,7 +34,7 @@ func genesisFunc(c *cobra.Command, args []string) error { return err } - genesisBytes, err := genesis.Codec.Marshal(genesis.Version, config.Genesis) + genesisBytes, err := genesis.Codec.Marshal(genesis.CodecVersion, config.Genesis) if err != nil { return err } diff --git a/vms/example/xsvm/execute/block.go b/vms/example/xsvm/execute/block.go index dc9de45af19e..3d51c64abaa2 100644 --- a/vms/example/xsvm/execute/block.go +++ b/vms/example/xsvm/execute/block.go @@ -62,7 +62,7 @@ func Block( return err } - blkBytes, err := xsblock.Codec.Marshal(xsblock.Version, blk) + blkBytes, err := xsblock.Codec.Marshal(xsblock.CodecVersion, blk) if err != nil { return err } diff --git a/vms/example/xsvm/execute/genesis.go b/vms/example/xsvm/execute/genesis.go index 312a7bd0b73c..c0a44e2ef6bb 100644 --- a/vms/example/xsvm/execute/genesis.go +++ b/vms/example/xsvm/execute/genesis.go @@ -36,7 +36,7 @@ func Genesis(db database.KeyValueReaderWriterDeleter, chainID ids.ID, g *genesis return err } - blkBytes, err := block.Codec.Marshal(block.Version, blk) + blkBytes, err := block.Codec.Marshal(block.CodecVersion, blk) if err != nil { return err } diff --git a/vms/example/xsvm/genesis/codec.go b/vms/example/xsvm/genesis/codec.go index 6ef652864574..3533e29a0188 100644 --- a/vms/example/xsvm/genesis/codec.go +++ b/vms/example/xsvm/genesis/codec.go @@ -5,7 +5,6 @@ package genesis import "github.com/ava-labs/avalanchego/vms/example/xsvm/block" -// Version is the current default codec version -const Version = block.Version +const CodecVersion = block.CodecVersion var Codec = block.Codec diff --git a/vms/example/xsvm/genesis/genesis.go b/vms/example/xsvm/genesis/genesis.go index e8580ffef7f6..fddc96716bd6 100644 --- a/vms/example/xsvm/genesis/genesis.go +++ b/vms/example/xsvm/genesis/genesis.go @@ -26,7 +26,7 @@ func Parse(bytes []byte) (*Genesis, error) { } func Block(genesis *Genesis) (*block.Stateless, error) { - bytes, err := Codec.Marshal(Version, genesis) + bytes, err := Codec.Marshal(CodecVersion, genesis) if err != nil { return nil, err } diff --git a/vms/example/xsvm/genesis/genesis_test.go b/vms/example/xsvm/genesis/genesis_test.go index 511c5c9b0b8b..f15e72ecc743 100644 --- a/vms/example/xsvm/genesis/genesis_test.go +++ b/vms/example/xsvm/genesis/genesis_test.go @@ -26,7 +26,7 @@ func TestGenesis(t *testing.T) { {Address: id2, Balance: 3000000000}, }, } - bytes, err := Codec.Marshal(Version, genesis) + bytes, err := Codec.Marshal(CodecVersion, genesis) require.NoError(err) parsed, err := Parse(bytes) diff --git a/vms/example/xsvm/tx/codec.go b/vms/example/xsvm/tx/codec.go index c91a2165f1f6..1f8b8fc9dd0e 100644 --- a/vms/example/xsvm/tx/codec.go +++ b/vms/example/xsvm/tx/codec.go @@ -11,8 +11,7 @@ import ( "github.com/ava-labs/avalanchego/utils" ) -// Version is the current default codec version -const Version = 0 +const CodecVersion = 0 var Codec codec.Manager @@ -24,7 +23,7 @@ func init() { c.RegisterType(&Transfer{}), c.RegisterType(&Export{}), c.RegisterType(&Import{}), - Codec.RegisterCodec(Version, c), + Codec.RegisterCodec(CodecVersion, c), ) if err != nil { panic(err) diff --git a/vms/example/xsvm/tx/payload.go b/vms/example/xsvm/tx/payload.go index e93e5f560ac5..0d1671535c9d 100644 --- a/vms/example/xsvm/tx/payload.go +++ b/vms/example/xsvm/tx/payload.go @@ -34,7 +34,7 @@ func NewPayload( Amount: amount, To: to, } - bytes, err := Codec.Marshal(Version, p) + bytes, err := Codec.Marshal(CodecVersion, p) p.bytes = bytes return p, err } diff --git a/vms/example/xsvm/tx/tx.go b/vms/example/xsvm/tx/tx.go index fae58bae0806..05beec274cb4 100644 --- a/vms/example/xsvm/tx/tx.go +++ b/vms/example/xsvm/tx/tx.go @@ -28,7 +28,7 @@ func Parse(bytes []byte) (*Tx, error) { } func Sign(utx Unsigned, key *secp256k1.PrivateKey) (*Tx, error) { - unsignedBytes, err := Codec.Marshal(Version, &utx) + unsignedBytes, err := Codec.Marshal(CodecVersion, &utx) if err != nil { return nil, err } @@ -46,12 +46,12 @@ func Sign(utx Unsigned, key *secp256k1.PrivateKey) (*Tx, error) { } func (tx *Tx) ID() (ids.ID, error) { - bytes, err := Codec.Marshal(Version, tx) + bytes, err := Codec.Marshal(CodecVersion, tx) return hashing.ComputeHash256Array(bytes), err } func (tx *Tx) SenderID() (ids.ShortID, error) { - unsignedBytes, err := Codec.Marshal(Version, &tx.Unsigned) + unsignedBytes, err := Codec.Marshal(CodecVersion, &tx.Unsigned) if err != nil { return ids.ShortEmpty, err } diff --git a/vms/platformvm/api/static_service.go b/vms/platformvm/api/static_service.go index 7f37b247b34b..dea7ce656aa9 100644 --- a/vms/platformvm/api/static_service.go +++ b/vms/platformvm/api/static_service.go @@ -390,7 +390,7 @@ func (*StaticService) BuildGenesis(_ *http.Request, args *BuildGenesisArgs, repl } // Marshal genesis to bytes - bytes, err := genesis.Codec.Marshal(genesis.Version, g) + bytes, err := genesis.Codec.Marshal(genesis.CodecVersion, g) if err != nil { return fmt.Errorf("couldn't marshal genesis: %w", err) } diff --git a/vms/platformvm/block/block.go b/vms/platformvm/block/block.go index 5cdc3a90dbc0..dd9c61e4ce9c 100644 --- a/vms/platformvm/block/block.go +++ b/vms/platformvm/block/block.go @@ -39,7 +39,7 @@ type BanffBlock interface { func initialize(blk Block, commonBlk *CommonBlock) error { // We serialize this block as a pointer so that it can be deserialized into // a Block - bytes, err := Codec.Marshal(Version, &blk) + bytes, err := Codec.Marshal(CodecVersion, &blk) if err != nil { return fmt.Errorf("couldn't marshal block: %w", err) } diff --git a/vms/platformvm/block/builder/standard_block_test.go b/vms/platformvm/block/builder/standard_block_test.go index cdfe27d662ad..8e94a0791fbd 100644 --- a/vms/platformvm/block/builder/standard_block_test.go +++ b/vms/platformvm/block/builder/standard_block_test.go @@ -51,7 +51,7 @@ func TestAtomicTxImports(t *testing.T) { }, }, } - utxoBytes, err := txs.Codec.Marshal(txs.Version, utxo) + utxoBytes, err := txs.Codec.Marshal(txs.CodecVersion, utxo) require.NoError(err) inputID := utxo.InputID() diff --git a/vms/platformvm/block/codec.go b/vms/platformvm/block/codec.go index 1034ee9f759a..7a730e2720de 100644 --- a/vms/platformvm/block/codec.go +++ b/vms/platformvm/block/codec.go @@ -13,8 +13,7 @@ import ( "github.com/ava-labs/avalanchego/vms/platformvm/txs" ) -// Version is the current default codec version -const Version = txs.Version +const CodecVersion = txs.CodecVersion // GenesisCode allows blocks of larger than usual size to be parsed. // While this gives flexibility in accommodating large genesis blocks @@ -41,8 +40,8 @@ func init() { ) } errs.Add( - Codec.RegisterCodec(Version, c), - GenesisCodec.RegisterCodec(Version, gc), + Codec.RegisterCodec(CodecVersion, c), + GenesisCodec.RegisterCodec(CodecVersion, gc), ) if errs.Errored() { panic(errs.Err) diff --git a/vms/platformvm/block/serialization_test.go b/vms/platformvm/block/serialization_test.go index bfa08684e6f0..2d936d35e00e 100644 --- a/vms/platformvm/block/serialization_test.go +++ b/vms/platformvm/block/serialization_test.go @@ -113,7 +113,7 @@ func TestBanffBlockSerialization(t *testing.T) { t.Run(testName, func(t *testing.T) { require := require.New(t) - got, err := Codec.Marshal(Version, &block) + got, err := Codec.Marshal(CodecVersion, &block) require.NoError(err) require.Equal(test.bytes, got) }) diff --git a/vms/platformvm/genesis/codec.go b/vms/platformvm/genesis/codec.go index 7b68ac58d634..f8cbe110bf07 100644 --- a/vms/platformvm/genesis/codec.go +++ b/vms/platformvm/genesis/codec.go @@ -5,6 +5,6 @@ package genesis import "github.com/ava-labs/avalanchego/vms/platformvm/block" -const Version = block.Version +const CodecVersion = block.CodecVersion var Codec = block.GenesisCodec diff --git a/vms/platformvm/service.go b/vms/platformvm/service.go index 6331e72a2acc..8326f0fbff8b 100644 --- a/vms/platformvm/service.go +++ b/vms/platformvm/service.go @@ -489,7 +489,7 @@ func (s *Service) GetUTXOs(_ *http.Request, args *api.GetUTXOsArgs, response *ap response.UTXOs = make([]string, len(utxos)) for i, utxo := range utxos { - bytes, err := txs.Codec.Marshal(txs.Version, utxo) + bytes, err := txs.Codec.Marshal(txs.CodecVersion, utxo) if err != nil { return fmt.Errorf("couldn't serialize UTXO %q: %w", utxo.InputID(), err) } @@ -2426,7 +2426,7 @@ func (s *Service) GetStake(_ *http.Request, args *GetStakeArgs, response *GetSta response.Staked = response.Stakeds[s.vm.ctx.AVAXAssetID] response.Outputs = make([]string, len(stakedOuts)) for i, output := range stakedOuts { - bytes, err := txs.Codec.Marshal(txs.Version, output) + bytes, err := txs.Codec.Marshal(txs.CodecVersion, output) if err != nil { return fmt.Errorf("couldn't serialize output %s: %w", output.ID, err) } @@ -2608,7 +2608,7 @@ func (s *Service) GetRewardUTXOs(_ *http.Request, args *api.GetTxArgs, reply *Ge reply.NumFetched = json.Uint64(len(utxos)) reply.UTXOs = make([]string, len(utxos)) for i, utxo := range utxos { - utxoBytes, err := txs.GenesisCodec.Marshal(txs.Version, utxo) + utxoBytes, err := txs.GenesisCodec.Marshal(txs.CodecVersion, utxo) if err != nil { return fmt.Errorf("couldn't encode UTXO to bytes: %w", err) } diff --git a/vms/platformvm/service_test.go b/vms/platformvm/service_test.go index de0c16718b9a..d80aeb5726b2 100644 --- a/vms/platformvm/service_test.go +++ b/vms/platformvm/service_test.go @@ -199,7 +199,7 @@ func TestGetTxStatus(t *testing.T) { }, }, } - utxoBytes, err := txs.Codec.Marshal(txs.Version, utxo) + utxoBytes, err := txs.Codec.Marshal(txs.CodecVersion, utxo) require.NoError(err) inputID := utxo.InputID() diff --git a/vms/platformvm/state/metadata_codec.go b/vms/platformvm/state/metadata_codec.go index 50b3988c7d75..291d425c67bb 100644 --- a/vms/platformvm/state/metadata_codec.go +++ b/vms/platformvm/state/metadata_codec.go @@ -12,23 +12,23 @@ import ( ) const ( - v0tag = "v0" - v0 = uint16(0) + CodecVersion0Tag = "v0" + CodecVersion0 uint16 = 0 - v1tag = "v1" - v1 = uint16(1) + CodecVersion1Tag = "v1" + CodecVersion1 uint16 = 1 ) -var metadataCodec codec.Manager +var MetadataCodec codec.Manager func init() { - c0 := linearcodec.New([]string{v0tag}, math.MaxInt32) - c1 := linearcodec.New([]string{v0tag, v1tag}, math.MaxInt32) - metadataCodec = codec.NewManager(math.MaxInt32) + c0 := linearcodec.New([]string{CodecVersion0Tag}, math.MaxInt32) + c1 := linearcodec.New([]string{CodecVersion0Tag, CodecVersion1Tag}, math.MaxInt32) + MetadataCodec = codec.NewManager(math.MaxInt32) err := utils.Err( - metadataCodec.RegisterCodec(v0, c0), - metadataCodec.RegisterCodec(v1, c1), + MetadataCodec.RegisterCodec(CodecVersion0, c0), + MetadataCodec.RegisterCodec(CodecVersion1, c1), ) if err != nil { panic(err) diff --git a/vms/platformvm/state/metadata_delegator.go b/vms/platformvm/state/metadata_delegator.go index 852cbe607408..9e9ed42d2108 100644 --- a/vms/platformvm/state/metadata_delegator.go +++ b/vms/platformvm/state/metadata_delegator.go @@ -22,7 +22,7 @@ func parseDelegatorMetadata(bytes []byte, metadata *delegatorMetadata) error { // only potential reward was stored metadata.PotentialReward, err = database.ParseUInt64(bytes) default: - _, err = metadataCodec.Unmarshal(bytes, metadata) + _, err = MetadataCodec.Unmarshal(bytes, metadata) } return err } @@ -36,7 +36,7 @@ func writeDelegatorMetadata(db database.KeyValueWriter, metadata *delegatorMetad if codecVersion == 0 { return database.PutUInt64(db, metadata.txID[:], metadata.PotentialReward) } - metadataBytes, err := metadataCodec.Marshal(codecVersion, metadata) + metadataBytes, err := MetadataCodec.Marshal(codecVersion, metadata) if err != nil { return err } diff --git a/vms/platformvm/state/metadata_delegator_test.go b/vms/platformvm/state/metadata_delegator_test.go index 889854d313a2..67eceb62ad10 100644 --- a/vms/platformvm/state/metadata_delegator_test.go +++ b/vms/platformvm/state/metadata_delegator_test.go @@ -99,8 +99,8 @@ func TestWriteDelegatorMetadata(t *testing.T) { } tests := []test{ { - name: "v0", - version: v0, + name: CodecVersion0Tag, + version: CodecVersion0, metadata: &delegatorMetadata{ PotentialReward: 123, StakerStartTime: 456, @@ -111,8 +111,8 @@ func TestWriteDelegatorMetadata(t *testing.T) { }, }, { - name: "v1", - version: v1, + name: CodecVersion1Tag, + version: CodecVersion1, metadata: &delegatorMetadata{ PotentialReward: 123, StakerStartTime: 456, diff --git a/vms/platformvm/state/metadata_validator.go b/vms/platformvm/state/metadata_validator.go index ed62b723eeac..84704cb7a5b7 100644 --- a/vms/platformvm/state/metadata_validator.go +++ b/vms/platformvm/state/metadata_validator.go @@ -59,7 +59,7 @@ func parseValidatorMetadata(bytes []byte, metadata *validatorMetadata) error { // potential reward and uptime was stored but potential delegatee reward // was not tmp := preDelegateeRewardMetadata{} - if _, err := metadataCodec.Unmarshal(bytes, &tmp); err != nil { + if _, err := MetadataCodec.Unmarshal(bytes, &tmp); err != nil { return err } @@ -68,7 +68,7 @@ func parseValidatorMetadata(bytes []byte, metadata *validatorMetadata) error { metadata.PotentialReward = tmp.PotentialReward default: // everything was stored - if _, err := metadataCodec.Unmarshal(bytes, metadata); err != nil { + if _, err := MetadataCodec.Unmarshal(bytes, metadata); err != nil { return err } } @@ -239,7 +239,7 @@ func (m *metadata) WriteValidatorMetadata( metadata := m.metadata[vdrID][subnetID] metadata.LastUpdated = uint64(metadata.lastUpdated.Unix()) - metadataBytes, err := metadataCodec.Marshal(codecVersion, metadata) + metadataBytes, err := MetadataCodec.Marshal(codecVersion, metadata) if err != nil { return err } diff --git a/vms/platformvm/state/metadata_validator_test.go b/vms/platformvm/state/metadata_validator_test.go index 67ba494a88f7..bb5cf6a5bd08 100644 --- a/vms/platformvm/state/metadata_validator_test.go +++ b/vms/platformvm/state/metadata_validator_test.go @@ -82,9 +82,8 @@ func TestWriteValidatorMetadata(t *testing.T) { primaryDB := memdb.New() subnetDB := memdb.New() - codecVersion := v1 // write empty uptimes - require.NoError(state.WriteValidatorMetadata(primaryDB, subnetDB, codecVersion)) + require.NoError(state.WriteValidatorMetadata(primaryDB, subnetDB, CodecVersion1)) // load uptime nodeID := ids.GenerateTestNodeID() @@ -98,7 +97,7 @@ func TestWriteValidatorMetadata(t *testing.T) { state.LoadValidatorMetadata(nodeID, subnetID, testUptimeReward) // write state, should not reflect to DB yet - require.NoError(state.WriteValidatorMetadata(primaryDB, subnetDB, codecVersion)) + require.NoError(state.WriteValidatorMetadata(primaryDB, subnetDB, CodecVersion1)) require.False(primaryDB.Has(testUptimeReward.txID[:])) require.False(subnetDB.Has(testUptimeReward.txID[:])) @@ -114,7 +113,7 @@ func TestWriteValidatorMetadata(t *testing.T) { require.NoError(state.SetUptime(nodeID, subnetID, newUpDuration, newLastUpdated)) // write uptimes, should reflect to subnet DB - require.NoError(state.WriteValidatorMetadata(primaryDB, subnetDB, codecVersion)) + require.NoError(state.WriteValidatorMetadata(primaryDB, subnetDB, CodecVersion1)) require.False(primaryDB.Has(testUptimeReward.txID[:])) require.True(subnetDB.Has(testUptimeReward.txID[:])) } diff --git a/vms/platformvm/state/state.go b/vms/platformvm/state/state.go index b6f0218128ce..2c7785e8d5c7 100644 --- a/vms/platformvm/state/state.go +++ b/vms/platformvm/state/state.go @@ -1190,7 +1190,7 @@ func (s *state) ApplyValidatorWeightDiffs( Height: height, SubnetID: subnetID, } - prefixBytes, err := block.GenesisCodec.Marshal(block.Version, prefixStruct) + prefixBytes, err := block.GenesisCodec.Marshal(block.CodecVersion, prefixStruct) if err != nil { return err } @@ -1735,9 +1735,9 @@ func (s *state) initValidatorSets() error { } func (s *state) write(updateValidators bool, height uint64) error { - codecVersion := v1 + codecVersion := CodecVersion1 if !s.cfg.IsDurangoActivated(s.GetTimestamp()) { - codecVersion = v0 + codecVersion = CodecVersion0 } return utils.Err( @@ -1990,7 +1990,7 @@ func (s *state) writeCurrentStakers(updateValidators bool, height uint64, codecV Height: height, SubnetID: subnetID, } - prefixBytes, err := block.GenesisCodec.Marshal(block.Version, prefixStruct) + prefixBytes, err := block.GenesisCodec.Marshal(block.CodecVersion, prefixStruct) if err != nil { return fmt.Errorf("failed to create prefix bytes: %w", err) } @@ -2041,7 +2041,7 @@ func (s *state) writeCurrentStakers(updateValidators bool, height uint64, codecV PotentialDelegateeReward: 0, } - metadataBytes, err := metadataCodec.Marshal(codecVersion, metadata) + metadataBytes, err := MetadataCodec.Marshal(codecVersion, metadata) if err != nil { return fmt.Errorf("failed to serialize current validator: %w", err) } @@ -2114,7 +2114,7 @@ func (s *state) writeCurrentStakers(updateValidators bool, height uint64, codecV } // TODO: Remove this once we no longer support version rollbacks. - weightDiffBytes, err := block.GenesisCodec.Marshal(block.Version, weightDiff) + weightDiffBytes, err := block.GenesisCodec.Marshal(block.CodecVersion, weightDiff) if err != nil { return fmt.Errorf("failed to serialize validator weight diff: %w", err) } @@ -2275,7 +2275,7 @@ func (s *state) writeTXs() error { // Note that we're serializing a [txBytesAndStatus] here, not a // *txs.Tx, so we don't use [txs.Codec]. - txBytes, err := txs.GenesisCodec.Marshal(txs.Version, &stx) + txBytes, err := txs.GenesisCodec.Marshal(txs.CodecVersion, &stx) if err != nil { return fmt.Errorf("failed to serialize tx: %w", err) } @@ -2300,7 +2300,7 @@ func (s *state) writeRewardUTXOs() error { txDB := linkeddb.NewDefault(rawTxDB) for _, utxo := range utxos { - utxoBytes, err := txs.GenesisCodec.Marshal(txs.Version, utxo) + utxoBytes, err := txs.GenesisCodec.Marshal(txs.CodecVersion, utxo) if err != nil { return fmt.Errorf("failed to serialize reward UTXO: %w", err) } @@ -2348,7 +2348,7 @@ func (s *state) writeSubnetOwners() error { owner := owner delete(s.subnetOwners, subnetID) - ownerBytes, err := block.GenesisCodec.Marshal(block.Version, &owner) + ownerBytes, err := block.GenesisCodec.Marshal(block.CodecVersion, &owner) if err != nil { return fmt.Errorf("failed to marshal subnet owner: %w", err) } @@ -2429,7 +2429,7 @@ func (s *state) writeMetadata() error { } if s.indexedHeights != nil { - indexedHeightsBytes, err := block.GenesisCodec.Marshal(block.Version, s.indexedHeights) + indexedHeightsBytes, err := block.GenesisCodec.Marshal(block.CodecVersion, s.indexedHeights) if err != nil { return err } diff --git a/vms/platformvm/state/state_test.go b/vms/platformvm/state/state_test.go index 0f87a6f90b00..8adcbba07a4b 100644 --- a/vms/platformvm/state/state_test.go +++ b/vms/platformvm/state/state_test.go @@ -649,7 +649,7 @@ func TestParsedStateBlock(t *testing.T) { Status: choices.Accepted, } - stBlkBytes, err := block.GenesisCodec.Marshal(block.Version, &stBlk) + stBlkBytes, err := block.GenesisCodec.Marshal(block.CodecVersion, &stBlk) require.NoError(err) gotBlk, _, isStateBlk, err := parseStoredBlock(stBlkBytes) diff --git a/vms/platformvm/txs/add_permissionless_delegator_tx_test.go b/vms/platformvm/txs/add_permissionless_delegator_tx_test.go index c70bf720bfe3..79a91c16e485 100644 --- a/vms/platformvm/txs/add_permissionless_delegator_tx_test.go +++ b/vms/platformvm/txs/add_permissionless_delegator_tx_test.go @@ -216,7 +216,7 @@ func TestAddPermissionlessPrimaryDelegatorSerialization(t *testing.T) { 0x44, 0x55, 0x66, 0x77, } var unsignedSimpleAddPrimaryTx UnsignedTx = simpleAddPrimaryTx - unsignedSimpleAddPrimaryTxBytes, err := Codec.Marshal(Version, &unsignedSimpleAddPrimaryTx) + unsignedSimpleAddPrimaryTxBytes, err := Codec.Marshal(CodecVersion, &unsignedSimpleAddPrimaryTx) require.NoError(err) require.Equal(expectedUnsignedSimpleAddPrimaryTxBytes, unsignedSimpleAddPrimaryTxBytes) @@ -599,7 +599,7 @@ func TestAddPermissionlessPrimaryDelegatorSerialization(t *testing.T) { 0x00, 0x00, 0x00, 0x00, } var unsignedComplexAddPrimaryTx UnsignedTx = complexAddPrimaryTx - unsignedComplexAddPrimaryTxBytes, err := Codec.Marshal(Version, &unsignedComplexAddPrimaryTx) + unsignedComplexAddPrimaryTxBytes, err := Codec.Marshal(CodecVersion, &unsignedComplexAddPrimaryTx) require.NoError(err) require.Equal(expectedUnsignedComplexAddPrimaryTxBytes, unsignedComplexAddPrimaryTxBytes) @@ -972,7 +972,7 @@ func TestAddPermissionlessSubnetDelegatorSerialization(t *testing.T) { 0x44, 0x55, 0x66, 0x77, } var unsignedSimpleAddSubnetTx UnsignedTx = simpleAddSubnetTx - unsignedSimpleAddSubnetTxBytes, err := Codec.Marshal(Version, &unsignedSimpleAddSubnetTx) + unsignedSimpleAddSubnetTxBytes, err := Codec.Marshal(CodecVersion, &unsignedSimpleAddSubnetTx) require.NoError(err) require.Equal(expectedUnsignedSimpleAddSubnetTxBytes, unsignedSimpleAddSubnetTxBytes) @@ -1355,7 +1355,7 @@ func TestAddPermissionlessSubnetDelegatorSerialization(t *testing.T) { 0x00, 0x00, 0x00, 0x00, } var unsignedComplexAddSubnetTx UnsignedTx = complexAddSubnetTx - unsignedComplexAddSubnetTxBytes, err := Codec.Marshal(Version, &unsignedComplexAddSubnetTx) + unsignedComplexAddSubnetTxBytes, err := Codec.Marshal(CodecVersion, &unsignedComplexAddSubnetTx) require.NoError(err) require.Equal(expectedUnsignedComplexAddSubnetTxBytes, unsignedComplexAddSubnetTxBytes) diff --git a/vms/platformvm/txs/add_permissionless_validator_tx_test.go b/vms/platformvm/txs/add_permissionless_validator_tx_test.go index 80e4d3b6ae93..aed095b16af9 100644 --- a/vms/platformvm/txs/add_permissionless_validator_tx_test.go +++ b/vms/platformvm/txs/add_permissionless_validator_tx_test.go @@ -267,7 +267,7 @@ func TestAddPermissionlessPrimaryValidator(t *testing.T) { 0x00, 0x0f, 0x42, 0x40, } var unsignedSimpleAddPrimaryTx UnsignedTx = simpleAddPrimaryTx - unsignedSimpleAddPrimaryTxBytes, err := Codec.Marshal(Version, &unsignedSimpleAddPrimaryTx) + unsignedSimpleAddPrimaryTxBytes, err := Codec.Marshal(CodecVersion, &unsignedSimpleAddPrimaryTx) require.NoError(err) require.Equal(expectedUnsignedSimpleAddPrimaryTxBytes, unsignedSimpleAddPrimaryTxBytes) @@ -695,7 +695,7 @@ func TestAddPermissionlessPrimaryValidator(t *testing.T) { 0x00, 0x0f, 0x42, 0x40, } var unsignedComplexAddPrimaryTx UnsignedTx = complexAddPrimaryTx - unsignedComplexAddPrimaryTxBytes, err := Codec.Marshal(Version, &unsignedComplexAddPrimaryTx) + unsignedComplexAddPrimaryTxBytes, err := Codec.Marshal(CodecVersion, &unsignedComplexAddPrimaryTx) require.NoError(err) require.Equal(expectedUnsignedComplexAddPrimaryTxBytes, unsignedComplexAddPrimaryTxBytes) } @@ -954,7 +954,7 @@ func TestAddPermissionlessSubnetValidator(t *testing.T) { 0x00, 0x0f, 0x42, 0x40, } var unsignedSimpleAddSubnetTx UnsignedTx = simpleAddSubnetTx - unsignedSimpleAddSubnetTxBytes, err := Codec.Marshal(Version, &unsignedSimpleAddSubnetTx) + unsignedSimpleAddSubnetTxBytes, err := Codec.Marshal(CodecVersion, &unsignedSimpleAddSubnetTx) require.NoError(err) require.Equal(expectedUnsignedSimpleAddSubnetTxBytes, unsignedSimpleAddSubnetTxBytes) @@ -1362,7 +1362,7 @@ func TestAddPermissionlessSubnetValidator(t *testing.T) { 0x00, 0x0f, 0x42, 0x40, } var unsignedComplexAddSubnetTx UnsignedTx = complexAddSubnetTx - unsignedComplexAddSubnetTxBytes, err := Codec.Marshal(Version, &unsignedComplexAddSubnetTx) + unsignedComplexAddSubnetTxBytes, err := Codec.Marshal(CodecVersion, &unsignedComplexAddSubnetTx) require.NoError(err) require.Equal(expectedUnsignedComplexAddSubnetTxBytes, unsignedComplexAddSubnetTxBytes) } diff --git a/vms/platformvm/txs/add_subnet_validator_test.go b/vms/platformvm/txs/add_subnet_validator_test.go index e5f0684b25d7..c1f68cb664c1 100644 --- a/vms/platformvm/txs/add_subnet_validator_test.go +++ b/vms/platformvm/txs/add_subnet_validator_test.go @@ -201,7 +201,7 @@ func TestAddSubnetValidatorMarshal(t *testing.T) { require.NoError(err) require.NoError(stx.SyntacticVerify(ctx)) - txBytes, err := Codec.Marshal(Version, stx) + txBytes, err := Codec.Marshal(CodecVersion, stx) require.NoError(err) parsedTx, err := Parse(Codec, txBytes) diff --git a/vms/platformvm/txs/base_tx_test.go b/vms/platformvm/txs/base_tx_test.go index c6cba1570312..7c2dc3ad5208 100644 --- a/vms/platformvm/txs/base_tx_test.go +++ b/vms/platformvm/txs/base_tx_test.go @@ -118,7 +118,7 @@ func TestBaseTxSerialization(t *testing.T) { 0x00, 0x00, 0x00, 0x00, } var unsignedSimpleBaseTx UnsignedTx = simpleBaseTx - unsignedSimpleBaseTxBytes, err := Codec.Marshal(Version, &unsignedSimpleBaseTx) + unsignedSimpleBaseTxBytes, err := Codec.Marshal(CodecVersion, &unsignedSimpleBaseTx) require.NoError(err) require.Equal(expectedUnsignedSimpleBaseTxBytes, unsignedSimpleBaseTxBytes) @@ -358,7 +358,7 @@ func TestBaseTxSerialization(t *testing.T) { 0x01, 0x23, 0x45, 0x21, } var unsignedComplexBaseTx UnsignedTx = complexBaseTx - unsignedComplexBaseTxBytes, err := Codec.Marshal(Version, &unsignedComplexBaseTx) + unsignedComplexBaseTxBytes, err := Codec.Marshal(CodecVersion, &unsignedComplexBaseTx) require.NoError(err) require.Equal(expectedUnsignedComplexBaseTxBytes, unsignedComplexBaseTxBytes) diff --git a/vms/platformvm/txs/codec.go b/vms/platformvm/txs/codec.go index d743376d1acb..0d011f246546 100644 --- a/vms/platformvm/txs/codec.go +++ b/vms/platformvm/txs/codec.go @@ -15,8 +15,7 @@ import ( "github.com/ava-labs/avalanchego/vms/secp256k1fx" ) -// Version is the current default codec version -const Version = 0 +const CodecVersion = 0 var ( Codec codec.Manager @@ -48,8 +47,8 @@ func init() { errs.Add(RegisterDUnsignedTxsTypes(c)) } errs.Add( - Codec.RegisterCodec(Version, c), - GenesisCodec.RegisterCodec(Version, gc), + Codec.RegisterCodec(CodecVersion, c), + GenesisCodec.RegisterCodec(CodecVersion, gc), ) if errs.Errored() { panic(errs.Err) diff --git a/vms/platformvm/txs/executor/advance_time_test.go b/vms/platformvm/txs/executor/advance_time_test.go index 55cc49e4350b..9db644f4c1be 100644 --- a/vms/platformvm/txs/executor/advance_time_test.go +++ b/vms/platformvm/txs/executor/advance_time_test.go @@ -909,7 +909,7 @@ func TestAdvanceTimeTxUnmarshal(t *testing.T) { tx, err := env.txBuilder.NewAdvanceTimeTx(chainTime.Add(time.Second)) require.NoError(err) - bytes, err := txs.Codec.Marshal(txs.Version, tx) + bytes, err := txs.Codec.Marshal(txs.CodecVersion, tx) require.NoError(err) var unmarshaledTx txs.Tx diff --git a/vms/platformvm/txs/executor/import_test.go b/vms/platformvm/txs/executor/import_test.go index 4ce779a9165e..9144a92873b1 100644 --- a/vms/platformvm/txs/executor/import_test.go +++ b/vms/platformvm/txs/executor/import_test.go @@ -67,7 +67,7 @@ func TestNewImportTx(t *testing.T) { }, }, } - utxoBytes, err := txs.Codec.Marshal(txs.Version, utxo) + utxoBytes, err := txs.Codec.Marshal(txs.CodecVersion, utxo) require.NoError(t, err) inputID := utxo.InputID() diff --git a/vms/platformvm/txs/executor/standard_tx_executor.go b/vms/platformvm/txs/executor/standard_tx_executor.go index 53269520d88e..9bd5b140b314 100644 --- a/vms/platformvm/txs/executor/standard_tx_executor.go +++ b/vms/platformvm/txs/executor/standard_tx_executor.go @@ -254,7 +254,7 @@ func (e *StandardTxExecutor) ExportTx(tx *txs.ExportTx) error { Out: out.Out, } - utxoBytes, err := txs.Codec.Marshal(txs.Version, utxo) + utxoBytes, err := txs.Codec.Marshal(txs.CodecVersion, utxo) if err != nil { return fmt.Errorf("failed to marshal UTXO: %w", err) } diff --git a/vms/platformvm/txs/remove_subnet_validator_tx_test.go b/vms/platformvm/txs/remove_subnet_validator_tx_test.go index 4b1f381c039b..45bf7483cf47 100644 --- a/vms/platformvm/txs/remove_subnet_validator_tx_test.go +++ b/vms/platformvm/txs/remove_subnet_validator_tx_test.go @@ -157,7 +157,7 @@ func TestRemoveSubnetValidatorTxSerialization(t *testing.T) { 0x00, 0x00, 0x00, 0x03, } var unsignedSimpleRemoveValidatorTx UnsignedTx = simpleRemoveValidatorTx - unsignedSimpleRemoveValidatorTxBytes, err := Codec.Marshal(Version, &unsignedSimpleRemoveValidatorTx) + unsignedSimpleRemoveValidatorTxBytes, err := Codec.Marshal(CodecVersion, &unsignedSimpleRemoveValidatorTx) require.NoError(err) require.Equal(expectedUnsignedSimpleRemoveValidatorTxBytes, unsignedSimpleRemoveValidatorTxBytes) @@ -417,7 +417,7 @@ func TestRemoveSubnetValidatorTxSerialization(t *testing.T) { 0x00, 0x00, 0x00, 0x00, } var unsignedComplexRemoveValidatorTx UnsignedTx = complexRemoveValidatorTx - unsignedComplexRemoveValidatorTxBytes, err := Codec.Marshal(Version, &unsignedComplexRemoveValidatorTx) + unsignedComplexRemoveValidatorTxBytes, err := Codec.Marshal(CodecVersion, &unsignedComplexRemoveValidatorTx) require.NoError(err) require.Equal(expectedUnsignedComplexRemoveValidatorTxBytes, unsignedComplexRemoveValidatorTxBytes) diff --git a/vms/platformvm/txs/transfer_subnet_ownership_tx_test.go b/vms/platformvm/txs/transfer_subnet_ownership_tx_test.go index e8cddeb3e1d0..e1b57a589461 100644 --- a/vms/platformvm/txs/transfer_subnet_ownership_tx_test.go +++ b/vms/platformvm/txs/transfer_subnet_ownership_tx_test.go @@ -164,7 +164,7 @@ func TestTransferSubnetOwnershipTxSerialization(t *testing.T) { 0x44, 0x55, 0x66, 0x77, } var unsignedSimpleTransferSubnetOwnershipTx UnsignedTx = simpleTransferSubnetOwnershipTx - unsignedSimpleTransferSubnetOwnershipTxBytes, err := Codec.Marshal(Version, &unsignedSimpleTransferSubnetOwnershipTx) + unsignedSimpleTransferSubnetOwnershipTxBytes, err := Codec.Marshal(CodecVersion, &unsignedSimpleTransferSubnetOwnershipTx) require.NoError(err) require.Equal(expectedUnsignedSimpleTransferSubnetOwnershipTxBytes, unsignedSimpleTransferSubnetOwnershipTxBytes) @@ -438,7 +438,7 @@ func TestTransferSubnetOwnershipTxSerialization(t *testing.T) { 0x44, 0x55, 0x66, 0x77, } var unsignedComplexTransferSubnetOwnershipTx UnsignedTx = complexTransferSubnetOwnershipTx - unsignedComplexTransferSubnetOwnershipTxBytes, err := Codec.Marshal(Version, &unsignedComplexTransferSubnetOwnershipTx) + unsignedComplexTransferSubnetOwnershipTxBytes, err := Codec.Marshal(CodecVersion, &unsignedComplexTransferSubnetOwnershipTx) require.NoError(err) require.Equal(expectedUnsignedComplexTransferSubnetOwnershipTxBytes, unsignedComplexTransferSubnetOwnershipTxBytes) diff --git a/vms/platformvm/txs/transform_subnet_tx_test.go b/vms/platformvm/txs/transform_subnet_tx_test.go index 4b88fd60ef3a..7a9b0b6981be 100644 --- a/vms/platformvm/txs/transform_subnet_tx_test.go +++ b/vms/platformvm/txs/transform_subnet_tx_test.go @@ -223,7 +223,7 @@ func TestTransformSubnetTxSerialization(t *testing.T) { 0x00, 0x00, 0x00, 0x03, } var unsignedSimpleTransformTx UnsignedTx = simpleTransformTx - unsignedSimpleTransformTxBytes, err := Codec.Marshal(Version, &unsignedSimpleTransformTx) + unsignedSimpleTransformTxBytes, err := Codec.Marshal(CodecVersion, &unsignedSimpleTransformTx) require.NoError(err) require.Equal(expectedUnsignedSimpleTransformTxBytes, unsignedSimpleTransformTxBytes) @@ -520,7 +520,7 @@ func TestTransformSubnetTxSerialization(t *testing.T) { 0x00, 0x00, 0x00, 0x00, } var unsignedComplexTransformTx UnsignedTx = complexTransformTx - unsignedComplexTransformTxBytes, err := Codec.Marshal(Version, &unsignedComplexTransformTx) + unsignedComplexTransformTxBytes, err := Codec.Marshal(CodecVersion, &unsignedComplexTransformTx) require.NoError(err) require.Equal(expectedUnsignedComplexTransformTxBytes, unsignedComplexTransformTxBytes) diff --git a/vms/platformvm/txs/tx.go b/vms/platformvm/txs/tx.go index c9713ffe09c3..52ee3f80b29c 100644 --- a/vms/platformvm/txs/tx.go +++ b/vms/platformvm/txs/tx.go @@ -48,12 +48,12 @@ func NewSigned( } func (tx *Tx) Initialize(c codec.Manager) error { - signedBytes, err := c.Marshal(Version, tx) + signedBytes, err := c.Marshal(CodecVersion, tx) if err != nil { return fmt.Errorf("couldn't marshal ProposalTx: %w", err) } - unsignedBytesLen, err := c.Size(Version, &tx.Unsigned) + unsignedBytesLen, err := c.Size(CodecVersion, &tx.Unsigned) if err != nil { return fmt.Errorf("couldn't calculate UnsignedTx marshal length: %w", err) } @@ -78,7 +78,7 @@ func Parse(c codec.Manager, signedBytes []byte) (*Tx, error) { return nil, fmt.Errorf("couldn't parse tx: %w", err) } - unsignedBytesLen, err := c.Size(Version, &tx.Unsigned) + unsignedBytesLen, err := c.Size(CodecVersion, &tx.Unsigned) if err != nil { return nil, fmt.Errorf("couldn't calculate UnsignedTx marshal length: %w", err) } @@ -132,7 +132,7 @@ func (tx *Tx) SyntacticVerify(ctx *snow.Context) error { // Note: We explicitly pass the codec in Sign since we may need to sign P-Chain // genesis txs whose length exceed the max length of txs.Codec. func (tx *Tx) Sign(c codec.Manager, signers [][]*secp256k1.PrivateKey) error { - unsignedBytes, err := c.Marshal(Version, &tx.Unsigned) + unsignedBytes, err := c.Marshal(CodecVersion, &tx.Unsigned) if err != nil { return fmt.Errorf("couldn't marshal UnsignedTx: %w", err) } @@ -153,7 +153,7 @@ func (tx *Tx) Sign(c codec.Manager, signers [][]*secp256k1.PrivateKey) error { tx.Creds = append(tx.Creds, cred) // Attach credential } - signedBytes, err := c.Marshal(Version, tx) + signedBytes, err := c.Marshal(CodecVersion, tx) if err != nil { return fmt.Errorf("couldn't marshal ProposalTx: %w", err) } diff --git a/vms/platformvm/utxo/handler.go b/vms/platformvm/utxo/handler.go index 2d652103fee2..37f53238e4cb 100644 --- a/vms/platformvm/utxo/handler.go +++ b/vms/platformvm/utxo/handler.go @@ -557,7 +557,7 @@ func (h *handler) VerifySpendUTXOs( return fmt.Errorf("expected fx.Owned but got %T", out) } owner := owned.Owners() - ownerBytes, err := txs.Codec.Marshal(txs.Version, owner) + ownerBytes, err := txs.Codec.Marshal(txs.CodecVersion, owner) if err != nil { return fmt.Errorf("couldn't marshal owner: %w", err) } @@ -606,7 +606,7 @@ func (h *handler) VerifySpendUTXOs( return fmt.Errorf("expected fx.Owned but got %T", out) } owner := owned.Owners() - ownerBytes, err := txs.Codec.Marshal(txs.Version, owner) + ownerBytes, err := txs.Codec.Marshal(txs.CodecVersion, owner) if err != nil { return fmt.Errorf("couldn't marshal owner: %w", err) } diff --git a/vms/platformvm/vm_regression_test.go b/vms/platformvm/vm_regression_test.go index 4b820f615913..8dbf16cab605 100644 --- a/vms/platformvm/vm_regression_test.go +++ b/vms/platformvm/vm_regression_test.go @@ -604,7 +604,7 @@ func TestRejectedStateRegressionInvalidValidatorTimestamp(t *testing.T) { mutableSharedMemory.SharedMemory = m.NewSharedMemory(vm.ctx.ChainID) peerSharedMemory := m.NewSharedMemory(vm.ctx.XChainID) - utxoBytes, err := txs.Codec.Marshal(txs.Version, utxo) + utxoBytes, err := txs.Codec.Marshal(txs.CodecVersion, utxo) require.NoError(err) inputID := utxo.InputID() @@ -849,7 +849,7 @@ func TestRejectedStateRegressionInvalidValidatorReward(t *testing.T) { mutableSharedMemory.SharedMemory = m.NewSharedMemory(vm.ctx.ChainID) peerSharedMemory := m.NewSharedMemory(vm.ctx.XChainID) - utxoBytes, err := txs.Codec.Marshal(txs.Version, utxo) + utxoBytes, err := txs.Codec.Marshal(txs.CodecVersion, utxo) require.NoError(err) inputID := utxo.InputID() diff --git a/vms/platformvm/vm_test.go b/vms/platformvm/vm_test.go index 746d9e105968..ce074150c1c8 100644 --- a/vms/platformvm/vm_test.go +++ b/vms/platformvm/vm_test.go @@ -1013,7 +1013,7 @@ func TestAtomicImport(t *testing.T) { }, }, } - utxoBytes, err := txs.Codec.Marshal(txs.Version, utxo) + utxoBytes, err := txs.Codec.Marshal(txs.CodecVersion, utxo) require.NoError(err) inputID := utxo.InputID() diff --git a/vms/platformvm/warp/codec.go b/vms/platformvm/warp/codec.go index cf4587224751..937cca628ad9 100644 --- a/vms/platformvm/warp/codec.go +++ b/vms/platformvm/warp/codec.go @@ -11,18 +11,17 @@ import ( "github.com/ava-labs/avalanchego/utils" ) -const codecVersion = 0 +const CodecVersion = 0 -// Codec does serialization and deserialization for Warp messages. -var c codec.Manager +var Codec codec.Manager func init() { - c = codec.NewManager(math.MaxInt) + Codec = codec.NewManager(math.MaxInt) lc := linearcodec.NewCustomMaxLength(math.MaxInt32) err := utils.Err( lc.RegisterType(&BitSetSignature{}), - c.RegisterCodec(codecVersion, lc), + Codec.RegisterCodec(CodecVersion, lc), ) if err != nil { panic(err) diff --git a/vms/platformvm/warp/message.go b/vms/platformvm/warp/message.go index 34850aed98ad..454ab9482d17 100644 --- a/vms/platformvm/warp/message.go +++ b/vms/platformvm/warp/message.go @@ -28,7 +28,7 @@ func ParseMessage(b []byte) (*Message, error) { msg := &Message{ bytes: b, } - _, err := c.Unmarshal(b, msg) + _, err := Codec.Unmarshal(b, msg) if err != nil { return nil, err } @@ -38,7 +38,7 @@ func ParseMessage(b []byte) (*Message, error) { // Initialize recalculates the result of Bytes(). It does not call Initialize() // on the UnsignedMessage. func (m *Message) Initialize() error { - bytes, err := c.Marshal(codecVersion, m) + bytes, err := Codec.Marshal(CodecVersion, m) m.bytes = bytes return err } diff --git a/vms/platformvm/warp/payload/codec.go b/vms/platformvm/warp/payload/codec.go index e2e8ddd7a7f5..57642968e9e5 100644 --- a/vms/platformvm/warp/payload/codec.go +++ b/vms/platformvm/warp/payload/codec.go @@ -11,7 +11,7 @@ import ( ) const ( - codecVersion = 0 + CodecVersion = 0 MaxMessageSize = 24 * units.KiB @@ -20,17 +20,16 @@ const ( MaxSliceLen = 24 * 1024 ) -// Codec does serialization and deserialization for Warp messages. -var c codec.Manager +var Codec codec.Manager func init() { - c = codec.NewManager(MaxMessageSize) + Codec = codec.NewManager(MaxMessageSize) lc := linearcodec.NewCustomMaxLength(MaxSliceLen) err := utils.Err( lc.RegisterType(&Hash{}), lc.RegisterType(&AddressedCall{}), - c.RegisterCodec(codecVersion, lc), + Codec.RegisterCodec(CodecVersion, lc), ) if err != nil { panic(err) diff --git a/vms/platformvm/warp/payload/payload.go b/vms/platformvm/warp/payload/payload.go index e4601945be98..dbed48ae9c29 100644 --- a/vms/platformvm/warp/payload/payload.go +++ b/vms/platformvm/warp/payload/payload.go @@ -22,7 +22,7 @@ type Payload interface { func Parse(bytes []byte) (Payload, error) { var payload Payload - if _, err := c.Unmarshal(bytes, &payload); err != nil { + if _, err := Codec.Unmarshal(bytes, &payload); err != nil { return nil, err } payload.initialize(bytes) @@ -30,7 +30,7 @@ func Parse(bytes []byte) (Payload, error) { } func initialize(p Payload) error { - bytes, err := c.Marshal(codecVersion, &p) + bytes, err := Codec.Marshal(CodecVersion, &p) if err != nil { return fmt.Errorf("couldn't marshal %T payload: %w", p, err) } diff --git a/vms/platformvm/warp/unsigned_message.go b/vms/platformvm/warp/unsigned_message.go index 95ef0d2d07f0..873f6995357d 100644 --- a/vms/platformvm/warp/unsigned_message.go +++ b/vms/platformvm/warp/unsigned_message.go @@ -41,13 +41,13 @@ func ParseUnsignedMessage(b []byte) (*UnsignedMessage, error) { bytes: b, id: hashing.ComputeHash256Array(b), } - _, err := c.Unmarshal(b, msg) + _, err := Codec.Unmarshal(b, msg) return msg, err } // Initialize recalculates the result of Bytes(). func (m *UnsignedMessage) Initialize() error { - bytes, err := c.Marshal(codecVersion, m) + bytes, err := Codec.Marshal(CodecVersion, m) if err != nil { return fmt.Errorf("couldn't marshal warp unsigned message: %w", err) } diff --git a/vms/proposervm/block/build.go b/vms/proposervm/block/build.go index cdf943318fcc..c6f18020507f 100644 --- a/vms/proposervm/block/build.go +++ b/vms/proposervm/block/build.go @@ -31,7 +31,7 @@ func BuildUnsigned( timestamp: timestamp, } - bytes, err := c.Marshal(codecVersion, &block) + bytes, err := Codec.Marshal(CodecVersion, &block) if err != nil { return nil, err } @@ -61,7 +61,7 @@ func Build( } var blockIntf SignedBlock = block - unsignedBytesWithEmptySignature, err := c.Marshal(codecVersion, &blockIntf) + unsignedBytesWithEmptySignature, err := Codec.Marshal(CodecVersion, &blockIntf) if err != nil { return nil, err } @@ -85,7 +85,7 @@ func Build( return nil, err } - block.bytes, err = c.Marshal(codecVersion, &blockIntf) + block.bytes, err = Codec.Marshal(CodecVersion, &blockIntf) return block, err } @@ -100,7 +100,7 @@ func BuildHeader( Body: bodyID, } - bytes, err := c.Marshal(codecVersion, &header) + bytes, err := Codec.Marshal(CodecVersion, &header) header.bytes = bytes return &header, err } @@ -117,7 +117,7 @@ func BuildOption( InnerBytes: innerBytes, } - bytes, err := c.Marshal(codecVersion, &block) + bytes, err := Codec.Marshal(CodecVersion, &block) if err != nil { return nil, err } diff --git a/vms/proposervm/block/codec.go b/vms/proposervm/block/codec.go index 6d68a4cc2fe7..fc6910377d47 100644 --- a/vms/proposervm/block/codec.go +++ b/vms/proposervm/block/codec.go @@ -11,23 +11,20 @@ import ( "github.com/ava-labs/avalanchego/utils" ) -const codecVersion = 0 +const CodecVersion = 0 -// The maximum block size is enforced by the p2p message size limit. -// See: [constants.DefaultMaxMessageSize] -// -// Invariant: This codec must never be used to unmarshal a slice unless it is a -// `[]byte`. Otherwise a malicious payload could cause an OOM. -var c codec.Manager +var Codec codec.Manager func init() { - linearCodec := linearcodec.NewCustomMaxLength(math.MaxUint32) - c = codec.NewManager(math.MaxInt) + lc := linearcodec.NewCustomMaxLength(math.MaxUint32) + // The maximum block size is enforced by the p2p message size limit. + // See: [constants.DefaultMaxMessageSize] + Codec = codec.NewManager(math.MaxInt) err := utils.Err( - linearCodec.RegisterType(&statelessBlock{}), - linearCodec.RegisterType(&option{}), - c.RegisterCodec(codecVersion, linearCodec), + lc.RegisterType(&statelessBlock{}), + lc.RegisterType(&option{}), + Codec.RegisterCodec(CodecVersion, lc), ) if err != nil { panic(err) diff --git a/vms/proposervm/block/parse.go b/vms/proposervm/block/parse.go index aff15bde9d2b..1a55e5045981 100644 --- a/vms/proposervm/block/parse.go +++ b/vms/proposervm/block/parse.go @@ -7,24 +7,24 @@ import "fmt" func Parse(bytes []byte) (Block, error) { var block Block - parsedVersion, err := c.Unmarshal(bytes, &block) + parsedVersion, err := Codec.Unmarshal(bytes, &block) if err != nil { return nil, err } - if parsedVersion != codecVersion { - return nil, fmt.Errorf("expected codec version %d but got %d", codecVersion, parsedVersion) + if parsedVersion != CodecVersion { + return nil, fmt.Errorf("expected codec version %d but got %d", CodecVersion, parsedVersion) } return block, block.initialize(bytes) } func ParseHeader(bytes []byte) (Header, error) { header := statelessHeader{} - parsedVersion, err := c.Unmarshal(bytes, &header) + parsedVersion, err := Codec.Unmarshal(bytes, &header) if err != nil { return nil, err } - if parsedVersion != codecVersion { - return nil, fmt.Errorf("expected codec version %d but got %d", codecVersion, parsedVersion) + if parsedVersion != CodecVersion { + return nil, fmt.Errorf("expected codec version %d but got %d", CodecVersion, parsedVersion) } header.bytes = bytes return &header, nil diff --git a/vms/proposervm/state/block_state.go b/vms/proposervm/state/block_state.go index fa4c67e1ecf5..b0d6d6547c9a 100644 --- a/vms/proposervm/state/block_state.go +++ b/vms/proposervm/state/block_state.go @@ -100,11 +100,11 @@ func (s *blockState) GetBlock(blkID ids.ID) (block.Block, choices.Status, error) } blkWrapper := blockWrapper{} - parsedVersion, err := c.Unmarshal(blkWrapperBytes, &blkWrapper) + parsedVersion, err := Codec.Unmarshal(blkWrapperBytes, &blkWrapper) if err != nil { return nil, choices.Unknown, err } - if parsedVersion != version { + if parsedVersion != CodecVersion { return nil, choices.Unknown, errBlockWrongVersion } @@ -126,7 +126,7 @@ func (s *blockState) PutBlock(blk block.Block, status choices.Status) error { block: blk, } - bytes, err := c.Marshal(version, &blkWrapper) + bytes, err := Codec.Marshal(CodecVersion, &blkWrapper) if err != nil { return err } diff --git a/vms/proposervm/state/codec.go b/vms/proposervm/state/codec.go index f73523806e53..6c1ecabd919c 100644 --- a/vms/proposervm/state/codec.go +++ b/vms/proposervm/state/codec.go @@ -10,15 +10,15 @@ import ( "github.com/ava-labs/avalanchego/codec/linearcodec" ) -const version = 0 +const CodecVersion = 0 -var c codec.Manager +var Codec codec.Manager func init() { lc := linearcodec.NewCustomMaxLength(math.MaxUint32) - c = codec.NewManager(math.MaxInt32) + Codec = codec.NewManager(math.MaxInt32) - err := c.RegisterCodec(version, lc) + err := Codec.RegisterCodec(CodecVersion, lc) if err != nil { panic(err) } diff --git a/vms/proposervm/summary/build.go b/vms/proposervm/summary/build.go index 35e2e179f0e3..a166d3c6c33c 100644 --- a/vms/proposervm/summary/build.go +++ b/vms/proposervm/summary/build.go @@ -20,7 +20,7 @@ func Build( InnerSummary: coreSummary, } - bytes, err := c.Marshal(codecVersion, &summary) + bytes, err := Codec.Marshal(CodecVersion, &summary) if err != nil { return nil, fmt.Errorf("cannot marshal proposer summary due to: %w", err) } diff --git a/vms/proposervm/summary/codec.go b/vms/proposervm/summary/codec.go index a71350f37d0f..188e6470f80f 100644 --- a/vms/proposervm/summary/codec.go +++ b/vms/proposervm/summary/codec.go @@ -11,18 +11,18 @@ import ( "github.com/ava-labs/avalanchego/codec/linearcodec" ) -const codecVersion = 0 +const CodecVersion = 0 var ( - c codec.Manager + Codec codec.Manager errWrongCodecVersion = errors.New("wrong codec version") ) func init() { lc := linearcodec.NewCustomMaxLength(math.MaxUint32) - c = codec.NewManager(math.MaxInt32) - if err := c.RegisterCodec(codecVersion, lc); err != nil { + Codec = codec.NewManager(math.MaxInt32) + if err := Codec.RegisterCodec(CodecVersion, lc); err != nil { panic(err) } } diff --git a/vms/proposervm/summary/parse.go b/vms/proposervm/summary/parse.go index 3d9295444782..e4dd8733c091 100644 --- a/vms/proposervm/summary/parse.go +++ b/vms/proposervm/summary/parse.go @@ -14,11 +14,11 @@ func Parse(bytes []byte) (StateSummary, error) { id: hashing.ComputeHash256Array(bytes), bytes: bytes, } - version, err := c.Unmarshal(bytes, &summary) + version, err := Codec.Unmarshal(bytes, &summary) if err != nil { return nil, fmt.Errorf("could not unmarshal summary due to: %w", err) } - if version != codecVersion { + if version != CodecVersion { return nil, errWrongCodecVersion } return &summary, nil diff --git a/wallet/chain/p/signer_visitor.go b/wallet/chain/p/signer_visitor.go index 9dd6018ea2e3..25429b47e50f 100644 --- a/wallet/chain/p/signer_visitor.go +++ b/wallet/chain/p/signer_visitor.go @@ -284,7 +284,7 @@ func (s *signerVisitor) getSubnetSigners(subnetID ids.ID, subnetAuth verify.Veri // TODO: remove [signHash] after the ledger supports signing all transactions. func sign(tx *txs.Tx, signHash bool, txSigners [][]keychain.Signer) error { - unsignedBytes, err := txs.Codec.Marshal(txs.Version, &tx.Unsigned) + unsignedBytes, err := txs.Codec.Marshal(txs.CodecVersion, &tx.Unsigned) if err != nil { return fmt.Errorf("couldn't marshal unsigned tx: %w", err) } @@ -345,7 +345,7 @@ func sign(tx *txs.Tx, signHash bool, txSigners [][]keychain.Signer) error { } } - signedBytes, err := txs.Codec.Marshal(txs.Version, tx) + signedBytes, err := txs.Codec.Marshal(txs.CodecVersion, tx) if err != nil { return fmt.Errorf("couldn't marshal tx: %w", err) } From 8618c308242003f69042589fe202b05cdc4e67a8 Mon Sep 17 00:00:00 2001 From: Stephen Buttolph Date: Fri, 29 Dec 2023 17:03:14 -0500 Subject: [PATCH 10/57] Remove `len` tag parsing from the reflect codec (#2559) --- codec/reflectcodec/struct_fielder.go | 46 ++++----------- codec/reflectcodec/type_codec.go | 56 +++++++++---------- codec/test_codec.go | 26 +-------- .../avalanche/vertex/stateless_vertex.go | 10 ++-- 4 files changed, 45 insertions(+), 93 deletions(-) diff --git a/codec/reflectcodec/struct_fielder.go b/codec/reflectcodec/struct_fielder.go index 8aff2ea33139..a16212a62103 100644 --- a/codec/reflectcodec/struct_fielder.go +++ b/codec/reflectcodec/struct_fielder.go @@ -6,44 +6,31 @@ package reflectcodec import ( "fmt" "reflect" - "strconv" "sync" "github.com/ava-labs/avalanchego/codec" ) -const ( - // SliceLenTagName that specifies the length of a slice. - SliceLenTagName = "len" - - // TagValue is the value the tag must have to be serialized. - TagValue = "true" -) +// TagValue is the value the tag must have to be serialized. +const TagValue = "true" var _ StructFielder = (*structFielder)(nil) -type FieldDesc struct { - Index int - MaxSliceLen uint32 -} - // StructFielder handles discovery of serializable fields in a struct. type StructFielder interface { // Returns the fields that have been marked as serializable in [t], which is - // a struct type. Additionally, returns the custom maximum length slice that - // may be serialized into the field, if any. + // a struct type. // Returns an error if a field has tag "[tagName]: [TagValue]" but the field // is un-exported. // GetSerializedField(Foo) --> [1,5,8] means Foo.Field(1), Foo.Field(5), // Foo.Field(8) are to be serialized/deserialized. - GetSerializedFields(t reflect.Type) ([]FieldDesc, error) + GetSerializedFields(t reflect.Type) ([]int, error) } -func NewStructFielder(tagNames []string, maxSliceLen uint32) StructFielder { +func NewStructFielder(tagNames []string) StructFielder { return &structFielder{ tags: tagNames, - maxSliceLen: maxSliceLen, - serializedFieldIndices: make(map[reflect.Type][]FieldDesc), + serializedFieldIndices: make(map[reflect.Type][]int), } } @@ -54,17 +41,15 @@ type structFielder struct { // if it has at least one of the specified tags. tags []string - maxSliceLen uint32 - // Key: a struct type // Value: Slice where each element is index in the struct type of a field // that is serialized/deserialized e.g. Foo --> [1,5,8] means Foo.Field(1), // etc. are to be serialized/deserialized. We assume this cache is pretty // small (a few hundred keys at most) and doesn't take up much memory. - serializedFieldIndices map[reflect.Type][]FieldDesc + serializedFieldIndices map[reflect.Type][]int } -func (s *structFielder) GetSerializedFields(t reflect.Type) ([]FieldDesc, error) { +func (s *structFielder) GetSerializedFields(t reflect.Type) ([]int, error) { if serializedFields, ok := s.getCachedSerializedFields(t); ok { // use pre-computed result return serializedFields, nil } @@ -73,7 +58,7 @@ func (s *structFielder) GetSerializedFields(t reflect.Type) ([]FieldDesc, error) defer s.lock.Unlock() numFields := t.NumField() - serializedFields := make([]FieldDesc, 0, numFields) + serializedFields := make([]int, 0, numFields) for i := 0; i < numFields; i++ { // Go through all fields of this struct field := t.Field(i) @@ -96,22 +81,13 @@ func (s *structFielder) GetSerializedFields(t reflect.Type) ([]FieldDesc, error) field.Name, ) } - sliceLenField := field.Tag.Get(SliceLenTagName) - maxSliceLen := s.maxSliceLen - - if newLen, err := strconv.ParseUint(sliceLenField, 10, 31); err == nil { - maxSliceLen = uint32(newLen) - } - serializedFields = append(serializedFields, FieldDesc{ - Index: i, - MaxSliceLen: maxSliceLen, - }) + serializedFields = append(serializedFields, i) } s.serializedFieldIndices[t] = serializedFields // cache result return serializedFields, nil } -func (s *structFielder) getCachedSerializedFields(t reflect.Type) ([]FieldDesc, bool) { +func (s *structFielder) getCachedSerializedFields(t reflect.Type) ([]int, bool) { s.lock.RLock() defer s.lock.RUnlock() diff --git a/codec/reflectcodec/type_codec.go b/codec/reflectcodec/type_codec.go index 9ff06a9eba4d..ad2e11378163 100644 --- a/codec/reflectcodec/type_codec.go +++ b/codec/reflectcodec/type_codec.go @@ -81,7 +81,7 @@ func New(typer TypeCodec, tagNames []string, maxSliceLen uint32) codec.Codec { return &genericCodec{ typer: typer, maxSliceLen: maxSliceLen, - fielder: NewStructFielder(tagNames, maxSliceLen), + fielder: NewStructFielder(tagNames), } } @@ -208,8 +208,8 @@ func (c *genericCodec) size( size int constSize = true ) - for _, fieldDesc := range serializedFields { - innerSize, innerConstSize, err := c.size(value.Field(fieldDesc.Index), typeStack) + for _, fieldIndex := range serializedFields { + innerSize, innerConstSize, err := c.size(value.Field(fieldIndex), typeStack) if err != nil { return 0, false, err } @@ -292,7 +292,7 @@ func (c *genericCodec) MarshalInto(value interface{}, p *wrappers.Packer) error return errMarshalNil // can't marshal nil } - return c.marshal(reflect.ValueOf(value), p, c.maxSliceLen, nil /*=typeStack*/) + return c.marshal(reflect.ValueOf(value), p, nil /*=typeStack*/) } // marshal writes the byte representation of [value] to [p] @@ -301,7 +301,6 @@ func (c *genericCodec) MarshalInto(value interface{}, p *wrappers.Packer) error func (c *genericCodec) marshal( value reflect.Value, p *wrappers.Packer, - maxSliceLen uint32, typeStack set.Set[reflect.Type], ) error { switch valueKind := value.Kind(); valueKind { @@ -340,7 +339,7 @@ func (c *genericCodec) marshal( return errMarshalNil } - return c.marshal(value.Elem(), p, c.maxSliceLen, typeStack) + return c.marshal(value.Elem(), p, typeStack) case reflect.Interface: if value.IsNil() { return errMarshalNil @@ -355,18 +354,18 @@ func (c *genericCodec) marshal( if err := c.typer.PackPrefix(p, underlyingType); err != nil { return err } - if err := c.marshal(value.Elem(), p, c.maxSliceLen, typeStack); err != nil { + if err := c.marshal(value.Elem(), p, typeStack); err != nil { return err } typeStack.Remove(underlyingType) return p.Err case reflect.Slice: numElts := value.Len() // # elements in the slice/array. 0 if this slice is nil. - if uint32(numElts) > maxSliceLen { + if uint32(numElts) > c.maxSliceLen { return fmt.Errorf("%w; slice length, %d, exceeds maximum length, %d", codec.ErrMaxSliceLenExceeded, numElts, - maxSliceLen, + c.maxSliceLen, ) } p.PackInt(uint32(numElts)) // pack # elements @@ -386,7 +385,7 @@ func (c *genericCodec) marshal( return p.Err } for i := 0; i < numElts; i++ { // Process each element in the slice - if err := c.marshal(value.Index(i), p, c.maxSliceLen, typeStack); err != nil { + if err := c.marshal(value.Index(i), p, typeStack); err != nil { return err } } @@ -406,7 +405,7 @@ func (c *genericCodec) marshal( ) } for i := 0; i < numElts; i++ { // Process each element in the array - if err := c.marshal(value.Index(i), p, c.maxSliceLen, typeStack); err != nil { + if err := c.marshal(value.Index(i), p, typeStack); err != nil { return err } } @@ -416,8 +415,8 @@ func (c *genericCodec) marshal( if err != nil { return err } - for _, fieldDesc := range serializedFields { // Go through all fields of this struct that are serialized - if err := c.marshal(value.Field(fieldDesc.Index), p, fieldDesc.MaxSliceLen, typeStack); err != nil { // Serialize the field and write to byte array + for _, fieldIndex := range serializedFields { // Go through all fields of this struct that are serialized + if err := c.marshal(value.Field(fieldIndex), p, typeStack); err != nil { // Serialize the field and write to byte array return err } } @@ -425,11 +424,11 @@ func (c *genericCodec) marshal( case reflect.Map: keys := value.MapKeys() numElts := len(keys) - if uint32(numElts) > maxSliceLen { + if uint32(numElts) > c.maxSliceLen { return fmt.Errorf("%w; map length, %d, exceeds maximum length, %d", codec.ErrMaxSliceLenExceeded, numElts, - maxSliceLen, + c.maxSliceLen, ) } p.PackInt(uint32(numElts)) // pack # elements @@ -448,7 +447,7 @@ func (c *genericCodec) marshal( startOffset := p.Offset endOffset := p.Offset for i, key := range keys { - if err := c.marshal(key, p, c.maxSliceLen, typeStack); err != nil { + if err := c.marshal(key, p, typeStack); err != nil { return err } if p.Err != nil { @@ -481,7 +480,7 @@ func (c *genericCodec) marshal( } // serialize and pack value - if err := c.marshal(value.MapIndex(key.key), p, c.maxSliceLen, typeStack); err != nil { + if err := c.marshal(value.MapIndex(key.key), p, typeStack); err != nil { return err } } @@ -506,7 +505,7 @@ func (c *genericCodec) Unmarshal(bytes []byte, dest interface{}) error { if destPtr.Kind() != reflect.Ptr { return errNeedPointer } - if err := c.unmarshal(&p, destPtr.Elem(), c.maxSliceLen, nil /*=typeStack*/); err != nil { + if err := c.unmarshal(&p, destPtr.Elem(), nil /*=typeStack*/); err != nil { return err } if p.Offset != len(bytes) { @@ -525,7 +524,6 @@ func (c *genericCodec) Unmarshal(bytes []byte, dest interface{}) error { func (c *genericCodec) unmarshal( p *wrappers.Packer, value reflect.Value, - maxSliceLen uint32, typeStack set.Set[reflect.Type], ) error { switch value.Kind() { @@ -588,11 +586,11 @@ func (c *genericCodec) unmarshal( if p.Err != nil { return fmt.Errorf("couldn't unmarshal slice: %w", p.Err) } - if numElts32 > maxSliceLen { + if numElts32 > c.maxSliceLen { return fmt.Errorf("%w; array length, %d, exceeds maximum length, %d", codec.ErrMaxSliceLenExceeded, numElts32, - maxSliceLen, + c.maxSliceLen, ) } if numElts32 > math.MaxInt32 { @@ -618,7 +616,7 @@ func (c *genericCodec) unmarshal( zeroValue := reflect.Zero(innerType) for i := 0; i < numElts; i++ { value.Set(reflect.Append(value, zeroValue)) - if err := c.unmarshal(p, value.Index(i), c.maxSliceLen, typeStack); err != nil { + if err := c.unmarshal(p, value.Index(i), typeStack); err != nil { return err } } @@ -636,7 +634,7 @@ func (c *genericCodec) unmarshal( return nil } for i := 0; i < numElts; i++ { - if err := c.unmarshal(p, value.Index(i), c.maxSliceLen, typeStack); err != nil { + if err := c.unmarshal(p, value.Index(i), typeStack); err != nil { return err } } @@ -659,7 +657,7 @@ func (c *genericCodec) unmarshal( typeStack.Add(intfImplementorType) // Unmarshal into the struct - if err := c.unmarshal(p, intfImplementor, c.maxSliceLen, typeStack); err != nil { + if err := c.unmarshal(p, intfImplementor, typeStack); err != nil { return err } @@ -673,8 +671,8 @@ func (c *genericCodec) unmarshal( return fmt.Errorf("couldn't unmarshal struct: %w", err) } // Go through the fields and umarshal into them - for _, fieldDesc := range serializedFieldIndices { - if err := c.unmarshal(p, value.Field(fieldDesc.Index), fieldDesc.MaxSliceLen, typeStack); err != nil { + for _, fieldIndex := range serializedFieldIndices { + if err := c.unmarshal(p, value.Field(fieldIndex), typeStack); err != nil { return err } } @@ -685,7 +683,7 @@ func (c *genericCodec) unmarshal( // Create a new pointer to a new value of the underlying type v := reflect.New(t) // Fill the value - if err := c.unmarshal(p, v.Elem(), c.maxSliceLen, typeStack); err != nil { + if err := c.unmarshal(p, v.Elem(), typeStack); err != nil { return err } // Assign to the top-level struct's member @@ -720,7 +718,7 @@ func (c *genericCodec) unmarshal( keyStartOffset := p.Offset - if err := c.unmarshal(p, mapKey, c.maxSliceLen, typeStack); err != nil { + if err := c.unmarshal(p, mapKey, typeStack); err != nil { return err } @@ -738,7 +736,7 @@ func (c *genericCodec) unmarshal( // Get the value mapValue := reflect.New(mapValueType).Elem() - if err := c.unmarshal(p, mapValue, c.maxSliceLen, typeStack); err != nil { + if err := c.unmarshal(p, mapValue, typeStack); err != nil { return err } diff --git a/codec/test_codec.go b/codec/test_codec.go index b24784ac7d6a..3c933816a253 100644 --- a/codec/test_codec.go +++ b/codec/test_codec.go @@ -39,7 +39,6 @@ var ( TestNegativeNumbers, TestTooLargeUnmarshal, TestUnmarshalInvalidInterface, - TestRestrictedSlice, TestExtraSpace, TestSliceLengthOverflow, TestMap, @@ -874,27 +873,6 @@ func TestUnmarshalInvalidInterface(codec GeneralCodec, t testing.TB) { } } -// Ensure deserializing slices that have been length restricted errors correctly -func TestRestrictedSlice(codec GeneralCodec, t testing.TB) { - require := require.New(t) - - type inner struct { - Bytes []byte `serialize:"true" len:"2"` - } - bytes := []byte{0, 0, 0, 0, 0, 3, 0, 1, 2} - - manager := NewDefaultManager() - require.NoError(manager.RegisterCodec(0, codec)) - - s := inner{} - _, err := manager.Unmarshal(bytes, &s) - require.ErrorIs(err, ErrMaxSliceLenExceeded) - - s.Bytes = []byte{0, 1, 2} - _, err = manager.Marshal(0, s) - require.ErrorIs(err, ErrMaxSliceLenExceeded) -} - // Test unmarshaling something with extra data func TestExtraSpace(codec GeneralCodec, t testing.TB) { require := require.New(t) @@ -909,12 +887,12 @@ func TestExtraSpace(codec GeneralCodec, t testing.TB) { require.ErrorIs(err, ErrExtraSpace) } -// Ensure deserializing slices that have been length restricted errors correctly +// Ensure deserializing slices whose lengths exceed MaxInt32 error correctly func TestSliceLengthOverflow(codec GeneralCodec, t testing.TB) { require := require.New(t) type inner struct { - Vals []uint32 `serialize:"true" len:"2"` + Vals []uint32 `serialize:"true"` } bytes := []byte{ // Codec Version: diff --git a/snow/engine/avalanche/vertex/stateless_vertex.go b/snow/engine/avalanche/vertex/stateless_vertex.go index ca772ed8670a..d5e51671bb42 100644 --- a/snow/engine/avalanche/vertex/stateless_vertex.go +++ b/snow/engine/avalanche/vertex/stateless_vertex.go @@ -94,11 +94,11 @@ func (v statelessVertex) Txs() [][]byte { type innerStatelessVertex struct { Version uint16 `json:"version"` - ChainID ids.ID `json:"chainID" serializeV0:"true" serializeV1:"true"` - Height uint64 `json:"height" serializeV0:"true" serializeV1:"true"` - Epoch uint32 `json:"epoch" serializeV0:"true"` - ParentIDs []ids.ID `json:"parentIDs" len:"128" serializeV0:"true" serializeV1:"true"` - Txs [][]byte `json:"txs" len:"128" serializeV0:"true"` + ChainID ids.ID `json:"chainID" serializeV0:"true" serializeV1:"true"` + Height uint64 `json:"height" serializeV0:"true" serializeV1:"true"` + Epoch uint32 `json:"epoch" serializeV0:"true"` + ParentIDs []ids.ID `json:"parentIDs" serializeV0:"true" serializeV1:"true"` + Txs [][]byte `json:"txs" serializeV0:"true"` } func (v innerStatelessVertex) Verify() error { From 0158a53932572a20cb6f98c2c0fc6e2e33d8d0d1 Mon Sep 17 00:00:00 2001 From: Dhruba Basu <7675102+dhrubabasu@users.noreply.github.com> Date: Sun, 31 Dec 2023 11:59:02 -0500 Subject: [PATCH 11/57] Use more specific type (#2567) --- network/network.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network/network.go b/network/network.go index 6c182e0554ec..8359bd37841b 100644 --- a/network/network.go +++ b/network/network.go @@ -146,7 +146,7 @@ type network struct { // Cancelled on close onCloseCtx context.Context // Call [onCloseCtxCancel] to cancel [onCloseCtx] during close() - onCloseCtxCancel func() + onCloseCtxCancel context.CancelFunc sendFailRateCalculator safemath.Averager From f56ff2ec5c005ddc29fde667e76c0078be35a5e9 Mon Sep 17 00:00:00 2001 From: Dhruba Basu <7675102+dhrubabasu@users.noreply.github.com> Date: Sun, 31 Dec 2023 15:48:31 -0500 Subject: [PATCH 12/57] Standardize `onShutdownCtx` (#2568) --- vms/avm/vm.go | 14 ++++++++------ vms/platformvm/vm.go | 16 ++++++++++------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/vms/avm/vm.go b/vms/avm/vm.go index 699f95a6e7be..2f3e05541f96 100644 --- a/vms/avm/vm.go +++ b/vms/avm/vm.go @@ -114,9 +114,11 @@ type VM struct { txBackend *txexecutor.Backend - context context.Context - startShutdown context.CancelFunc - awaitShutdown sync.WaitGroup + // Cancelled on shutdown + onShutdownCtx context.Context + // Call [onShutdownCtxCancel] to cancel [onShutdownCtx] during Shutdown() + onShutdownCtxCancel context.CancelFunc + awaitShutdown sync.WaitGroup networkConfig network.Config // These values are only initialized after the chain has been linearized. @@ -274,7 +276,7 @@ func (vm *VM) Initialize( Bootstrapped: false, } - vm.context, vm.startShutdown = context.WithCancel(context.Background()) + vm.onShutdownCtx, vm.onShutdownCtxCancel = context.WithCancel(context.Background()) vm.networkConfig = avmConfig.Network return vm.state.Commit() } @@ -318,7 +320,7 @@ func (vm *VM) Shutdown(context.Context) error { return nil } - vm.startShutdown() + vm.onShutdownCtxCancel() vm.awaitShutdown.Wait() return utils.Err( @@ -474,7 +476,7 @@ func (vm *VM) Linearize(ctx context.Context, stopVertexID ids.ID, toEngine chan< defer vm.awaitShutdown.Done() // Invariant: Gossip must never grab the context lock. - vm.network.Gossip(vm.context) + vm.network.Gossip(vm.onShutdownCtx) }() go func() { diff --git a/vms/platformvm/vm.go b/vms/platformvm/vm.go index e9885a9bad94..d8e9d4172406 100644 --- a/vms/platformvm/vm.go +++ b/vms/platformvm/vm.go @@ -90,8 +90,11 @@ type VM struct { txBuilder txbuilder.Builder manager blockexecutor.Manager - startShutdown context.CancelFunc - awaitShutdown sync.WaitGroup + // Cancelled on shutdown + onShutdownCtx context.Context + // Call [onShutdownCtxCancel] to cancel [onShutdownCtx] during Shutdown() + onShutdownCtxCancel context.CancelFunc + awaitShutdown sync.WaitGroup // TODO: Remove after v1.11.x is activated pruned utils.Atomic[bool] @@ -212,12 +215,13 @@ func (vm *VM) Initialize( return fmt.Errorf("failed to initialize network: %w", err) } - vmCtx, cancel := context.WithCancel(context.Background()) - vm.startShutdown = cancel + vm.onShutdownCtx, vm.onShutdownCtxCancel = context.WithCancel(context.Background()) vm.awaitShutdown.Add(1) go func() { defer vm.awaitShutdown.Done() - vm.Network.Gossip(vmCtx) + + // Invariant: Gossip must never grab the context lock. + vm.Network.Gossip(vm.onShutdownCtx) }() vm.Builder = blockbuilder.New( @@ -375,7 +379,7 @@ func (vm *VM) Shutdown(context.Context) error { return nil } - vm.startShutdown() + vm.onShutdownCtxCancel() vm.awaitShutdown.Wait() vm.Builder.ShutdownBlockTimer() From 89bc40c99f406d18b813e31795f30f815c664416 Mon Sep 17 00:00:00 2001 From: Stephen Buttolph Date: Sun, 31 Dec 2023 16:05:18 -0500 Subject: [PATCH 13/57] Verify avm mempool txs against the last accepted state (#2569) --- vms/avm/block/executor/block_test.go | 36 ++++++-------- vms/avm/block/executor/manager.go | 9 +--- vms/avm/block/executor/manager_test.go | 68 ++++---------------------- 3 files changed, 27 insertions(+), 86 deletions(-) diff --git a/vms/avm/block/executor/block_test.go b/vms/avm/block/executor/block_test.go index a235377164b9..d014b3ef499d 100644 --- a/vms/avm/block/executor/block_test.go +++ b/vms/avm/block/executor/block_test.go @@ -859,27 +859,25 @@ func TestBlockReject(t *testing.T) { mempool.EXPECT().Add(validTx).Return(nil) // Only add the one that passes verification mempool.EXPECT().RequestBuildBlock() - preferredID := ids.GenerateTestID() - mockPreferredState := state.NewMockDiff(ctrl) - mockPreferredState.EXPECT().GetLastAccepted().Return(ids.GenerateTestID()).AnyTimes() - mockPreferredState.EXPECT().GetTimestamp().Return(time.Now()).AnyTimes() + lastAcceptedID := ids.GenerateTestID() + mockState := state.NewMockState(ctrl) + mockState.EXPECT().GetLastAccepted().Return(lastAcceptedID).AnyTimes() + mockState.EXPECT().GetTimestamp().Return(time.Now()).AnyTimes() return &Block{ Block: mockBlock, manager: &manager{ - preferred: preferredID, - mempool: mempool, - metrics: metrics.NewMockMetrics(ctrl), + lastAccepted: lastAcceptedID, + mempool: mempool, + metrics: metrics.NewMockMetrics(ctrl), backend: &executor.Backend{ Bootstrapped: true, Ctx: &snow.Context{ Log: logging.NoLog{}, }, }, + state: mockState, blkIDToState: map[ids.ID]*blockState{ - preferredID: { - onAcceptState: mockPreferredState, - }, blockID: {}, }, }, @@ -919,27 +917,25 @@ func TestBlockReject(t *testing.T) { mempool.EXPECT().Add(tx2).Return(nil) mempool.EXPECT().RequestBuildBlock() - preferredID := ids.GenerateTestID() - mockPreferredState := state.NewMockDiff(ctrl) - mockPreferredState.EXPECT().GetLastAccepted().Return(ids.GenerateTestID()).AnyTimes() - mockPreferredState.EXPECT().GetTimestamp().Return(time.Now()).AnyTimes() + lastAcceptedID := ids.GenerateTestID() + mockState := state.NewMockState(ctrl) + mockState.EXPECT().GetLastAccepted().Return(lastAcceptedID).AnyTimes() + mockState.EXPECT().GetTimestamp().Return(time.Now()).AnyTimes() return &Block{ Block: mockBlock, manager: &manager{ - preferred: preferredID, - mempool: mempool, - metrics: metrics.NewMockMetrics(ctrl), + lastAccepted: lastAcceptedID, + mempool: mempool, + metrics: metrics.NewMockMetrics(ctrl), backend: &executor.Backend{ Bootstrapped: true, Ctx: &snow.Context{ Log: logging.NoLog{}, }, }, + state: mockState, blkIDToState: map[ids.ID]*blockState{ - preferredID: { - onAcceptState: mockPreferredState, - }, blockID: {}, }, }, diff --git a/vms/avm/block/executor/manager.go b/vms/avm/block/executor/manager.go index 4ee6c37046ec..9ffcb36c9a61 100644 --- a/vms/avm/block/executor/manager.go +++ b/vms/avm/block/executor/manager.go @@ -155,7 +155,7 @@ func (m *manager) VerifyTx(tx *txs.Tx) error { return err } - stateDiff, err := state.NewDiff(m.preferred, m) + stateDiff, err := state.NewDiff(m.lastAccepted, m) if err != nil { return err } @@ -174,12 +174,7 @@ func (m *manager) VerifyTx(tx *txs.Tx) error { State: stateDiff, Tx: tx, } - err = tx.Unsigned.Visit(executor) - if err != nil { - return err - } - - return m.VerifyUniqueInputs(m.preferred, executor.Inputs) + return tx.Unsigned.Visit(executor) } func (m *manager) VerifyUniqueInputs(blkID ids.ID, inputs set.Set[ids.ID]) error { diff --git a/vms/avm/block/executor/manager_test.go b/vms/avm/block/executor/manager_test.go index 904154bf7030..542cf386afee 100644 --- a/vms/avm/block/executor/manager_test.go +++ b/vms/avm/block/executor/manager_test.go @@ -116,7 +116,6 @@ func TestManagerVerifyTx(t *testing.T) { expectedErr error } - inputID := ids.GenerateTestID() tests := []test{ { name: "not bootstrapped", @@ -161,11 +160,11 @@ func TestManagerVerifyTx(t *testing.T) { } }, managerF: func(ctrl *gomock.Controller) *manager { - preferred := ids.GenerateTestID() + lastAcceptedID := ids.GenerateTestID() // These values don't matter for this test state := state.NewMockState(ctrl) - state.EXPECT().GetLastAccepted().Return(preferred) + state.EXPECT().GetLastAccepted().Return(lastAcceptedID) state.EXPECT().GetTimestamp().Return(time.Time{}) return &manager{ @@ -173,8 +172,7 @@ func TestManagerVerifyTx(t *testing.T) { Bootstrapped: true, }, state: state, - lastAccepted: preferred, - preferred: preferred, + lastAccepted: lastAcceptedID, } }, expectedErr: errTestSemanticVerifyFail, @@ -194,11 +192,11 @@ func TestManagerVerifyTx(t *testing.T) { } }, managerF: func(ctrl *gomock.Controller) *manager { - preferred := ids.GenerateTestID() + lastAcceptedID := ids.GenerateTestID() // These values don't matter for this test state := state.NewMockState(ctrl) - state.EXPECT().GetLastAccepted().Return(preferred) + state.EXPECT().GetLastAccepted().Return(lastAcceptedID) state.EXPECT().GetTimestamp().Return(time.Time{}) return &manager{ @@ -206,57 +204,10 @@ func TestManagerVerifyTx(t *testing.T) { Bootstrapped: true, }, state: state, - lastAccepted: preferred, - preferred: preferred, - } - }, - expectedErr: errTestExecutionFail, - }, - { - name: "non-unique inputs", - txF: func(ctrl *gomock.Controller) *txs.Tx { - unsigned := txs.NewMockUnsignedTx(ctrl) - // Syntactic verification passes - unsigned.EXPECT().Visit(gomock.Any()).Return(nil) - // Semantic verification passes - unsigned.EXPECT().Visit(gomock.Any()).Return(nil) - // Execution passes - unsigned.EXPECT().Visit(gomock.Any()).DoAndReturn(func(e *executor.Executor) error { - e.Inputs.Add(inputID) - return nil - }) - return &txs.Tx{ - Unsigned: unsigned, - } - }, - managerF: func(ctrl *gomock.Controller) *manager { - lastAcceptedID := ids.GenerateTestID() - - preferredID := ids.GenerateTestID() - preferred := block.NewMockBlock(ctrl) - preferred.EXPECT().Parent().Return(lastAcceptedID).AnyTimes() - - // These values don't matter for this test - diffState := state.NewMockDiff(ctrl) - diffState.EXPECT().GetLastAccepted().Return(preferredID) - diffState.EXPECT().GetTimestamp().Return(time.Time{}) - - return &manager{ - backend: &executor.Backend{ - Bootstrapped: true, - }, - blkIDToState: map[ids.ID]*blockState{ - preferredID: { - statelessBlock: preferred, - onAcceptState: diffState, - importedInputs: set.Of(inputID), - }, - }, lastAccepted: lastAcceptedID, - preferred: preferredID, } }, - expectedErr: ErrConflictingParentTxs, + expectedErr: errTestExecutionFail, }, { name: "happy path", @@ -273,11 +224,11 @@ func TestManagerVerifyTx(t *testing.T) { } }, managerF: func(ctrl *gomock.Controller) *manager { - preferred := ids.GenerateTestID() + lastAcceptedID := ids.GenerateTestID() // These values don't matter for this test state := state.NewMockState(ctrl) - state.EXPECT().GetLastAccepted().Return(preferred) + state.EXPECT().GetLastAccepted().Return(lastAcceptedID) state.EXPECT().GetTimestamp().Return(time.Time{}) return &manager{ @@ -285,8 +236,7 @@ func TestManagerVerifyTx(t *testing.T) { Bootstrapped: true, }, state: state, - lastAccepted: preferred, - preferred: preferred, + lastAccepted: lastAcceptedID, } }, expectedErr: nil, From 561efd78323b25cf4849bcbdb45d6c9564a3ac00 Mon Sep 17 00:00:00 2001 From: Dhruba Basu <7675102+dhrubabasu@users.noreply.github.com> Date: Mon, 1 Jan 2024 11:06:37 -0500 Subject: [PATCH 14/57] Update `CODEOWNERS` (#2570) --- .github/CODEOWNERS | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 5df26b4a9d9a..c9737ad46f63 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -9,15 +9,14 @@ /message/ @gyuho /network/ @danlaine @joshua-kim @StephenButtolph /network/throttling/ @danlaine @dboehm-avalabs @StephenButtolph -/proto/ @gyuho @hexfusion +/proto/ @gyuho /snow/ @danlaine @StephenButtolph /snow/consensus/ @gyuho @StephenButtolph /snow/engine/snowman/syncer/ @abi87 /snow/uptime/ @ceyonur /utils/logging/ @ceyonur -/vms/platformvm/ @abi87 @danlaine @StephenButtolph +/vms/platformvm/ @abi87 @danlaine @dhrubabasu @StephenButtolph /vms/proposervm/ @abi87 @StephenButtolph -/vms/rpcchainvm/ @hexfusion @StephenButtolph /vms/registry/ @joshua-kim /tests/ @abi87 @gyuho @marun /x/ @danlaine @darioush @dboehm-avalabs From e26d9c9fdb2e288ccbebb17c6e50b5a175cc6c2d Mon Sep 17 00:00:00 2001 From: Dhruba Basu <7675102+dhrubabasu@users.noreply.github.com> Date: Tue, 2 Jan 2024 03:12:40 -0500 Subject: [PATCH 15/57] Remove license from mocks (#2574) --- api/server/mock_server.go | 3 -- chains/atomic/mock_shared_memory.go | 3 -- codec/mock_manager.go | 3 -- database/mock_batch.go | 3 -- database/mock_iterator.go | 3 -- indexer/indexer_test.go | 8 ++--- message/mock_message.go | 3 -- message/mock_outbound_message_builder.go | 3 -- scripts/mock.gen.sh | 10 ------ scripts/mocks.mockgen.txt | 8 ++--- snow/consensus/snowman/mock_block.go | 3 -- snow/engine/avalanche/vertex/mock_vm.go | 3 -- ...go => mock_build_block_with_context_vm.go} | 10 ++---- .../{mocks/chain_vm.go => mock_chain_vm.go} | 7 ++-- ...ncable_vm.go => mock_state_syncable_vm.go} | 24 ++++++-------- ...context.go => mock_with_verify_context.go} | 10 ++---- snow/engine/snowman/getter/getter_test.go | 5 ++- snow/networking/handler/mock_handler.go | 3 -- snow/networking/timeout/mock_manager.go | 3 -- .../tracker/mock_resource_tracker.go | 3 -- snow/networking/tracker/mock_targeter.go | 3 -- snow/uptime/mock_calculator.go | 3 -- snow/validators/mock_state.go | 3 -- snow/validators/mock_subnet_connector.go | 3 -- utils/crypto/keychain/mock_ledger.go | 3 -- utils/filesystem/mock_io.go | 3 -- utils/hashing/mock_hasher.go | 3 -- utils/resource/mock_user.go | 3 -- vms/avm/block/mock_block.go | 3 -- vms/avm/metrics/mock_metrics.go | 3 -- vms/avm/state/mock_state.go | 3 -- vms/avm/txs/mempool/mock_mempool.go | 3 -- vms/components/avax/mock_transferable_in.go | 3 -- vms/components/verify/mock_verifiable.go | 3 -- vms/mock_manager.go | 3 -- vms/platformvm/block/mock_block.go | 3 -- vms/platformvm/state/mock_staker_iterator.go | 3 -- vms/platformvm/state/mock_state.go | 3 -- vms/platformvm/txs/mempool/mock_mempool.go | 3 -- vms/platformvm/utxo/mock_verifier.go | 3 -- vms/proposervm/block_test.go | 7 ++-- vms/proposervm/mock_post_fork_block.go | 3 -- vms/proposervm/pre_fork_block_test.go | 11 ++++--- vms/proposervm/proposer/mock_windower.go | 3 -- vms/proposervm/scheduler/mock_scheduler.go | 3 -- vms/proposervm/state/mock_state.go | 3 -- vms/proposervm/vm_test.go | 13 ++++---- vms/registry/mock_vm_getter.go | 3 -- vms/registry/mock_vm_registerer.go | 3 -- vms/registry/mock_vm_registry.go | 3 -- vms/registry/vm_registerer_test.go | 26 +++++++-------- vms/rpcchainvm/batched_vm_test.go | 3 +- vms/rpcchainvm/state_syncable_vm_test.go | 33 +++++++++---------- vms/rpcchainvm/vm_test.go | 3 +- vms/rpcchainvm/with_context_vm_test.go | 13 ++++---- x/sync/mock_client.go | 3 -- 56 files changed, 80 insertions(+), 231 deletions(-) rename snow/engine/snowman/block/{mocks/build_block_with_context_vm.go => mock_build_block_with_context_vm.go} (86%) rename snow/engine/snowman/block/{mocks/chain_vm.go => mock_chain_vm.go} (98%) rename snow/engine/snowman/block/{mocks/state_syncable_vm.go => mock_state_syncable_vm.go} (87%) rename snow/engine/snowman/block/{mocks/with_verify_context.go => mock_with_verify_context.go} (89%) diff --git a/api/server/mock_server.go b/api/server/mock_server.go index 1d29c7054db3..b30b36e50ac8 100644 --- a/api/server/mock_server.go +++ b/api/server/mock_server.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/api/server (interfaces: Server) diff --git a/chains/atomic/mock_shared_memory.go b/chains/atomic/mock_shared_memory.go index d22bd0f995ff..b6afac750e70 100644 --- a/chains/atomic/mock_shared_memory.go +++ b/chains/atomic/mock_shared_memory.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/chains/atomic (interfaces: SharedMemory) diff --git a/codec/mock_manager.go b/codec/mock_manager.go index 91961806bf4f..53fe543f8984 100644 --- a/codec/mock_manager.go +++ b/codec/mock_manager.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/codec (interfaces: Manager) diff --git a/database/mock_batch.go b/database/mock_batch.go index b20ae92473f1..552d917fc95f 100644 --- a/database/mock_batch.go +++ b/database/mock_batch.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/database (interfaces: Batch) diff --git a/database/mock_iterator.go b/database/mock_iterator.go index 4fa36ae24f69..7703e89206a3 100644 --- a/database/mock_iterator.go +++ b/database/mock_iterator.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/database (interfaces: Iterator) diff --git a/indexer/indexer_test.go b/indexer/indexer_test.go index df9bce500eff..16c4aa7bc381 100644 --- a/indexer/indexer_test.go +++ b/indexer/indexer_test.go @@ -20,7 +20,7 @@ import ( "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/snow" "github.com/ava-labs/avalanchego/snow/engine/avalanche/vertex" - "github.com/ava-labs/avalanchego/snow/engine/snowman/block/mocks" + "github.com/ava-labs/avalanchego/snow/engine/snowman/block" "github.com/ava-labs/avalanchego/snow/snowtest" "github.com/ava-labs/avalanchego/utils" "github.com/ava-labs/avalanchego/utils/logging" @@ -163,7 +163,7 @@ func TestIndexer(t *testing.T) { require.False(previouslyIndexed) // Register this chain, creating a new index - chainVM := mocks.NewMockChainVM(ctrl) + chainVM := block.NewMockChainVM(ctrl) idxr.RegisterChain("chain1", chain1Ctx, chainVM) isIncomplete, err = idxr.isIncomplete(chain1Ctx.ChainID) require.NoError(err) @@ -426,7 +426,7 @@ func TestIncompleteIndex(t *testing.T) { previouslyIndexed, err := idxr.previouslyIndexed(chain1Ctx.ChainID) require.NoError(err) require.False(previouslyIndexed) - chainVM := mocks.NewMockChainVM(ctrl) + chainVM := block.NewMockChainVM(ctrl) idxr.RegisterChain("chain1", chain1Ctx, chainVM) isIncomplete, err = idxr.isIncomplete(chain1Ctx.ChainID) require.NoError(err) @@ -507,7 +507,7 @@ func TestIgnoreNonDefaultChains(t *testing.T) { }) // RegisterChain should return without adding an index for this chain - chainVM := mocks.NewMockChainVM(ctrl) + chainVM := block.NewMockChainVM(ctrl) idxr.RegisterChain("chain1", chain1Ctx, chainVM) require.Empty(idxr.blockIndices) } diff --git a/message/mock_message.go b/message/mock_message.go index 938a90edbb8e..e52a665b7575 100644 --- a/message/mock_message.go +++ b/message/mock_message.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/message (interfaces: OutboundMessage) diff --git a/message/mock_outbound_message_builder.go b/message/mock_outbound_message_builder.go index 1da9934d177f..50af02669546 100644 --- a/message/mock_outbound_message_builder.go +++ b/message/mock_outbound_message_builder.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/message (interfaces: OutboundMsgBuilder) diff --git a/scripts/mock.gen.sh b/scripts/mock.gen.sh index 855dbc94b304..c3feff7a545c 100755 --- a/scripts/mock.gen.sh +++ b/scripts/mock.gen.sh @@ -14,13 +14,6 @@ then go install -v go.uber.org/mock/mockgen@v0.2.0 fi -if ! command -v go-license &> /dev/null -then - echo "go-license not found, installing..." - # https://github.com/palantir/go-license - go install -v github.com/palantir/go-license@v1.25.0 -fi - source ./scripts/constants.sh # tuples of (source interface import path, comma-separated interface names, output file path) @@ -32,9 +25,6 @@ do echo "Generating ${output_path}..." mockgen -package=${package_name} -destination=${output_path} ${src_import_path} ${interface_name} - go-license \ - --config=./header.yml \ - "${output_path}" done < "$input" echo "SUCCESS" diff --git a/scripts/mocks.mockgen.txt b/scripts/mocks.mockgen.txt index 2fbfa5b255ab..c3bb7d3ffd24 100644 --- a/scripts/mocks.mockgen.txt +++ b/scripts/mocks.mockgen.txt @@ -7,10 +7,10 @@ github.com/ava-labs/avalanchego/message=OutboundMessage=message/mock_message.go github.com/ava-labs/avalanchego/message=OutboundMsgBuilder=message/mock_outbound_message_builder.go github.com/ava-labs/avalanchego/snow/consensus/snowman=Block=snow/consensus/snowman/mock_block.go github.com/ava-labs/avalanchego/snow/engine/avalanche/vertex=LinearizableVM=snow/engine/avalanche/vertex/mock_vm.go -github.com/ava-labs/avalanchego/snow/engine/snowman/block=BuildBlockWithContextChainVM=snow/engine/snowman/block/mocks/build_block_with_context_vm.go -github.com/ava-labs/avalanchego/snow/engine/snowman/block=ChainVM=snow/engine/snowman/block/mocks/chain_vm.go -github.com/ava-labs/avalanchego/snow/engine/snowman/block=StateSyncableVM=snow/engine/snowman/block/mocks/state_syncable_vm.go -github.com/ava-labs/avalanchego/snow/engine/snowman/block=WithVerifyContext=snow/engine/snowman/block/mocks/with_verify_context.go +github.com/ava-labs/avalanchego/snow/engine/snowman/block=BuildBlockWithContextChainVM=snow/engine/snowman/block/mock_build_block_with_context_vm.go +github.com/ava-labs/avalanchego/snow/engine/snowman/block=ChainVM=snow/engine/snowman/block/mock_chain_vm.go +github.com/ava-labs/avalanchego/snow/engine/snowman/block=StateSyncableVM=snow/engine/snowman/block/mock_state_syncable_vm.go +github.com/ava-labs/avalanchego/snow/engine/snowman/block=WithVerifyContext=snow/engine/snowman/block/mock_with_verify_context.go github.com/ava-labs/avalanchego/snow/networking/handler=Handler=snow/networking/handler/mock_handler.go github.com/ava-labs/avalanchego/snow/networking/timeout=Manager=snow/networking/timeout/mock_manager.go github.com/ava-labs/avalanchego/snow/networking/tracker=Targeter=snow/networking/tracker/mock_targeter.go diff --git a/snow/consensus/snowman/mock_block.go b/snow/consensus/snowman/mock_block.go index f5b7422190e5..164df8d45e80 100644 --- a/snow/consensus/snowman/mock_block.go +++ b/snow/consensus/snowman/mock_block.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/snow/consensus/snowman (interfaces: Block) diff --git a/snow/engine/avalanche/vertex/mock_vm.go b/snow/engine/avalanche/vertex/mock_vm.go index 045b275586d0..b0c4362b4551 100644 --- a/snow/engine/avalanche/vertex/mock_vm.go +++ b/snow/engine/avalanche/vertex/mock_vm.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/snow/engine/avalanche/vertex (interfaces: LinearizableVM) diff --git a/snow/engine/snowman/block/mocks/build_block_with_context_vm.go b/snow/engine/snowman/block/mock_build_block_with_context_vm.go similarity index 86% rename from snow/engine/snowman/block/mocks/build_block_with_context_vm.go rename to snow/engine/snowman/block/mock_build_block_with_context_vm.go index 2a72ada73e2c..9cb5f3e77833 100644 --- a/snow/engine/snowman/block/mocks/build_block_with_context_vm.go +++ b/snow/engine/snowman/block/mock_build_block_with_context_vm.go @@ -1,18 +1,14 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/snow/engine/snowman/block (interfaces: BuildBlockWithContextChainVM) -// Package mocks is a generated GoMock package. -package mocks +// Package block is a generated GoMock package. +package block import ( context "context" reflect "reflect" snowman "github.com/ava-labs/avalanchego/snow/consensus/snowman" - block "github.com/ava-labs/avalanchego/snow/engine/snowman/block" gomock "go.uber.org/mock/gomock" ) @@ -40,7 +36,7 @@ func (m *MockBuildBlockWithContextChainVM) EXPECT() *MockBuildBlockWithContextCh } // BuildBlockWithContext mocks base method. -func (m *MockBuildBlockWithContextChainVM) BuildBlockWithContext(arg0 context.Context, arg1 *block.Context) (snowman.Block, error) { +func (m *MockBuildBlockWithContextChainVM) BuildBlockWithContext(arg0 context.Context, arg1 *Context) (snowman.Block, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "BuildBlockWithContext", arg0, arg1) ret0, _ := ret[0].(snowman.Block) diff --git a/snow/engine/snowman/block/mocks/chain_vm.go b/snow/engine/snowman/block/mock_chain_vm.go similarity index 98% rename from snow/engine/snowman/block/mocks/chain_vm.go rename to snow/engine/snowman/block/mock_chain_vm.go index fc75a0f344a8..27b6aef75ed6 100644 --- a/snow/engine/snowman/block/mocks/chain_vm.go +++ b/snow/engine/snowman/block/mock_chain_vm.go @@ -1,11 +1,8 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/snow/engine/snowman/block (interfaces: ChainVM) -// Package mocks is a generated GoMock package. -package mocks +// Package block is a generated GoMock package. +package block import ( context "context" diff --git a/snow/engine/snowman/block/mocks/state_syncable_vm.go b/snow/engine/snowman/block/mock_state_syncable_vm.go similarity index 87% rename from snow/engine/snowman/block/mocks/state_syncable_vm.go rename to snow/engine/snowman/block/mock_state_syncable_vm.go index 50a1fe92e117..f728b9b5a7a7 100644 --- a/snow/engine/snowman/block/mocks/state_syncable_vm.go +++ b/snow/engine/snowman/block/mock_state_syncable_vm.go @@ -1,17 +1,13 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/snow/engine/snowman/block (interfaces: StateSyncableVM) -// Package mocks is a generated GoMock package. -package mocks +// Package block is a generated GoMock package. +package block import ( context "context" reflect "reflect" - block "github.com/ava-labs/avalanchego/snow/engine/snowman/block" gomock "go.uber.org/mock/gomock" ) @@ -39,10 +35,10 @@ func (m *MockStateSyncableVM) EXPECT() *MockStateSyncableVMMockRecorder { } // GetLastStateSummary mocks base method. -func (m *MockStateSyncableVM) GetLastStateSummary(arg0 context.Context) (block.StateSummary, error) { +func (m *MockStateSyncableVM) GetLastStateSummary(arg0 context.Context) (StateSummary, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetLastStateSummary", arg0) - ret0, _ := ret[0].(block.StateSummary) + ret0, _ := ret[0].(StateSummary) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -54,10 +50,10 @@ func (mr *MockStateSyncableVMMockRecorder) GetLastStateSummary(arg0 interface{}) } // GetOngoingSyncStateSummary mocks base method. -func (m *MockStateSyncableVM) GetOngoingSyncStateSummary(arg0 context.Context) (block.StateSummary, error) { +func (m *MockStateSyncableVM) GetOngoingSyncStateSummary(arg0 context.Context) (StateSummary, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetOngoingSyncStateSummary", arg0) - ret0, _ := ret[0].(block.StateSummary) + ret0, _ := ret[0].(StateSummary) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -69,10 +65,10 @@ func (mr *MockStateSyncableVMMockRecorder) GetOngoingSyncStateSummary(arg0 inter } // GetStateSummary mocks base method. -func (m *MockStateSyncableVM) GetStateSummary(arg0 context.Context, arg1 uint64) (block.StateSummary, error) { +func (m *MockStateSyncableVM) GetStateSummary(arg0 context.Context, arg1 uint64) (StateSummary, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetStateSummary", arg0, arg1) - ret0, _ := ret[0].(block.StateSummary) + ret0, _ := ret[0].(StateSummary) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -84,10 +80,10 @@ func (mr *MockStateSyncableVMMockRecorder) GetStateSummary(arg0, arg1 interface{ } // ParseStateSummary mocks base method. -func (m *MockStateSyncableVM) ParseStateSummary(arg0 context.Context, arg1 []byte) (block.StateSummary, error) { +func (m *MockStateSyncableVM) ParseStateSummary(arg0 context.Context, arg1 []byte) (StateSummary, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ParseStateSummary", arg0, arg1) - ret0, _ := ret[0].(block.StateSummary) + ret0, _ := ret[0].(StateSummary) ret1, _ := ret[1].(error) return ret0, ret1 } diff --git a/snow/engine/snowman/block/mocks/with_verify_context.go b/snow/engine/snowman/block/mock_with_verify_context.go similarity index 89% rename from snow/engine/snowman/block/mocks/with_verify_context.go rename to snow/engine/snowman/block/mock_with_verify_context.go index ea509980f130..23ce5a2fd4d5 100644 --- a/snow/engine/snowman/block/mocks/with_verify_context.go +++ b/snow/engine/snowman/block/mock_with_verify_context.go @@ -1,17 +1,13 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/snow/engine/snowman/block (interfaces: WithVerifyContext) -// Package mocks is a generated GoMock package. -package mocks +// Package block is a generated GoMock package. +package block import ( context "context" reflect "reflect" - block "github.com/ava-labs/avalanchego/snow/engine/snowman/block" gomock "go.uber.org/mock/gomock" ) @@ -54,7 +50,7 @@ func (mr *MockWithVerifyContextMockRecorder) ShouldVerifyWithContext(arg0 interf } // VerifyWithContext mocks base method. -func (m *MockWithVerifyContext) VerifyWithContext(arg0 context.Context, arg1 *block.Context) error { +func (m *MockWithVerifyContext) VerifyWithContext(arg0 context.Context, arg1 *Context) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "VerifyWithContext", arg0, arg1) ret0, _ := ret[0].(error) diff --git a/snow/engine/snowman/getter/getter_test.go b/snow/engine/snowman/getter/getter_test.go index 12ecd1abdd80..1e0647b1911e 100644 --- a/snow/engine/snowman/getter/getter_test.go +++ b/snow/engine/snowman/getter/getter_test.go @@ -20,7 +20,6 @@ import ( "github.com/ava-labs/avalanchego/snow/consensus/snowman" "github.com/ava-labs/avalanchego/snow/engine/common" "github.com/ava-labs/avalanchego/snow/engine/snowman/block" - "github.com/ava-labs/avalanchego/snow/engine/snowman/block/mocks" "github.com/ava-labs/avalanchego/utils/logging" "github.com/ava-labs/avalanchego/utils/set" ) @@ -29,7 +28,7 @@ var errUnknownBlock = errors.New("unknown block") type StateSyncEnabledMock struct { *block.TestVM - *mocks.MockStateSyncableVM + *block.MockStateSyncableVM } func newTest(t *testing.T) (common.AllGetsServer, StateSyncEnabledMock, *common.SenderTest) { @@ -37,7 +36,7 @@ func newTest(t *testing.T) (common.AllGetsServer, StateSyncEnabledMock, *common. vm := StateSyncEnabledMock{ TestVM: &block.TestVM{}, - MockStateSyncableVM: mocks.NewMockStateSyncableVM(ctrl), + MockStateSyncableVM: block.NewMockStateSyncableVM(ctrl), } sender := &common.SenderTest{ diff --git a/snow/networking/handler/mock_handler.go b/snow/networking/handler/mock_handler.go index dd231641e8ac..3346da7960d8 100644 --- a/snow/networking/handler/mock_handler.go +++ b/snow/networking/handler/mock_handler.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/snow/networking/handler (interfaces: Handler) diff --git a/snow/networking/timeout/mock_manager.go b/snow/networking/timeout/mock_manager.go index 5a1bda7cb0b6..1033ad335afe 100644 --- a/snow/networking/timeout/mock_manager.go +++ b/snow/networking/timeout/mock_manager.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/snow/networking/timeout (interfaces: Manager) diff --git a/snow/networking/tracker/mock_resource_tracker.go b/snow/networking/tracker/mock_resource_tracker.go index 4ba16ec98997..cfe8d59bdcd0 100644 --- a/snow/networking/tracker/mock_resource_tracker.go +++ b/snow/networking/tracker/mock_resource_tracker.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/snow/networking/tracker (interfaces: Tracker) diff --git a/snow/networking/tracker/mock_targeter.go b/snow/networking/tracker/mock_targeter.go index d6fe7b540c8f..165bf7a95c59 100644 --- a/snow/networking/tracker/mock_targeter.go +++ b/snow/networking/tracker/mock_targeter.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/snow/networking/tracker (interfaces: Targeter) diff --git a/snow/uptime/mock_calculator.go b/snow/uptime/mock_calculator.go index 389c029e68fe..f0ece236f88c 100644 --- a/snow/uptime/mock_calculator.go +++ b/snow/uptime/mock_calculator.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/snow/uptime (interfaces: Calculator) diff --git a/snow/validators/mock_state.go b/snow/validators/mock_state.go index a438b0eb46ef..07447721c28c 100644 --- a/snow/validators/mock_state.go +++ b/snow/validators/mock_state.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/snow/validators (interfaces: State) diff --git a/snow/validators/mock_subnet_connector.go b/snow/validators/mock_subnet_connector.go index e5c985bd56cc..4719be84ef88 100644 --- a/snow/validators/mock_subnet_connector.go +++ b/snow/validators/mock_subnet_connector.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/snow/validators (interfaces: SubnetConnector) diff --git a/utils/crypto/keychain/mock_ledger.go b/utils/crypto/keychain/mock_ledger.go index 8f270bfbc032..d17500564097 100644 --- a/utils/crypto/keychain/mock_ledger.go +++ b/utils/crypto/keychain/mock_ledger.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/utils/crypto/keychain (interfaces: Ledger) diff --git a/utils/filesystem/mock_io.go b/utils/filesystem/mock_io.go index 9ec15c548e39..43f28011cbfb 100644 --- a/utils/filesystem/mock_io.go +++ b/utils/filesystem/mock_io.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/utils/filesystem (interfaces: Reader) diff --git a/utils/hashing/mock_hasher.go b/utils/hashing/mock_hasher.go index 26b4130c5d72..bc9a0abed2d0 100644 --- a/utils/hashing/mock_hasher.go +++ b/utils/hashing/mock_hasher.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/utils/hashing (interfaces: Hasher) diff --git a/utils/resource/mock_user.go b/utils/resource/mock_user.go index 64b156ac1c1f..28f0059e1c88 100644 --- a/utils/resource/mock_user.go +++ b/utils/resource/mock_user.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/utils/resource (interfaces: User) diff --git a/vms/avm/block/mock_block.go b/vms/avm/block/mock_block.go index 770dbae29b7d..296fc149f253 100644 --- a/vms/avm/block/mock_block.go +++ b/vms/avm/block/mock_block.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms/avm/block (interfaces: Block) diff --git a/vms/avm/metrics/mock_metrics.go b/vms/avm/metrics/mock_metrics.go index b83a065e3fa0..25ae52fef2d0 100644 --- a/vms/avm/metrics/mock_metrics.go +++ b/vms/avm/metrics/mock_metrics.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms/avm/metrics (interfaces: Metrics) diff --git a/vms/avm/state/mock_state.go b/vms/avm/state/mock_state.go index 3bb615283ce6..162f6328ccdb 100644 --- a/vms/avm/state/mock_state.go +++ b/vms/avm/state/mock_state.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms/avm/state (interfaces: Chain,State,Diff) diff --git a/vms/avm/txs/mempool/mock_mempool.go b/vms/avm/txs/mempool/mock_mempool.go index 15125b1ce675..b94d2db095bf 100644 --- a/vms/avm/txs/mempool/mock_mempool.go +++ b/vms/avm/txs/mempool/mock_mempool.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms/avm/txs/mempool (interfaces: Mempool) diff --git a/vms/components/avax/mock_transferable_in.go b/vms/components/avax/mock_transferable_in.go index cfd7e419dc26..cbe350801e3b 100644 --- a/vms/components/avax/mock_transferable_in.go +++ b/vms/components/avax/mock_transferable_in.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms/components/avax (interfaces: TransferableIn) diff --git a/vms/components/verify/mock_verifiable.go b/vms/components/verify/mock_verifiable.go index 915491142014..3b2609f6eb0f 100644 --- a/vms/components/verify/mock_verifiable.go +++ b/vms/components/verify/mock_verifiable.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms/components/verify (interfaces: Verifiable) diff --git a/vms/mock_manager.go b/vms/mock_manager.go index 9726f085c513..70f3dc5ca840 100644 --- a/vms/mock_manager.go +++ b/vms/mock_manager.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms (interfaces: Factory,Manager) diff --git a/vms/platformvm/block/mock_block.go b/vms/platformvm/block/mock_block.go index 9cc2541de0d2..fde27ecbdc04 100644 --- a/vms/platformvm/block/mock_block.go +++ b/vms/platformvm/block/mock_block.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms/platformvm/block (interfaces: Block) diff --git a/vms/platformvm/state/mock_staker_iterator.go b/vms/platformvm/state/mock_staker_iterator.go index 6ef7e9fb2d51..a04f79c628da 100644 --- a/vms/platformvm/state/mock_staker_iterator.go +++ b/vms/platformvm/state/mock_staker_iterator.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms/platformvm/state (interfaces: StakerIterator) diff --git a/vms/platformvm/state/mock_state.go b/vms/platformvm/state/mock_state.go index 8a3aac7d81f1..051bc729ac21 100644 --- a/vms/platformvm/state/mock_state.go +++ b/vms/platformvm/state/mock_state.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms/platformvm/state (interfaces: Chain,Diff,State,Versions) diff --git a/vms/platformvm/txs/mempool/mock_mempool.go b/vms/platformvm/txs/mempool/mock_mempool.go index 949d99f1b41d..0cfd9b141def 100644 --- a/vms/platformvm/txs/mempool/mock_mempool.go +++ b/vms/platformvm/txs/mempool/mock_mempool.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms/platformvm/txs/mempool (interfaces: Mempool) diff --git a/vms/platformvm/utxo/mock_verifier.go b/vms/platformvm/utxo/mock_verifier.go index 1c1d9c9c75f9..15766981f685 100644 --- a/vms/platformvm/utxo/mock_verifier.go +++ b/vms/platformvm/utxo/mock_verifier.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms/platformvm/utxo (interfaces: Verifier) diff --git a/vms/proposervm/block_test.go b/vms/proposervm/block_test.go index 8297e3681b2c..35e3da7deee4 100644 --- a/vms/proposervm/block_test.go +++ b/vms/proposervm/block_test.go @@ -21,7 +21,6 @@ import ( "github.com/ava-labs/avalanchego/snow/choices" "github.com/ava-labs/avalanchego/snow/consensus/snowman" "github.com/ava-labs/avalanchego/snow/engine/snowman/block" - "github.com/ava-labs/avalanchego/snow/engine/snowman/block/mocks" "github.com/ava-labs/avalanchego/snow/validators" "github.com/ava-labs/avalanchego/staking" "github.com/ava-labs/avalanchego/utils/logging" @@ -56,8 +55,8 @@ func TestPostForkCommonComponents_buildChild(t *testing.T) { builtBlk.EXPECT().ID().Return(ids.GenerateTestID()).AnyTimes() builtBlk.EXPECT().Height().Return(pChainHeight).AnyTimes() - innerVM := mocks.NewMockChainVM(ctrl) - innerBlockBuilderVM := mocks.NewMockBuildBlockWithContextChainVM(ctrl) + innerVM := block.NewMockChainVM(ctrl) + innerBlockBuilderVM := block.NewMockBuildBlockWithContextChainVM(ctrl) innerBlockBuilderVM.EXPECT().BuildBlockWithContext(gomock.Any(), &block.Context{ PChainHeight: pChainHeight - 1, }).Return(builtBlk, nil).AnyTimes() @@ -410,7 +409,7 @@ func TestPostDurangoBuildChildResetScheduler(t *testing.T) { StakingCertLeaf: &staking.Certificate{}, StakingLeafSigner: pk, }, - ChainVM: mocks.NewMockChainVM(ctrl), + ChainVM: block.NewMockChainVM(ctrl), ctx: &snow.Context{ NodeID: thisNodeID, ValidatorState: vdrState, diff --git a/vms/proposervm/mock_post_fork_block.go b/vms/proposervm/mock_post_fork_block.go index 4f0847424253..23c87ea5fa00 100644 --- a/vms/proposervm/mock_post_fork_block.go +++ b/vms/proposervm/mock_post_fork_block.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms/proposervm (interfaces: PostForkBlock) diff --git a/vms/proposervm/pre_fork_block_test.go b/vms/proposervm/pre_fork_block_test.go index 42dfe14789f5..6215a5c8465d 100644 --- a/vms/proposervm/pre_fork_block_test.go +++ b/vms/proposervm/pre_fork_block_test.go @@ -18,11 +18,12 @@ import ( "github.com/ava-labs/avalanchego/snow" "github.com/ava-labs/avalanchego/snow/choices" "github.com/ava-labs/avalanchego/snow/consensus/snowman" - "github.com/ava-labs/avalanchego/snow/engine/snowman/block/mocks" + "github.com/ava-labs/avalanchego/snow/engine/snowman/block" "github.com/ava-labs/avalanchego/snow/validators" "github.com/ava-labs/avalanchego/utils/logging" "github.com/ava-labs/avalanchego/utils/timer/mockable" - "github.com/ava-labs/avalanchego/vms/proposervm/block" + + statelessblock "github.com/ava-labs/avalanchego/vms/proposervm/block" ) func TestOracle_PreForkBlkImplementsInterface(t *testing.T) { @@ -353,7 +354,7 @@ func TestBlockVerify_BlocksBuiltOnPreForkGenesis(t *testing.T) { require.NoError(preForkChild.Verify(context.Background())) // postFork block does NOT verify if parent is before fork activation time - postForkStatelessChild, err := block.Build( + postForkStatelessChild, err := statelessblock.Build( coreGenBlk.ID(), coreBlk.Timestamp(), 0, // pChainHeight @@ -768,7 +769,7 @@ func TestBlockVerify_ForkBlockIsOracleBlockButChildrenAreSigned(t *testing.T) { require.NoError(firstBlock.Verify(context.Background())) - slb, err := block.Build( + slb, err := statelessblock.Build( firstBlock.ID(), // refer unknown parent firstBlock.Timestamp(), 0, // pChainHeight, @@ -805,7 +806,7 @@ func TestPreForkBlock_BuildBlockWithContext(t *testing.T) { builtBlk.EXPECT().Bytes().Return([]byte{1, 2, 3}).AnyTimes() builtBlk.EXPECT().ID().Return(ids.GenerateTestID()).AnyTimes() builtBlk.EXPECT().Height().Return(pChainHeight).AnyTimes() - innerVM := mocks.NewMockChainVM(ctrl) + innerVM := block.NewMockChainVM(ctrl) innerVM.EXPECT().BuildBlock(gomock.Any()).Return(builtBlk, nil).AnyTimes() vdrState := validators.NewMockState(ctrl) vdrState.EXPECT().GetMinimumHeight(context.Background()).Return(pChainHeight, nil).AnyTimes() diff --git a/vms/proposervm/proposer/mock_windower.go b/vms/proposervm/proposer/mock_windower.go index 7df10ee28bcf..d5e142b93791 100644 --- a/vms/proposervm/proposer/mock_windower.go +++ b/vms/proposervm/proposer/mock_windower.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms/proposervm/proposer (interfaces: Windower) diff --git a/vms/proposervm/scheduler/mock_scheduler.go b/vms/proposervm/scheduler/mock_scheduler.go index bb4c19b941f1..9018cad9b5ff 100644 --- a/vms/proposervm/scheduler/mock_scheduler.go +++ b/vms/proposervm/scheduler/mock_scheduler.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms/proposervm/scheduler (interfaces: Scheduler) diff --git a/vms/proposervm/state/mock_state.go b/vms/proposervm/state/mock_state.go index 40ef830a1365..fcd266f2d790 100644 --- a/vms/proposervm/state/mock_state.go +++ b/vms/proposervm/state/mock_state.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms/proposervm/state (interfaces: State) diff --git a/vms/proposervm/vm_test.go b/vms/proposervm/vm_test.go index 8308141b6622..04d1e1c35810 100644 --- a/vms/proposervm/vm_test.go +++ b/vms/proposervm/vm_test.go @@ -25,7 +25,6 @@ import ( "github.com/ava-labs/avalanchego/snow/consensus/snowman" "github.com/ava-labs/avalanchego/snow/engine/common" "github.com/ava-labs/avalanchego/snow/engine/snowman/block" - "github.com/ava-labs/avalanchego/snow/engine/snowman/block/mocks" "github.com/ava-labs/avalanchego/snow/snowtest" "github.com/ava-labs/avalanchego/snow/validators" "github.com/ava-labs/avalanchego/staking" @@ -2268,7 +2267,7 @@ func TestVMInnerBlkCache(t *testing.T) { ctrl := gomock.NewController(t) // Create a VM - innerVM := mocks.NewMockChainVM(ctrl) + innerVM := block.NewMockChainVM(ctrl) vm := New( innerVM, Config{ @@ -2495,7 +2494,7 @@ func TestVMInnerBlkMarkedAcceptedRegression(t *testing.T) { type blockWithVerifyContext struct { *snowman.MockBlock - *mocks.MockWithVerifyContext + *block.MockWithVerifyContext } // Ensures that we call [VerifyWithContext] rather than [Verify] on blocks that @@ -2506,7 +2505,7 @@ func TestVM_VerifyBlockWithContext(t *testing.T) { ctrl := gomock.NewController(t) // Create a VM - innerVM := mocks.NewMockChainVM(ctrl) + innerVM := block.NewMockChainVM(ctrl) vm := New( innerVM, Config{ @@ -2566,7 +2565,7 @@ func TestVM_VerifyBlockWithContext(t *testing.T) { pChainHeight := uint64(0) innerBlk := blockWithVerifyContext{ MockBlock: snowman.NewMockBlock(ctrl), - MockWithVerifyContext: mocks.NewMockWithVerifyContext(ctrl), + MockWithVerifyContext: block.NewMockWithVerifyContext(ctrl), } innerBlk.MockWithVerifyContext.EXPECT().ShouldVerifyWithContext(gomock.Any()).Return(true, nil).Times(2) innerBlk.MockWithVerifyContext.EXPECT().VerifyWithContext(context.Background(), @@ -2614,7 +2613,7 @@ func TestVM_VerifyBlockWithContext(t *testing.T) { // false for ShouldVerifyWithContext innerBlk := blockWithVerifyContext{ MockBlock: snowman.NewMockBlock(ctrl), - MockWithVerifyContext: mocks.NewMockWithVerifyContext(ctrl), + MockWithVerifyContext: block.NewMockWithVerifyContext(ctrl), } innerBlk.MockWithVerifyContext.EXPECT().ShouldVerifyWithContext(gomock.Any()).Return(false, nil) innerBlk.MockBlock.EXPECT().Verify(gomock.Any()).Return(nil) @@ -2637,7 +2636,7 @@ func TestVM_VerifyBlockWithContext(t *testing.T) { // Ensure we call Verify on a block that doesn't have a valid context innerBlk := blockWithVerifyContext{ MockBlock: snowman.NewMockBlock(ctrl), - MockWithVerifyContext: mocks.NewMockWithVerifyContext(ctrl), + MockWithVerifyContext: block.NewMockWithVerifyContext(ctrl), } innerBlk.MockBlock.EXPECT().Verify(gomock.Any()).Return(nil) innerBlk.MockBlock.EXPECT().Parent().Return(ids.GenerateTestID()).AnyTimes() diff --git a/vms/registry/mock_vm_getter.go b/vms/registry/mock_vm_getter.go index 52a1d67fc61a..1645c521c518 100644 --- a/vms/registry/mock_vm_getter.go +++ b/vms/registry/mock_vm_getter.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms/registry (interfaces: VMGetter) diff --git a/vms/registry/mock_vm_registerer.go b/vms/registry/mock_vm_registerer.go index 563893d765ed..dbddd9ec02c3 100644 --- a/vms/registry/mock_vm_registerer.go +++ b/vms/registry/mock_vm_registerer.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms/registry (interfaces: VMRegisterer) diff --git a/vms/registry/mock_vm_registry.go b/vms/registry/mock_vm_registry.go index 32360ab1b169..eb54c8e65aab 100644 --- a/vms/registry/mock_vm_registry.go +++ b/vms/registry/mock_vm_registry.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms/registry (interfaces: VMRegistry) diff --git a/vms/registry/vm_registerer_test.go b/vms/registry/vm_registerer_test.go index f5ad6c2f1349..a8910d4c33ad 100644 --- a/vms/registry/vm_registerer_test.go +++ b/vms/registry/vm_registerer_test.go @@ -15,7 +15,7 @@ import ( "github.com/ava-labs/avalanchego/api/server" "github.com/ava-labs/avalanchego/ids" - "github.com/ava-labs/avalanchego/snow/engine/snowman/block/mocks" + "github.com/ava-labs/avalanchego/snow/engine/snowman/block" "github.com/ava-labs/avalanchego/utils/constants" "github.com/ava-labs/avalanchego/utils/logging" "github.com/ava-labs/avalanchego/vms" @@ -56,7 +56,7 @@ func TestRegisterCreateHandlersAndShutdownFails(t *testing.T) { resources := initRegistererTest(t) vmFactory := vms.NewMockFactory(resources.ctrl) - vm := mocks.NewMockChainVM(resources.ctrl) + vm := block.NewMockChainVM(resources.ctrl) resources.mockManager.EXPECT().RegisterFactory(gomock.Any(), id, vmFactory).Times(1).Return(nil) vmFactory.EXPECT().New(logging.NoLog{}).Times(1).Return(vm, nil) @@ -73,7 +73,7 @@ func TestRegisterCreateHandlersFails(t *testing.T) { resources := initRegistererTest(t) vmFactory := vms.NewMockFactory(resources.ctrl) - vm := mocks.NewMockChainVM(resources.ctrl) + vm := block.NewMockChainVM(resources.ctrl) resources.mockManager.EXPECT().RegisterFactory(gomock.Any(), id, vmFactory).Times(1).Return(nil) vmFactory.EXPECT().New(logging.NoLog{}).Times(1).Return(vm, nil) @@ -90,7 +90,7 @@ func TestRegisterAddRouteFails(t *testing.T) { resources := initRegistererTest(t) vmFactory := vms.NewMockFactory(resources.ctrl) - vm := mocks.NewMockChainVM(resources.ctrl) + vm := block.NewMockChainVM(resources.ctrl) handlers := map[string]http.Handler{ "foo": nil, @@ -118,7 +118,7 @@ func TestRegisterAliasLookupFails(t *testing.T) { resources := initRegistererTest(t) vmFactory := vms.NewMockFactory(resources.ctrl) - vm := mocks.NewMockChainVM(resources.ctrl) + vm := block.NewMockChainVM(resources.ctrl) handlers := map[string]http.Handler{ "foo": nil, @@ -147,7 +147,7 @@ func TestRegisterAddAliasesFails(t *testing.T) { resources := initRegistererTest(t) vmFactory := vms.NewMockFactory(resources.ctrl) - vm := mocks.NewMockChainVM(resources.ctrl) + vm := block.NewMockChainVM(resources.ctrl) handlers := map[string]http.Handler{ "foo": nil, @@ -184,7 +184,7 @@ func TestRegisterHappyCase(t *testing.T) { resources := initRegistererTest(t) vmFactory := vms.NewMockFactory(resources.ctrl) - vm := mocks.NewMockChainVM(resources.ctrl) + vm := block.NewMockChainVM(resources.ctrl) handlers := map[string]http.Handler{ "foo": nil, @@ -248,7 +248,7 @@ func TestRegisterWithReadLockCreateHandlersAndShutdownFails(t *testing.T) { resources := initRegistererTest(t) vmFactory := vms.NewMockFactory(resources.ctrl) - vm := mocks.NewMockChainVM(resources.ctrl) + vm := block.NewMockChainVM(resources.ctrl) resources.mockManager.EXPECT().RegisterFactory(gomock.Any(), id, vmFactory).Times(1).Return(nil) vmFactory.EXPECT().New(logging.NoLog{}).Times(1).Return(vm, nil) @@ -265,7 +265,7 @@ func TestRegisterWithReadLockCreateHandlersFails(t *testing.T) { resources := initRegistererTest(t) vmFactory := vms.NewMockFactory(resources.ctrl) - vm := mocks.NewMockChainVM(resources.ctrl) + vm := block.NewMockChainVM(resources.ctrl) resources.mockManager.EXPECT().RegisterFactory(gomock.Any(), id, vmFactory).Times(1).Return(nil) vmFactory.EXPECT().New(logging.NoLog{}).Times(1).Return(vm, nil) @@ -282,7 +282,7 @@ func TestRegisterWithReadLockAddRouteWithReadLockFails(t *testing.T) { resources := initRegistererTest(t) vmFactory := vms.NewMockFactory(resources.ctrl) - vm := mocks.NewMockChainVM(resources.ctrl) + vm := block.NewMockChainVM(resources.ctrl) handlers := map[string]http.Handler{ "foo": nil, @@ -310,7 +310,7 @@ func TestRegisterWithReadLockAliasLookupFails(t *testing.T) { resources := initRegistererTest(t) vmFactory := vms.NewMockFactory(resources.ctrl) - vm := mocks.NewMockChainVM(resources.ctrl) + vm := block.NewMockChainVM(resources.ctrl) handlers := map[string]http.Handler{ "foo": nil, @@ -339,7 +339,7 @@ func TestRegisterWithReadLockAddAliasesFails(t *testing.T) { resources := initRegistererTest(t) vmFactory := vms.NewMockFactory(resources.ctrl) - vm := mocks.NewMockChainVM(resources.ctrl) + vm := block.NewMockChainVM(resources.ctrl) handlers := map[string]http.Handler{ "foo": nil, @@ -376,7 +376,7 @@ func TestRegisterWithReadLockHappyCase(t *testing.T) { resources := initRegistererTest(t) vmFactory := vms.NewMockFactory(resources.ctrl) - vm := mocks.NewMockChainVM(resources.ctrl) + vm := block.NewMockChainVM(resources.ctrl) handlers := map[string]http.Handler{ "foo": nil, diff --git a/vms/rpcchainvm/batched_vm_test.go b/vms/rpcchainvm/batched_vm_test.go index c00ca4e6fc60..ebe5d68bc2a1 100644 --- a/vms/rpcchainvm/batched_vm_test.go +++ b/vms/rpcchainvm/batched_vm_test.go @@ -17,7 +17,6 @@ import ( "github.com/ava-labs/avalanchego/snow/choices" "github.com/ava-labs/avalanchego/snow/consensus/snowman" "github.com/ava-labs/avalanchego/snow/engine/snowman/block" - "github.com/ava-labs/avalanchego/snow/engine/snowman/block/mocks" "github.com/ava-labs/avalanchego/snow/snowtest" "github.com/ava-labs/avalanchego/vms/components/chain" ) @@ -42,7 +41,7 @@ func batchedParseBlockCachingTestPlugin(t *testing.T, loadExpectations bool) blo // create mock ctrl := gomock.NewController(t) - vm := mocks.NewMockChainVM(ctrl) + vm := block.NewMockChainVM(ctrl) if loadExpectations { blk1 := snowman.NewMockBlock(ctrl) diff --git a/vms/rpcchainvm/state_syncable_vm_test.go b/vms/rpcchainvm/state_syncable_vm_test.go index 640255e80ee4..d0df51c71779 100644 --- a/vms/rpcchainvm/state_syncable_vm_test.go +++ b/vms/rpcchainvm/state_syncable_vm_test.go @@ -20,7 +20,6 @@ import ( "github.com/ava-labs/avalanchego/snow/choices" "github.com/ava-labs/avalanchego/snow/consensus/snowman" "github.com/ava-labs/avalanchego/snow/engine/snowman/block" - "github.com/ava-labs/avalanchego/snow/engine/snowman/block/mocks" "github.com/ava-labs/avalanchego/snow/snowtest" "github.com/ava-labs/avalanchego/utils/logging" "github.com/ava-labs/avalanchego/vms/rpcchainvm/grpcutils" @@ -67,8 +66,8 @@ var ( ) type StateSyncEnabledMock struct { - *mocks.MockChainVM - *mocks.MockStateSyncableVM + *block.MockChainVM + *block.MockStateSyncableVM } func stateSyncEnabledTestPlugin(t *testing.T, loadExpectations bool) block.ChainVM { @@ -77,8 +76,8 @@ func stateSyncEnabledTestPlugin(t *testing.T, loadExpectations bool) block.Chain // create mock ctrl := gomock.NewController(t) ssVM := StateSyncEnabledMock{ - MockChainVM: mocks.NewMockChainVM(ctrl), - MockStateSyncableVM: mocks.NewMockStateSyncableVM(ctrl), + MockChainVM: block.NewMockChainVM(ctrl), + MockStateSyncableVM: block.NewMockStateSyncableVM(ctrl), } if loadExpectations { @@ -99,8 +98,8 @@ func getOngoingSyncStateSummaryTestPlugin(t *testing.T, loadExpectations bool) b // create mock ctrl := gomock.NewController(t) ssVM := StateSyncEnabledMock{ - MockChainVM: mocks.NewMockChainVM(ctrl), - MockStateSyncableVM: mocks.NewMockStateSyncableVM(ctrl), + MockChainVM: block.NewMockChainVM(ctrl), + MockStateSyncableVM: block.NewMockStateSyncableVM(ctrl), } if loadExpectations { @@ -120,8 +119,8 @@ func getLastStateSummaryTestPlugin(t *testing.T, loadExpectations bool) block.Ch // create mock ctrl := gomock.NewController(t) ssVM := StateSyncEnabledMock{ - MockChainVM: mocks.NewMockChainVM(ctrl), - MockStateSyncableVM: mocks.NewMockStateSyncableVM(ctrl), + MockChainVM: block.NewMockChainVM(ctrl), + MockStateSyncableVM: block.NewMockStateSyncableVM(ctrl), } if loadExpectations { @@ -141,8 +140,8 @@ func parseStateSummaryTestPlugin(t *testing.T, loadExpectations bool) block.Chai // create mock ctrl := gomock.NewController(t) ssVM := StateSyncEnabledMock{ - MockChainVM: mocks.NewMockChainVM(ctrl), - MockStateSyncableVM: mocks.NewMockStateSyncableVM(ctrl), + MockChainVM: block.NewMockChainVM(ctrl), + MockStateSyncableVM: block.NewMockStateSyncableVM(ctrl), } if loadExpectations { @@ -163,8 +162,8 @@ func getStateSummaryTestPlugin(t *testing.T, loadExpectations bool) block.ChainV // create mock ctrl := gomock.NewController(t) ssVM := StateSyncEnabledMock{ - MockChainVM: mocks.NewMockChainVM(ctrl), - MockStateSyncableVM: mocks.NewMockStateSyncableVM(ctrl), + MockChainVM: block.NewMockChainVM(ctrl), + MockStateSyncableVM: block.NewMockStateSyncableVM(ctrl), } if loadExpectations { @@ -184,8 +183,8 @@ func acceptStateSummaryTestPlugin(t *testing.T, loadExpectations bool) block.Cha // create mock ctrl := gomock.NewController(t) ssVM := StateSyncEnabledMock{ - MockChainVM: mocks.NewMockChainVM(ctrl), - MockStateSyncableVM: mocks.NewMockStateSyncableVM(ctrl), + MockChainVM: block.NewMockChainVM(ctrl), + MockStateSyncableVM: block.NewMockStateSyncableVM(ctrl), } if loadExpectations { @@ -230,8 +229,8 @@ func lastAcceptedBlockPostStateSummaryAcceptTestPlugin(t *testing.T, loadExpecta // create mock ctrl := gomock.NewController(t) ssVM := StateSyncEnabledMock{ - MockChainVM: mocks.NewMockChainVM(ctrl), - MockStateSyncableVM: mocks.NewMockStateSyncableVM(ctrl), + MockChainVM: block.NewMockChainVM(ctrl), + MockStateSyncableVM: block.NewMockStateSyncableVM(ctrl), } if loadExpectations { diff --git a/vms/rpcchainvm/vm_test.go b/vms/rpcchainvm/vm_test.go index 1e299c35ee5e..fa8cb3d22fdf 100644 --- a/vms/rpcchainvm/vm_test.go +++ b/vms/rpcchainvm/vm_test.go @@ -19,7 +19,6 @@ import ( "golang.org/x/exp/slices" "github.com/ava-labs/avalanchego/snow/engine/snowman/block" - "github.com/ava-labs/avalanchego/snow/engine/snowman/block/mocks" "github.com/ava-labs/avalanchego/utils/logging" "github.com/ava-labs/avalanchego/vms/rpcchainvm/grpcutils" "github.com/ava-labs/avalanchego/vms/rpcchainvm/runtime" @@ -172,7 +171,7 @@ func TestRuntimeSubprocessBootstrap(t *testing.T) { require := require.New(t) ctrl := gomock.NewController(t) - vm := mocks.NewMockChainVM(ctrl) + vm := block.NewMockChainVM(ctrl) listener, err := grpcutils.NewListener() require.NoError(err) diff --git a/vms/rpcchainvm/with_context_vm_test.go b/vms/rpcchainvm/with_context_vm_test.go index 192a7658e451..5c2c242b94a9 100644 --- a/vms/rpcchainvm/with_context_vm_test.go +++ b/vms/rpcchainvm/with_context_vm_test.go @@ -16,7 +16,6 @@ import ( "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/snow/consensus/snowman" "github.com/ava-labs/avalanchego/snow/engine/snowman/block" - "github.com/ava-labs/avalanchego/snow/engine/snowman/block/mocks" "github.com/ava-labs/avalanchego/snow/snowtest" ) @@ -37,13 +36,13 @@ var ( ) type ContextEnabledVMMock struct { - *mocks.MockChainVM - *mocks.MockBuildBlockWithContextChainVM + *block.MockChainVM + *block.MockBuildBlockWithContextChainVM } type ContextEnabledBlockMock struct { *snowman.MockBlock - *mocks.MockWithVerifyContext + *block.MockWithVerifyContext } func contextEnabledTestPlugin(t *testing.T, loadExpectations bool) block.ChainVM { @@ -52,14 +51,14 @@ func contextEnabledTestPlugin(t *testing.T, loadExpectations bool) block.ChainVM // create mock ctrl := gomock.NewController(t) ctxVM := ContextEnabledVMMock{ - MockChainVM: mocks.NewMockChainVM(ctrl), - MockBuildBlockWithContextChainVM: mocks.NewMockBuildBlockWithContextChainVM(ctrl), + MockChainVM: block.NewMockChainVM(ctrl), + MockBuildBlockWithContextChainVM: block.NewMockBuildBlockWithContextChainVM(ctrl), } if loadExpectations { ctxBlock := ContextEnabledBlockMock{ MockBlock: snowman.NewMockBlock(ctrl), - MockWithVerifyContext: mocks.NewMockWithVerifyContext(ctrl), + MockWithVerifyContext: block.NewMockWithVerifyContext(ctrl), } gomock.InOrder( // Initialize diff --git a/x/sync/mock_client.go b/x/sync/mock_client.go index 153cfb5de5a7..9bbd81127e35 100644 --- a/x/sync/mock_client.go +++ b/x/sync/mock_client.go @@ -1,6 +1,3 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/x/sync (interfaces: Client) From d825ec228b7f78de383d9feea72fcbcf6a0442a8 Mon Sep 17 00:00:00 2001 From: Dhruba Basu <7675102+dhrubabasu@users.noreply.github.com> Date: Tue, 2 Jan 2024 11:00:38 -0500 Subject: [PATCH 16/57] Add missing import (#2573) Co-authored-by: Stephen Buttolph --- utils/ulimit/ulimit_bsd.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils/ulimit/ulimit_bsd.go b/utils/ulimit/ulimit_bsd.go index 191b788286d2..58204fd62a19 100644 --- a/utils/ulimit/ulimit_bsd.go +++ b/utils/ulimit/ulimit_bsd.go @@ -10,6 +10,8 @@ import ( "fmt" "syscall" + "go.uber.org/zap" + "github.com/ava-labs/avalanchego/utils/logging" ) From 021f4f797cfdbe090e23abfe2168e2774a71af5a Mon Sep 17 00:00:00 2001 From: Dhruba Basu <7675102+dhrubabasu@users.noreply.github.com> Date: Tue, 2 Jan 2024 11:46:09 -0500 Subject: [PATCH 17/57] `vms/platformvm`: Prune mempool periodically (#2566) --- vms/platformvm/block/builder/builder.go | 33 +++++++- vms/platformvm/config/execution_config.go | 3 + .../config/execution_config_test.go | 6 +- vms/platformvm/vm.go | 46 +++++++++++ vms/platformvm/vm_test.go | 79 +++++++++++++++++++ 5 files changed, 163 insertions(+), 4 deletions(-) diff --git a/vms/platformvm/block/builder/builder.go b/vms/platformvm/block/builder/builder.go index 93716733ac09..34f9a74e7f37 100644 --- a/vms/platformvm/block/builder/builder.go +++ b/vms/platformvm/block/builder/builder.go @@ -60,6 +60,13 @@ type Builder interface { // BuildBlock can be called to attempt to create a new block BuildBlock(context.Context) (snowman.Block, error) + + // PackBlockTxs returns an array of txs that can fit into a valid block of + // size [targetBlockSize]. The returned txs are all verified against the + // preferred state. + // + // Note: This function does not call the consensus engine. + PackBlockTxs(targetBlockSize int) ([]*txs.Tx, error) } // builder implements a simple builder to convert txs into valid blocks @@ -232,6 +239,24 @@ func (b *builder) BuildBlock(context.Context) (snowman.Block, error) { return b.blkManager.NewBlock(statelessBlk), nil } +func (b *builder) PackBlockTxs(targetBlockSize int) ([]*txs.Tx, error) { + preferredID := b.blkManager.Preferred() + preferredState, ok := b.blkManager.GetState(preferredID) + if !ok { + return nil, fmt.Errorf("%w: %s", errMissingPreferredState, preferredID) + } + + return packBlockTxs( + preferredID, + preferredState, + b.Mempool, + b.txExecutorBackend, + b.blkManager, + b.txExecutorBackend.Clk.Time(), + targetBlockSize, + ) +} + // [timestamp] is min(max(now, parent timestamp), next staker change time) func buildBlock( builder *builder, @@ -264,6 +289,7 @@ func buildBlock( builder.txExecutorBackend, builder.blkManager, timestamp, + targetBlockSize, ) if err != nil { return nil, fmt.Errorf("failed to pack block txs: %w", err) @@ -286,6 +312,7 @@ func buildBlock( builder.txExecutorBackend, builder.blkManager, timestamp, + targetBlockSize, ) if err != nil { return nil, fmt.Errorf("failed to pack block txs: %w", err) @@ -313,6 +340,7 @@ func packBlockTxs( backend *txexecutor.Backend, manager blockexecutor.Manager, timestamp time.Time, + remainingSize int, ) ([]*txs.Tx, error) { stateDiff, err := state.NewDiffOn(parentState) if err != nil { @@ -327,9 +355,8 @@ func packBlockTxs( stateDiff.SetTimestamp(timestamp) var ( - blockTxs []*txs.Tx - inputs set.Set[ids.ID] - remainingSize = targetBlockSize + blockTxs []*txs.Tx + inputs set.Set[ids.ID] ) for { diff --git a/vms/platformvm/config/execution_config.go b/vms/platformvm/config/execution_config.go index 964e72f51a57..b21aae48e8e4 100644 --- a/vms/platformvm/config/execution_config.go +++ b/vms/platformvm/config/execution_config.go @@ -5,6 +5,7 @@ package config import ( "encoding/json" + "time" "github.com/ava-labs/avalanchego/utils/units" "github.com/ava-labs/avalanchego/vms/platformvm/network" @@ -21,6 +22,7 @@ var DefaultExecutionConfig = ExecutionConfig{ BlockIDCacheSize: 8192, FxOwnerCacheSize: 4 * units.MiB, ChecksumsEnabled: false, + MempoolPruneFrequency: 30 * time.Minute, } // ExecutionConfig provides execution parameters of PlatformVM @@ -35,6 +37,7 @@ type ExecutionConfig struct { BlockIDCacheSize int `json:"block-id-cache-size"` FxOwnerCacheSize int `json:"fx-owner-cache-size"` ChecksumsEnabled bool `json:"checksums-enabled"` + MempoolPruneFrequency time.Duration `json:"mempool-prune-frequency"` } // GetExecutionConfig returns an ExecutionConfig diff --git a/vms/platformvm/config/execution_config_test.go b/vms/platformvm/config/execution_config_test.go index 6ba78df133ed..1680058819ae 100644 --- a/vms/platformvm/config/execution_config_test.go +++ b/vms/platformvm/config/execution_config_test.go @@ -5,6 +5,7 @@ package config import ( "testing" + "time" "github.com/stretchr/testify/require" @@ -61,7 +62,8 @@ func TestExecutionConfigUnmarshal(t *testing.T) { "chain-db-cache-size": 7, "block-id-cache-size": 8, "fx-owner-cache-size": 9, - "checksums-enabled": true + "checksums-enabled": true, + "mempool-prune-frequency": 60000000000 }`) ec, err := GetExecutionConfig(b) require.NoError(err) @@ -87,6 +89,7 @@ func TestExecutionConfigUnmarshal(t *testing.T) { BlockIDCacheSize: 8, FxOwnerCacheSize: 9, ChecksumsEnabled: true, + MempoolPruneFrequency: time.Minute, } require.Equal(expected, ec) }) @@ -135,6 +138,7 @@ func TestExecutionConfigUnmarshal(t *testing.T) { BlockIDCacheSize: 8, FxOwnerCacheSize: 9, ChecksumsEnabled: true, + MempoolPruneFrequency: 30 * time.Minute, } require.Equal(expected, ec) }) diff --git a/vms/platformvm/vm.go b/vms/platformvm/vm.go index d8e9d4172406..10dc515a5a62 100644 --- a/vms/platformvm/vm.go +++ b/vms/platformvm/vm.go @@ -7,8 +7,10 @@ import ( "context" "errors" "fmt" + "math" "net/http" "sync" + "time" "github.com/gorilla/rpc/v2" @@ -247,6 +249,10 @@ func (vm *VM) Initialize( return err } + // Incrementing [awaitShutdown] would cause a deadlock since + // [periodicallyPruneMempool] grabs the context lock. + go vm.periodicallyPruneMempool(execConfig.MempoolPruneFrequency) + shouldPrune, err := vm.state.ShouldPrune() if err != nil { return fmt.Errorf( @@ -274,6 +280,46 @@ func (vm *VM) Initialize( return nil } +func (vm *VM) periodicallyPruneMempool(frequency time.Duration) { + ticker := time.NewTicker(frequency) + defer ticker.Stop() + + for { + select { + case <-vm.onShutdownCtx.Done(): + return + case <-ticker.C: + if err := vm.pruneMempool(); err != nil { + vm.ctx.Log.Debug("pruning mempool failed", + zap.Error(err), + ) + } + } + } +} + +func (vm *VM) pruneMempool() error { + vm.ctx.Lock.Lock() + defer vm.ctx.Lock.Unlock() + + blockTxs, err := vm.Builder.PackBlockTxs(math.MaxInt) + if err != nil { + return err + } + + for _, tx := range blockTxs { + if err := vm.Builder.Add(tx); err != nil { + vm.ctx.Log.Debug( + "failed to reissue tx", + zap.Stringer("txID", tx.ID()), + zap.Error(err), + ) + } + } + + return nil +} + // Create all chains that exist that this node validates. func (vm *VM) initBlockchains() error { if vm.Config.PartialSyncPrimaryNetwork { diff --git a/vms/platformvm/vm_test.go b/vms/platformvm/vm_test.go index ce074150c1c8..7ac1638f8b84 100644 --- a/vms/platformvm/vm_test.go +++ b/vms/platformvm/vm_test.go @@ -2271,3 +2271,82 @@ func TestBaseTx(t *testing.T) { require.NoError(baseTxBlock.Accept(context.Background())) require.NoError(vm.SetPreference(context.Background(), vm.manager.LastAccepted())) } + +func TestPruneMempool(t *testing.T) { + require := require.New(t) + vm, _, _ := defaultVM(t, latestFork) + vm.ctx.Lock.Lock() + defer func() { + require.NoError(vm.Shutdown(context.Background())) + vm.ctx.Lock.Unlock() + }() + + // Create a tx that will be valid regardless of timestamp. + sendAmt := uint64(100000) + changeAddr := ids.ShortEmpty + + baseTx, err := vm.txBuilder.NewBaseTx( + sendAmt, + secp256k1fx.OutputOwners{ + Threshold: 1, + Addrs: []ids.ShortID{ + keys[1].Address(), + }, + }, + []*secp256k1.PrivateKey{keys[0]}, + changeAddr, + ) + require.NoError(err) + + vm.ctx.Lock.Unlock() + require.NoError(vm.issueTx(context.Background(), baseTx)) + vm.ctx.Lock.Lock() + + // [baseTx] should be in the mempool. + baseTxID := baseTx.ID() + _, ok := vm.Builder.Get(baseTxID) + require.True(ok) + + // Create a tx that will be invalid after time advancement. + var ( + startTime = vm.clock.Time() + endTime = startTime.Add(vm.MinStakeDuration) + ) + + addValidatorTx, err := vm.txBuilder.NewAddValidatorTx( + defaultMinValidatorStake, + uint64(startTime.Unix()), + uint64(endTime.Unix()), + ids.GenerateTestNodeID(), + keys[2].Address(), + 20000, + []*secp256k1.PrivateKey{keys[1]}, + ids.ShortEmpty, + ) + require.NoError(err) + + vm.ctx.Lock.Unlock() + require.NoError(vm.issueTx(context.Background(), addValidatorTx)) + vm.ctx.Lock.Lock() + + // Advance clock to [endTime], making [addValidatorTx] invalid. + vm.clock.Set(endTime) + + // [addValidatorTx] and [baseTx] should still be in the mempool. + addValidatorTxID := addValidatorTx.ID() + _, ok = vm.Builder.Get(addValidatorTxID) + require.True(ok) + _, ok = vm.Builder.Get(baseTxID) + require.True(ok) + + vm.ctx.Lock.Unlock() + require.NoError(vm.pruneMempool()) + vm.ctx.Lock.Lock() + + // [addValidatorTx] should be ejected from the mempool. + // [baseTx] should still be in the mempool. + _, ok = vm.Builder.Get(addValidatorTxID) + require.False(ok) + _, ok = vm.Builder.Get(baseTxID) + require.True(ok) +} From 0c4efd743e1d737f4e8970d0e0ebf229ea44406c Mon Sep 17 00:00:00 2001 From: Dhruba Basu <7675102+dhrubabasu@users.noreply.github.com> Date: Wed, 3 Jan 2024 11:27:42 -0500 Subject: [PATCH 18/57] Update license header to 2024 (#2572) --- api/admin/client.go | 2 +- api/admin/client_test.go | 2 +- api/admin/service.go | 2 +- api/admin/service_test.go | 2 +- api/auth/auth.go | 2 +- api/auth/auth_test.go | 2 +- api/auth/claims.go | 2 +- api/auth/response.go | 2 +- api/auth/service.go | 2 +- api/common_args_responses.go | 2 +- api/health/checker.go | 2 +- api/health/client.go | 2 +- api/health/client_test.go | 2 +- api/health/handler.go | 2 +- api/health/health.go | 2 +- api/health/health_test.go | 2 +- api/health/metrics.go | 2 +- api/health/result.go | 2 +- api/health/service.go | 2 +- api/health/service_test.go | 2 +- api/health/worker.go | 2 +- api/info/client.go | 2 +- api/info/client_test.go | 2 +- api/info/service.go | 2 +- api/info/service_test.go | 2 +- api/ipcs/client.go | 2 +- api/ipcs/service.go | 2 +- api/keystore/blockchain_keystore.go | 2 +- api/keystore/client.go | 2 +- api/keystore/codec.go | 2 +- api/keystore/gkeystore/keystore_client.go | 2 +- api/keystore/gkeystore/keystore_server.go | 2 +- api/keystore/keystore.go | 2 +- api/keystore/service.go | 2 +- api/keystore/service_test.go | 2 +- api/metrics/gatherer_test.go | 2 +- api/metrics/multi_gatherer.go | 2 +- api/metrics/multi_gatherer_test.go | 2 +- api/metrics/optional_gatherer.go | 2 +- api/metrics/optional_gatherer_test.go | 2 +- api/server/allowed_hosts.go | 2 +- api/server/allowed_hosts_test.go | 2 +- api/server/metrics.go | 2 +- api/server/router.go | 2 +- api/server/router_test.go | 2 +- api/server/server.go | 2 +- api/server/server_test.go | 2 +- api/server/wrapper.go | 2 +- api/traced_handler.go | 2 +- app/app.go | 2 +- cache/cache.go | 2 +- cache/empty_cache.go | 2 +- cache/lru_cache.go | 2 +- cache/lru_cache_benchmark_test.go | 2 +- cache/lru_cache_test.go | 2 +- cache/lru_sized_cache.go | 2 +- cache/lru_sized_cache_test.go | 2 +- cache/metercacher/cache.go | 2 +- cache/metercacher/cache_test.go | 2 +- cache/metercacher/metrics.go | 2 +- cache/test_cacher.go | 2 +- cache/unique_cache.go | 2 +- cache/unique_cache_test.go | 2 +- chains/atomic/codec.go | 2 +- chains/atomic/gsharedmemory/filtered_batch.go | 2 +- chains/atomic/gsharedmemory/shared_memory_client.go | 2 +- chains/atomic/gsharedmemory/shared_memory_server.go | 2 +- chains/atomic/gsharedmemory/shared_memory_test.go | 2 +- chains/atomic/memory.go | 2 +- chains/atomic/memory_test.go | 2 +- chains/atomic/prefixes.go | 2 +- chains/atomic/shared_memory.go | 2 +- chains/atomic/shared_memory_test.go | 2 +- chains/atomic/state.go | 2 +- chains/atomic/test_shared_memory.go | 2 +- chains/atomic/writer.go | 2 +- chains/linearizable_vm.go | 2 +- chains/manager.go | 2 +- chains/registrant.go | 2 +- chains/test_manager.go | 2 +- codec/codec.go | 2 +- codec/general_codec.go | 2 +- codec/hierarchycodec/codec.go | 2 +- codec/hierarchycodec/codec_test.go | 2 +- codec/linearcodec/codec.go | 2 +- codec/linearcodec/codec_test.go | 2 +- codec/manager.go | 2 +- codec/reflectcodec/struct_fielder.go | 2 +- codec/reflectcodec/type_codec.go | 2 +- codec/registry.go | 2 +- codec/test_codec.go | 2 +- config/config.go | 2 +- config/config_test.go | 2 +- config/flags.go | 2 +- config/keys.go | 2 +- config/viper.go | 2 +- database/batch.go | 2 +- database/benchmark_database.go | 2 +- database/common.go | 2 +- database/corruptabledb/db.go | 2 +- database/corruptabledb/db_test.go | 2 +- database/database.go | 2 +- database/encdb/codec.go | 2 +- database/encdb/db.go | 2 +- database/encdb/db_test.go | 2 +- database/errors.go | 2 +- database/helpers.go | 2 +- database/helpers_test.go | 2 +- database/iterator.go | 2 +- database/leveldb/db.go | 2 +- database/leveldb/db_test.go | 2 +- database/leveldb/metrics.go | 2 +- database/linkeddb/codec.go | 2 +- database/linkeddb/linkeddb.go | 2 +- database/linkeddb/linkeddb_test.go | 2 +- database/memdb/db.go | 2 +- database/memdb/db_test.go | 2 +- database/meterdb/db.go | 2 +- database/meterdb/db_test.go | 2 +- database/meterdb/metrics.go | 2 +- database/pebble/batch.go | 2 +- database/pebble/batch_test.go | 2 +- database/pebble/db.go | 2 +- database/pebble/db_test.go | 2 +- database/pebble/iterator.go | 2 +- database/prefixdb/db.go | 2 +- database/prefixdb/db_test.go | 2 +- database/rpcdb/db_client.go | 2 +- database/rpcdb/db_server.go | 2 +- database/rpcdb/db_test.go | 2 +- database/rpcdb/errors.go | 2 +- database/test_database.go | 2 +- database/versiondb/db.go | 2 +- database/versiondb/db_test.go | 2 +- genesis/aliases.go | 2 +- genesis/bootstrappers.go | 2 +- genesis/bootstrappers_test.go | 2 +- genesis/config.go | 2 +- genesis/config_test.go | 2 +- genesis/genesis.go | 2 +- genesis/genesis_fuji.go | 2 +- genesis/genesis_local.go | 2 +- genesis/genesis_mainnet.go | 2 +- genesis/genesis_test.go | 2 +- genesis/params.go | 2 +- genesis/unparsed_config.go | 2 +- ids/aliases.go | 2 +- ids/aliases_test.go | 2 +- ids/bits.go | 2 +- ids/bits_test.go | 2 +- ids/galiasreader/alias_reader_client.go | 2 +- ids/galiasreader/alias_reader_server.go | 2 +- ids/galiasreader/alias_reader_test.go | 2 +- ids/id.go | 2 +- ids/id_test.go | 2 +- ids/node_id.go | 2 +- ids/node_id_test.go | 2 +- ids/request_id.go | 2 +- ids/short.go | 2 +- ids/test_aliases.go | 2 +- ids/test_generator.go | 2 +- indexer/client.go | 2 +- indexer/client_test.go | 2 +- indexer/codec.go | 2 +- indexer/container.go | 2 +- indexer/examples/p-chain/main.go | 2 +- indexer/examples/x-chain-blocks/main.go | 2 +- indexer/index.go | 2 +- indexer/index_test.go | 2 +- indexer/indexer.go | 2 +- indexer/indexer_test.go | 2 +- indexer/service.go | 2 +- ipcs/chainipc.go | 2 +- ipcs/eventsocket.go | 2 +- ipcs/socket/socket.go | 2 +- ipcs/socket/socket_test.go | 2 +- ipcs/socket/socket_unix.go | 2 +- ipcs/socket/socket_windows.go | 2 +- main/main.go | 2 +- message/creator.go | 2 +- message/fields.go | 2 +- message/inbound_msg_builder.go | 2 +- message/inbound_msg_builder_test.go | 2 +- message/internal_msg_builder.go | 2 +- message/messages.go | 2 +- message/messages_benchmark_test.go | 2 +- message/messages_test.go | 2 +- message/ops.go | 2 +- message/outbound_msg_builder.go | 2 +- message/outbound_msg_builder_test.go | 2 +- nat/nat.go | 2 +- nat/no_router.go | 2 +- nat/pmp.go | 2 +- nat/upnp.go | 2 +- network/certs_test.go | 2 +- network/config.go | 2 +- network/conn_test.go | 2 +- network/dialer/dialer.go | 2 +- network/dialer/dialer_test.go | 2 +- network/dialer_test.go | 2 +- network/example_test.go | 2 +- network/handler_test.go | 2 +- network/listener_test.go | 2 +- network/metrics.go | 2 +- network/network.go | 2 +- network/network_test.go | 2 +- network/p2p/client.go | 2 +- network/p2p/gossip/bloom.go | 2 +- network/p2p/gossip/bloom_test.go | 2 +- network/p2p/gossip/gossip.go | 2 +- network/p2p/gossip/gossip_test.go | 2 +- network/p2p/gossip/gossipable.go | 2 +- network/p2p/gossip/handler.go | 2 +- network/p2p/gossip/test_gossip.go | 2 +- network/p2p/handler.go | 2 +- network/p2p/handler_test.go | 2 +- network/p2p/network.go | 2 +- network/p2p/network_test.go | 2 +- network/p2p/node_sampler.go | 2 +- network/p2p/peer_tracker.go | 2 +- network/p2p/peer_tracker_test.go | 2 +- network/p2p/router.go | 2 +- network/p2p/throttler.go | 2 +- network/p2p/throttler_handler.go | 2 +- network/p2p/throttler_handler_test.go | 2 +- network/p2p/throttler_test.go | 2 +- network/p2p/validators.go | 2 +- network/p2p/validators_test.go | 2 +- network/peer/config.go | 2 +- network/peer/example_test.go | 2 +- network/peer/gossip_tracker.go | 2 +- network/peer/gossip_tracker_callback.go | 2 +- network/peer/gossip_tracker_metrics.go | 2 +- network/peer/gossip_tracker_test.go | 2 +- network/peer/info.go | 2 +- network/peer/ip.go | 2 +- network/peer/ip_signer.go | 2 +- network/peer/ip_signer_test.go | 2 +- network/peer/message_queue.go | 2 +- network/peer/message_queue_test.go | 2 +- network/peer/metrics.go | 2 +- network/peer/msg_length.go | 2 +- network/peer/msg_length_test.go | 2 +- network/peer/network.go | 2 +- network/peer/peer.go | 2 +- network/peer/peer_test.go | 2 +- network/peer/set.go | 2 +- network/peer/set_test.go | 2 +- network/peer/test_network.go | 2 +- network/peer/test_peer.go | 2 +- network/peer/tls_config.go | 2 +- network/peer/upgrader.go | 2 +- network/peer/validator_id.go | 2 +- network/test_network.go | 2 +- network/throttling/bandwidth_throttler.go | 2 +- network/throttling/bandwidth_throttler_test.go | 2 +- network/throttling/common.go | 2 +- network/throttling/dial_throttler.go | 2 +- network/throttling/dial_throttler_test.go | 2 +- network/throttling/inbound_conn_throttler.go | 2 +- network/throttling/inbound_conn_throttler_test.go | 2 +- network/throttling/inbound_conn_upgrade_throttler.go | 2 +- network/throttling/inbound_conn_upgrade_throttler_test.go | 2 +- network/throttling/inbound_msg_buffer_throttler.go | 2 +- network/throttling/inbound_msg_buffer_throttler_test.go | 2 +- network/throttling/inbound_msg_byte_throttler.go | 2 +- network/throttling/inbound_msg_byte_throttler_test.go | 2 +- network/throttling/inbound_msg_throttler.go | 2 +- network/throttling/inbound_resource_throttler.go | 2 +- network/throttling/inbound_resource_throttler_test.go | 2 +- network/throttling/no_inbound_msg_throttler.go | 2 +- network/throttling/outbound_msg_throttler.go | 2 +- network/throttling/outbound_msg_throttler_test.go | 2 +- network/throttling/release_func.go | 2 +- network/tracked_ip.go | 2 +- network/tracked_ip_test.go | 2 +- node/beacon_manager.go | 2 +- node/beacon_manager_test.go | 2 +- node/config.go | 2 +- node/insecure_validator_manager.go | 2 +- node/node.go | 2 +- node/overridden_manager.go | 2 +- node/overridden_manager_test.go | 2 +- pubsub/connection.go | 2 +- pubsub/connections.go | 2 +- pubsub/filter_param.go | 2 +- pubsub/filter_test.go | 2 +- pubsub/filterer.go | 2 +- pubsub/messages.go | 2 +- pubsub/server.go | 2 +- snow/acceptor.go | 2 +- snow/choices/decidable.go | 2 +- snow/choices/status.go | 2 +- snow/choices/status_test.go | 2 +- snow/choices/test_decidable.go | 2 +- snow/consensus/avalanche/test_vertex.go | 2 +- snow/consensus/avalanche/vertex.go | 2 +- snow/consensus/snowball/binary_slush.go | 2 +- snow/consensus/snowball/binary_snowball.go | 2 +- snow/consensus/snowball/binary_snowball_test.go | 2 +- snow/consensus/snowball/binary_snowflake.go | 2 +- snow/consensus/snowball/binary_snowflake_test.go | 2 +- snow/consensus/snowball/consensus.go | 2 +- snow/consensus/snowball/consensus_performance_test.go | 2 +- snow/consensus/snowball/consensus_reversibility_test.go | 2 +- snow/consensus/snowball/consensus_test.go | 2 +- snow/consensus/snowball/flat.go | 2 +- snow/consensus/snowball/flat_test.go | 2 +- snow/consensus/snowball/network_test.go | 2 +- snow/consensus/snowball/nnary_slush.go | 2 +- snow/consensus/snowball/nnary_snowball.go | 2 +- snow/consensus/snowball/nnary_snowball_test.go | 2 +- snow/consensus/snowball/nnary_snowflake.go | 2 +- snow/consensus/snowball/nnary_snowflake_test.go | 2 +- snow/consensus/snowball/parameters.go | 2 +- snow/consensus/snowball/parameters_test.go | 2 +- snow/consensus/snowball/tree.go | 2 +- snow/consensus/snowball/tree_test.go | 2 +- snow/consensus/snowball/unary_snowball.go | 2 +- snow/consensus/snowball/unary_snowball_test.go | 2 +- snow/consensus/snowball/unary_snowflake.go | 2 +- snow/consensus/snowball/unary_snowflake_test.go | 2 +- snow/consensus/snowman/block.go | 2 +- snow/consensus/snowman/bootstrapper/majority.go | 2 +- snow/consensus/snowman/bootstrapper/majority_test.go | 2 +- snow/consensus/snowman/bootstrapper/minority.go | 2 +- snow/consensus/snowman/bootstrapper/minority_test.go | 2 +- snow/consensus/snowman/bootstrapper/noop.go | 2 +- snow/consensus/snowman/bootstrapper/noop_test.go | 2 +- snow/consensus/snowman/bootstrapper/poll.go | 2 +- snow/consensus/snowman/bootstrapper/poll_test.go | 2 +- snow/consensus/snowman/bootstrapper/requests.go | 2 +- snow/consensus/snowman/bootstrapper/sampler.go | 2 +- snow/consensus/snowman/bootstrapper/sampler_test.go | 2 +- snow/consensus/snowman/consensus.go | 2 +- snow/consensus/snowman/consensus_test.go | 2 +- snow/consensus/snowman/factory.go | 2 +- snow/consensus/snowman/metrics.go | 2 +- snow/consensus/snowman/network_test.go | 2 +- snow/consensus/snowman/oracle_block.go | 2 +- snow/consensus/snowman/poll/early_term_no_traversal.go | 2 +- snow/consensus/snowman/poll/early_term_no_traversal_test.go | 2 +- snow/consensus/snowman/poll/interfaces.go | 2 +- snow/consensus/snowman/poll/set.go | 2 +- snow/consensus/snowman/poll/set_test.go | 2 +- snow/consensus/snowman/snowman_block.go | 2 +- snow/consensus/snowman/test_block.go | 2 +- snow/consensus/snowman/topological.go | 2 +- snow/consensus/snowman/topological_test.go | 2 +- snow/consensus/snowman/traced_consensus.go | 2 +- snow/consensus/snowstorm/test_tx.go | 2 +- snow/consensus/snowstorm/tx.go | 2 +- snow/context.go | 2 +- snow/engine/avalanche/bootstrap/bootstrapper.go | 2 +- snow/engine/avalanche/bootstrap/bootstrapper_test.go | 2 +- snow/engine/avalanche/bootstrap/config.go | 2 +- snow/engine/avalanche/bootstrap/metrics.go | 2 +- snow/engine/avalanche/bootstrap/tx_job.go | 2 +- snow/engine/avalanche/bootstrap/vertex_job.go | 2 +- snow/engine/avalanche/engine.go | 2 +- snow/engine/avalanche/getter/getter.go | 2 +- snow/engine/avalanche/getter/getter_test.go | 2 +- snow/engine/avalanche/state/prefixed_state.go | 2 +- snow/engine/avalanche/state/serializer.go | 2 +- snow/engine/avalanche/state/state.go | 2 +- snow/engine/avalanche/state/unique_vertex.go | 2 +- snow/engine/avalanche/state/unique_vertex_test.go | 2 +- snow/engine/avalanche/vertex/builder.go | 2 +- snow/engine/avalanche/vertex/builder_test.go | 2 +- snow/engine/avalanche/vertex/codec.go | 2 +- snow/engine/avalanche/vertex/manager.go | 2 +- snow/engine/avalanche/vertex/parser.go | 2 +- snow/engine/avalanche/vertex/parser_test.go | 2 +- snow/engine/avalanche/vertex/stateless_vertex.go | 2 +- snow/engine/avalanche/vertex/stateless_vertex_test.go | 2 +- snow/engine/avalanche/vertex/storage.go | 2 +- snow/engine/avalanche/vertex/test_builder.go | 2 +- snow/engine/avalanche/vertex/test_manager.go | 2 +- snow/engine/avalanche/vertex/test_parser.go | 2 +- snow/engine/avalanche/vertex/test_storage.go | 2 +- snow/engine/avalanche/vertex/test_vm.go | 2 +- snow/engine/avalanche/vertex/vm.go | 2 +- snow/engine/common/appsender/appsender_client.go | 2 +- snow/engine/common/appsender/appsender_server.go | 2 +- snow/engine/common/bootstrap_tracker.go | 2 +- snow/engine/common/bootstrapable.go | 2 +- snow/engine/common/engine.go | 2 +- snow/engine/common/error.go | 2 +- snow/engine/common/error_test.go | 2 +- snow/engine/common/fx.go | 2 +- snow/engine/common/halter.go | 2 +- snow/engine/common/message.go | 2 +- snow/engine/common/no_ops_handlers.go | 2 +- snow/engine/common/queue/job.go | 2 +- snow/engine/common/queue/jobs.go | 2 +- snow/engine/common/queue/jobs_test.go | 2 +- snow/engine/common/queue/parser.go | 2 +- snow/engine/common/queue/state.go | 2 +- snow/engine/common/queue/test_job.go | 2 +- snow/engine/common/queue/test_parser.go | 2 +- snow/engine/common/request.go | 2 +- snow/engine/common/sender.go | 2 +- snow/engine/common/state_syncer.go | 2 +- snow/engine/common/test_bootstrap_tracker.go | 2 +- snow/engine/common/test_bootstrapper.go | 2 +- snow/engine/common/test_engine.go | 2 +- snow/engine/common/test_sender.go | 2 +- snow/engine/common/test_timer.go | 2 +- snow/engine/common/test_vm.go | 2 +- snow/engine/common/timer.go | 2 +- snow/engine/common/traced_bootstrapable_engine.go | 2 +- snow/engine/common/traced_engine.go | 2 +- snow/engine/common/traced_state_syncer.go | 2 +- snow/engine/common/tracker/accepted.go | 2 +- snow/engine/common/tracker/accepted_test.go | 2 +- snow/engine/common/tracker/peers.go | 2 +- snow/engine/common/tracker/peers_test.go | 2 +- snow/engine/common/tracker/startup.go | 2 +- snow/engine/common/vm.go | 2 +- snow/engine/snowman/ancestor/tree.go | 2 +- snow/engine/snowman/ancestor/tree_test.go | 2 +- snow/engine/snowman/block/batched_vm.go | 2 +- snow/engine/snowman/block/batched_vm_test.go | 2 +- snow/engine/snowman/block/block_context_vm.go | 2 +- snow/engine/snowman/block/state_summary.go | 2 +- snow/engine/snowman/block/state_sync_mode.go | 2 +- snow/engine/snowman/block/state_syncable_vm.go | 2 +- snow/engine/snowman/block/test_batched_vm.go | 2 +- snow/engine/snowman/block/test_state_summary.go | 2 +- snow/engine/snowman/block/test_state_syncable_vm.go | 2 +- snow/engine/snowman/block/test_vm.go | 2 +- snow/engine/snowman/block/vm.go | 2 +- snow/engine/snowman/bootstrap/block_job.go | 2 +- snow/engine/snowman/bootstrap/bootstrapper.go | 2 +- snow/engine/snowman/bootstrap/bootstrapper_test.go | 2 +- snow/engine/snowman/bootstrap/config.go | 2 +- snow/engine/snowman/bootstrap/metrics.go | 2 +- snow/engine/snowman/config.go | 2 +- snow/engine/snowman/config_test.go | 2 +- snow/engine/snowman/engine.go | 2 +- snow/engine/snowman/getter/getter.go | 2 +- snow/engine/snowman/getter/getter_test.go | 2 +- snow/engine/snowman/issuer.go | 2 +- snow/engine/snowman/memory_block.go | 2 +- snow/engine/snowman/metrics.go | 2 +- snow/engine/snowman/syncer/config.go | 2 +- snow/engine/snowman/syncer/state_syncer.go | 2 +- snow/engine/snowman/syncer/state_syncer_test.go | 2 +- snow/engine/snowman/syncer/utils_test.go | 2 +- snow/engine/snowman/test_engine.go | 2 +- snow/engine/snowman/traced_engine.go | 2 +- snow/engine/snowman/transitive.go | 2 +- snow/engine/snowman/transitive_test.go | 2 +- snow/engine/snowman/voter.go | 2 +- snow/event/blockable.go | 2 +- snow/event/blocker.go | 2 +- snow/event/blocker_test.go | 2 +- snow/networking/benchlist/benchable.go | 2 +- snow/networking/benchlist/benchlist.go | 2 +- snow/networking/benchlist/benchlist_test.go | 2 +- snow/networking/benchlist/manager.go | 2 +- snow/networking/benchlist/metrics.go | 2 +- snow/networking/benchlist/test_benchable.go | 2 +- snow/networking/handler/engine.go | 2 +- snow/networking/handler/engine_test.go | 2 +- snow/networking/handler/handler.go | 2 +- snow/networking/handler/handler_test.go | 2 +- snow/networking/handler/health.go | 2 +- snow/networking/handler/health_test.go | 2 +- snow/networking/handler/message_queue.go | 2 +- snow/networking/handler/message_queue_metrics.go | 2 +- snow/networking/handler/message_queue_test.go | 2 +- snow/networking/handler/metrics.go | 2 +- snow/networking/handler/parser.go | 2 +- snow/networking/router/chain_router.go | 2 +- snow/networking/router/chain_router_metrics.go | 2 +- snow/networking/router/chain_router_test.go | 2 +- snow/networking/router/health.go | 2 +- snow/networking/router/inbound_handler.go | 2 +- snow/networking/router/main_test.go | 2 +- snow/networking/router/router.go | 2 +- snow/networking/router/traced_router.go | 2 +- snow/networking/sender/external_sender.go | 2 +- snow/networking/sender/sender.go | 2 +- snow/networking/sender/sender_test.go | 2 +- snow/networking/sender/test_external_sender.go | 2 +- snow/networking/sender/traced_sender.go | 2 +- snow/networking/timeout/main_test.go | 2 +- snow/networking/timeout/manager.go | 2 +- snow/networking/timeout/manager_test.go | 2 +- snow/networking/timeout/metrics.go | 2 +- snow/networking/tracker/resource_tracker.go | 2 +- snow/networking/tracker/resource_tracker_test.go | 2 +- snow/networking/tracker/targeter.go | 2 +- snow/networking/tracker/targeter_test.go | 2 +- snow/snowtest/snowtest.go | 2 +- snow/state.go | 2 +- snow/uptime/locked_calculator.go | 2 +- snow/uptime/locked_calculator_test.go | 2 +- snow/uptime/manager.go | 2 +- snow/uptime/manager_test.go | 2 +- snow/uptime/no_op_calculator.go | 2 +- snow/uptime/state.go | 2 +- snow/uptime/test_state.go | 2 +- snow/validators/connector.go | 2 +- snow/validators/gvalidators/validator_state_client.go | 2 +- snow/validators/gvalidators/validator_state_server.go | 2 +- snow/validators/gvalidators/validator_state_test.go | 2 +- snow/validators/logger.go | 2 +- snow/validators/manager.go | 2 +- snow/validators/manager_test.go | 2 +- snow/validators/set.go | 2 +- snow/validators/set_test.go | 2 +- snow/validators/state.go | 2 +- snow/validators/subnet_connector.go | 2 +- snow/validators/test_state.go | 2 +- snow/validators/traced_state.go | 2 +- snow/validators/unhandled_subnet_connector.go | 2 +- snow/validators/validator.go | 2 +- staking/asn1.go | 2 +- staking/certificate.go | 2 +- staking/parse.go | 2 +- staking/tls.go | 2 +- staking/tls_test.go | 2 +- staking/verify.go | 2 +- staking/verify_test.go | 2 +- subnets/config.go | 2 +- subnets/config_test.go | 2 +- subnets/no_op_allower.go | 2 +- subnets/subnet.go | 2 +- subnets/subnet_test.go | 2 +- tests/colors.go | 2 +- tests/e2e/banff/suites.go | 2 +- tests/e2e/c/dynamic_fees.go | 2 +- tests/e2e/c/hashing_contract.go | 2 +- tests/e2e/c/interchain_workflow.go | 2 +- tests/e2e/e2e_test.go | 2 +- tests/e2e/faultinjection/duplicate_node_id.go | 2 +- tests/e2e/ignore.go | 2 +- tests/e2e/p/interchain_workflow.go | 2 +- tests/e2e/p/permissionless_subnets.go | 2 +- tests/e2e/p/staking_rewards.go | 2 +- tests/e2e/p/workflow.go | 2 +- tests/e2e/static-handlers/suites.go | 2 +- tests/e2e/x/interchain_workflow.go | 2 +- tests/e2e/x/transfer/virtuous.go | 2 +- tests/fixture/e2e/describe.go | 2 +- tests/fixture/e2e/env.go | 2 +- tests/fixture/e2e/flags.go | 2 +- tests/fixture/e2e/helpers.go | 2 +- tests/fixture/test_data_server.go | 2 +- tests/fixture/test_data_server_test.go | 2 +- tests/fixture/tmpnet/cmd/main.go | 2 +- tests/fixture/tmpnet/defaults.go | 2 +- tests/fixture/tmpnet/flags.go | 2 +- tests/fixture/tmpnet/genesis.go | 2 +- tests/fixture/tmpnet/network.go | 2 +- tests/fixture/tmpnet/network_test.go | 2 +- tests/fixture/tmpnet/node.go | 2 +- tests/fixture/tmpnet/node_config.go | 2 +- tests/fixture/tmpnet/node_process.go | 2 +- tests/fixture/tmpnet/utils.go | 2 +- tests/http.go | 2 +- tests/upgrade/upgrade_test.go | 2 +- trace/exporter.go | 2 +- trace/exporter_type.go | 2 +- trace/noop.go | 2 +- trace/tracer.go | 2 +- utils/atomic.go | 2 +- utils/atomic_test.go | 2 +- utils/bag/bag.go | 2 +- utils/bag/bag_benchmark_test.go | 2 +- utils/bag/bag_test.go | 2 +- utils/bag/unique_bag.go | 2 +- utils/bag/unique_bag_test.go | 2 +- utils/beacon/beacon.go | 2 +- utils/beacon/set.go | 2 +- utils/beacon/set_test.go | 2 +- utils/bimap/bimap.go | 2 +- utils/bimap/bimap_test.go | 2 +- utils/bloom/bloom_filter.go | 2 +- utils/bloom/bloom_filter_test.go | 2 +- utils/bloom/map_filter.go | 2 +- utils/buffer/bounded_nonblocking_queue.go | 2 +- utils/buffer/bounded_nonblocking_queue_test.go | 2 +- utils/buffer/unbounded_blocking_deque.go | 2 +- utils/buffer/unbounded_blocking_deque_test.go | 2 +- utils/buffer/unbounded_deque.go | 2 +- utils/buffer/unbounded_deque_test.go | 2 +- utils/bytes.go | 2 +- utils/cb58/cb58.go | 2 +- utils/cb58/cb58_test.go | 2 +- utils/compression/compressor.go | 2 +- utils/compression/compressor_test.go | 2 +- utils/compression/gzip_compressor.go | 2 +- utils/compression/no_compressor.go | 2 +- utils/compression/no_compressor_test.go | 2 +- utils/compression/type.go | 2 +- utils/compression/type_test.go | 2 +- utils/compression/zstd_compressor.go | 2 +- utils/constants/acps.go | 2 +- utils/constants/aliases.go | 2 +- utils/constants/application.go | 2 +- utils/constants/memory.go | 2 +- utils/constants/network_ids.go | 2 +- utils/constants/network_ids_test.go | 2 +- utils/constants/networking.go | 2 +- utils/constants/vm_ids.go | 2 +- utils/context.go | 2 +- utils/crypto/bls/bls_benchmark_test.go | 2 +- utils/crypto/bls/bls_test.go | 2 +- utils/crypto/bls/public.go | 2 +- utils/crypto/bls/public_test.go | 2 +- utils/crypto/bls/secret.go | 2 +- utils/crypto/bls/secret_test.go | 2 +- utils/crypto/bls/signature.go | 2 +- utils/crypto/bls/signature_test.go | 2 +- utils/crypto/keychain/keychain.go | 2 +- utils/crypto/keychain/keychain_test.go | 2 +- utils/crypto/keychain/ledger.go | 2 +- utils/crypto/ledger/ledger.go | 2 +- utils/crypto/ledger/ledger_test.go | 2 +- utils/crypto/secp256k1/rfc6979_test.go | 2 +- utils/crypto/secp256k1/secp256k1.go | 2 +- utils/crypto/secp256k1/secp256k1_benchmark_test.go | 2 +- utils/crypto/secp256k1/secp256k1_test.go | 2 +- utils/crypto/secp256k1/test_keys.go | 2 +- utils/dynamicip/ifconfig_resolver.go | 2 +- utils/dynamicip/no_updater.go | 2 +- utils/dynamicip/opendns_resolver.go | 2 +- utils/dynamicip/resolver.go | 2 +- utils/dynamicip/resolver_test.go | 2 +- utils/dynamicip/updater.go | 2 +- utils/dynamicip/updater_test.go | 2 +- utils/error.go | 2 +- utils/filesystem/io.go | 2 +- utils/filesystem/rename.go | 2 +- utils/filesystem/rename_test.go | 2 +- utils/formatting/address/address.go | 2 +- utils/formatting/address/converter.go | 2 +- utils/formatting/encoding.go | 2 +- utils/formatting/encoding_benchmark_test.go | 2 +- utils/formatting/encoding_test.go | 2 +- utils/formatting/int_format.go | 2 +- utils/formatting/int_format_test.go | 2 +- utils/formatting/prefixed_stringer.go | 2 +- utils/hashing/consistent/hashable.go | 2 +- utils/hashing/consistent/ring.go | 2 +- utils/hashing/consistent/ring_test.go | 2 +- utils/hashing/hasher.go | 2 +- utils/hashing/hashing.go | 2 +- utils/heap/map.go | 2 +- utils/heap/map_test.go | 2 +- utils/heap/queue.go | 2 +- utils/heap/queue_test.go | 2 +- utils/heap/set.go | 2 +- utils/heap/set_test.go | 2 +- utils/ips/claimed_ip_port.go | 2 +- utils/ips/dynamic_ip_port.go | 2 +- utils/ips/ip_port.go | 2 +- utils/ips/ip_test.go | 2 +- utils/ips/lookup.go | 2 +- utils/ips/lookup_test.go | 2 +- utils/json/codec.go | 2 +- utils/json/float32.go | 2 +- utils/json/float32_test.go | 2 +- utils/json/float64.go | 2 +- utils/json/uint16.go | 2 +- utils/json/uint32.go | 2 +- utils/json/uint64.go | 2 +- utils/json/uint8.go | 2 +- utils/linkedhashmap/iterator.go | 2 +- utils/linkedhashmap/linkedhashmap.go | 2 +- utils/linkedhashmap/linkedhashmap_test.go | 2 +- utils/logging/color.go | 2 +- utils/logging/config.go | 2 +- utils/logging/factory.go | 2 +- utils/logging/format.go | 2 +- utils/logging/level.go | 2 +- utils/logging/log.go | 2 +- utils/logging/log_test.go | 2 +- utils/logging/logger.go | 2 +- utils/logging/sanitize.go | 2 +- utils/logging/test_log.go | 2 +- utils/math/averager.go | 2 +- utils/math/averager_heap.go | 2 +- utils/math/averager_heap_test.go | 2 +- utils/math/continuous_averager.go | 2 +- utils/math/continuous_averager_benchmark_test.go | 2 +- utils/math/continuous_averager_test.go | 2 +- utils/math/meter/continuous_meter.go | 2 +- utils/math/meter/factory.go | 2 +- utils/math/meter/meter.go | 2 +- utils/math/meter/meter_benchmark_test.go | 2 +- utils/math/meter/meter_test.go | 2 +- utils/math/safe_math.go | 2 +- utils/math/safe_math_test.go | 2 +- utils/math/sync_averager.go | 2 +- utils/maybe/maybe.go | 2 +- utils/maybe/maybe_test.go | 2 +- utils/metric/api_interceptor.go | 2 +- utils/metric/averager.go | 2 +- utils/password/hash.go | 2 +- utils/password/hash_test.go | 2 +- utils/password/password.go | 2 +- utils/password/password_test.go | 2 +- utils/perms/chmod.go | 2 +- utils/perms/create.go | 2 +- utils/perms/perms.go | 2 +- utils/perms/write_file.go | 2 +- utils/profiler/continuous.go | 2 +- utils/profiler/profiler.go | 2 +- utils/profiler/profiler_test.go | 2 +- utils/resource/metrics.go | 2 +- utils/resource/no_usage.go | 2 +- utils/resource/usage.go | 2 +- utils/resource/usage_test.go | 2 +- utils/rpc/json.go | 2 +- utils/rpc/options.go | 2 +- utils/rpc/requester.go | 2 +- utils/sampler/rand.go | 2 +- utils/sampler/rand_test.go | 2 +- utils/sampler/uniform.go | 2 +- utils/sampler/uniform_benchmark_test.go | 2 +- utils/sampler/uniform_best.go | 2 +- utils/sampler/uniform_replacer.go | 2 +- utils/sampler/uniform_resample.go | 2 +- utils/sampler/uniform_test.go | 2 +- utils/sampler/weighted.go | 2 +- utils/sampler/weighted_array.go | 2 +- utils/sampler/weighted_array_test.go | 2 +- utils/sampler/weighted_benchmark_test.go | 2 +- utils/sampler/weighted_best.go | 2 +- utils/sampler/weighted_heap.go | 2 +- utils/sampler/weighted_heap_test.go | 2 +- utils/sampler/weighted_linear.go | 2 +- utils/sampler/weighted_linear_test.go | 2 +- utils/sampler/weighted_test.go | 2 +- utils/sampler/weighted_uniform.go | 2 +- utils/sampler/weighted_without_replacement.go | 2 +- utils/sampler/weighted_without_replacement_benchmark_test.go | 2 +- utils/sampler/weighted_without_replacement_generic.go | 2 +- utils/sampler/weighted_without_replacement_test.go | 2 +- utils/set/bits.go | 2 +- utils/set/bits_64.go | 2 +- utils/set/bits_64_test.go | 2 +- utils/set/bits_test.go | 2 +- utils/set/sampleable_set.go | 2 +- utils/set/sampleable_set_test.go | 2 +- utils/set/set.go | 2 +- utils/set/set_benchmark_test.go | 2 +- utils/set/set_test.go | 2 +- utils/setmap/setmap.go | 2 +- utils/setmap/setmap_test.go | 2 +- utils/sorting.go | 2 +- utils/sorting_test.go | 2 +- utils/stacktrace.go | 2 +- utils/storage/storage_common.go | 2 +- utils/storage/storage_unix.go | 2 +- utils/storage/storage_windows.go | 2 +- utils/timer/adaptive_timeout_manager.go | 2 +- utils/timer/adaptive_timeout_manager_test.go | 2 +- utils/timer/eta.go | 2 +- utils/timer/meter.go | 2 +- utils/timer/mockable/clock.go | 2 +- utils/timer/mockable/clock_test.go | 2 +- utils/timer/timer.go | 2 +- utils/timer/timer_test.go | 2 +- utils/ulimit/ulimit_bsd.go | 2 +- utils/ulimit/ulimit_darwin.go | 2 +- utils/ulimit/ulimit_unix.go | 2 +- utils/ulimit/ulimit_windows.go | 2 +- utils/units/avax.go | 2 +- utils/units/bytes.go | 2 +- utils/window/window.go | 2 +- utils/window/window_test.go | 2 +- utils/wrappers/closers.go | 2 +- utils/wrappers/errors.go | 2 +- utils/wrappers/packing.go | 2 +- utils/wrappers/packing_test.go | 2 +- utils/zero.go | 2 +- version/application.go | 2 +- version/application_test.go | 2 +- version/compatibility.go | 2 +- version/compatibility_test.go | 2 +- version/constants.go | 2 +- version/constants_test.go | 2 +- version/parser.go | 2 +- version/parser_test.go | 2 +- version/string.go | 2 +- version/version.go | 2 +- version/version_test.go | 2 +- vms/avm/block/block.go | 2 +- vms/avm/block/block_test.go | 2 +- vms/avm/block/builder/builder.go | 2 +- vms/avm/block/builder/builder_test.go | 2 +- vms/avm/block/executor/block.go | 2 +- vms/avm/block/executor/block_test.go | 2 +- vms/avm/block/executor/manager.go | 2 +- vms/avm/block/executor/manager_test.go | 2 +- vms/avm/block/parser.go | 2 +- vms/avm/block/standard_block.go | 2 +- vms/avm/client.go | 2 +- vms/avm/client_test.go | 2 +- vms/avm/config.go | 2 +- vms/avm/config/config.go | 2 +- vms/avm/config_test.go | 2 +- vms/avm/environment_test.go | 2 +- vms/avm/factory.go | 2 +- vms/avm/fx_test.go | 2 +- vms/avm/fxs/fx.go | 2 +- vms/avm/genesis.go | 2 +- vms/avm/genesis_test.go | 2 +- vms/avm/health.go | 2 +- vms/avm/index_test.go | 2 +- vms/avm/metrics/metrics.go | 2 +- vms/avm/metrics/tx_metrics.go | 2 +- vms/avm/network/atomic.go | 2 +- vms/avm/network/config.go | 2 +- vms/avm/network/gossip.go | 2 +- vms/avm/network/gossip_test.go | 2 +- vms/avm/network/network.go | 2 +- vms/avm/network/network_test.go | 2 +- vms/avm/network/tx_verifier.go | 2 +- vms/avm/pubsub_filterer.go | 2 +- vms/avm/pubsub_filterer_test.go | 2 +- vms/avm/service.go | 2 +- vms/avm/service_test.go | 2 +- vms/avm/state/diff.go | 2 +- vms/avm/state/state.go | 2 +- vms/avm/state/state_test.go | 2 +- vms/avm/state/versions.go | 2 +- vms/avm/state_test.go | 2 +- vms/avm/static_client.go | 2 +- vms/avm/static_service.go | 2 +- vms/avm/static_service_test.go | 2 +- vms/avm/tx.go | 2 +- vms/avm/tx_init.go | 2 +- vms/avm/txs/base_tx.go | 2 +- vms/avm/txs/base_tx_test.go | 2 +- vms/avm/txs/codec.go | 2 +- vms/avm/txs/create_asset_tx.go | 2 +- vms/avm/txs/create_asset_tx_test.go | 2 +- vms/avm/txs/executor/backend.go | 2 +- vms/avm/txs/executor/executor.go | 2 +- vms/avm/txs/executor/executor_test.go | 2 +- vms/avm/txs/executor/semantic_verifier.go | 2 +- vms/avm/txs/executor/semantic_verifier_test.go | 2 +- vms/avm/txs/executor/syntactic_verifier.go | 2 +- vms/avm/txs/executor/syntactic_verifier_test.go | 2 +- vms/avm/txs/export_tx.go | 2 +- vms/avm/txs/export_tx_test.go | 2 +- vms/avm/txs/import_tx.go | 2 +- vms/avm/txs/import_tx_test.go | 2 +- vms/avm/txs/initial_state.go | 2 +- vms/avm/txs/initial_state_test.go | 2 +- vms/avm/txs/mempool/mempool.go | 2 +- vms/avm/txs/mempool/mempool_test.go | 2 +- vms/avm/txs/operation.go | 2 +- vms/avm/txs/operation_test.go | 2 +- vms/avm/txs/operation_tx.go | 2 +- vms/avm/txs/parser.go | 2 +- vms/avm/txs/tx.go | 2 +- vms/avm/txs/visitor.go | 2 +- vms/avm/utxo/spender.go | 2 +- vms/avm/vm.go | 2 +- vms/avm/vm_benchmark_test.go | 2 +- vms/avm/vm_regression_test.go | 2 +- vms/avm/vm_test.go | 2 +- vms/avm/wallet_client.go | 2 +- vms/avm/wallet_service.go | 2 +- vms/avm/wallet_service_test.go | 2 +- vms/components/avax/addresses.go | 2 +- vms/components/avax/asset.go | 2 +- vms/components/avax/asset_test.go | 2 +- vms/components/avax/atomic_utxos.go | 2 +- vms/components/avax/base_tx.go | 2 +- vms/components/avax/flow_checker.go | 2 +- vms/components/avax/metadata.go | 2 +- vms/components/avax/metadata_test.go | 2 +- vms/components/avax/state.go | 2 +- vms/components/avax/test_verifiable.go | 2 +- vms/components/avax/transferables.go | 2 +- vms/components/avax/transferables_test.go | 2 +- vms/components/avax/utxo.go | 2 +- vms/components/avax/utxo_fetching.go | 2 +- vms/components/avax/utxo_fetching_test.go | 2 +- vms/components/avax/utxo_handler.go | 2 +- vms/components/avax/utxo_id.go | 2 +- vms/components/avax/utxo_id_test.go | 2 +- vms/components/avax/utxo_state.go | 2 +- vms/components/avax/utxo_state_test.go | 2 +- vms/components/avax/utxo_test.go | 2 +- vms/components/chain/block.go | 2 +- vms/components/chain/state.go | 2 +- vms/components/chain/state_test.go | 2 +- vms/components/index/index.go | 2 +- vms/components/index/metrics.go | 2 +- vms/components/keystore/codec.go | 2 +- vms/components/keystore/user.go | 2 +- vms/components/keystore/user_test.go | 2 +- vms/components/message/codec.go | 2 +- vms/components/message/handler.go | 2 +- vms/components/message/handler_test.go | 2 +- vms/components/message/message.go | 2 +- vms/components/message/message_test.go | 2 +- vms/components/message/tx.go | 2 +- vms/components/message/tx_test.go | 2 +- vms/components/verify/subnet.go | 2 +- vms/components/verify/subnet_test.go | 2 +- vms/components/verify/verification.go | 2 +- vms/components/verify/verification_test.go | 2 +- vms/example/xsvm/api/client.go | 2 +- vms/example/xsvm/api/server.go | 2 +- vms/example/xsvm/block/block.go | 2 +- vms/example/xsvm/block/codec.go | 2 +- vms/example/xsvm/builder/builder.go | 2 +- vms/example/xsvm/chain/block.go | 2 +- vms/example/xsvm/chain/chain.go | 2 +- vms/example/xsvm/cmd/account/cmd.go | 2 +- vms/example/xsvm/cmd/account/flags.go | 2 +- vms/example/xsvm/cmd/chain/cmd.go | 2 +- vms/example/xsvm/cmd/chain/create/cmd.go | 2 +- vms/example/xsvm/cmd/chain/create/flags.go | 2 +- vms/example/xsvm/cmd/chain/genesis/cmd.go | 2 +- vms/example/xsvm/cmd/chain/genesis/flags.go | 2 +- vms/example/xsvm/cmd/issue/cmd.go | 2 +- vms/example/xsvm/cmd/issue/export/cmd.go | 2 +- vms/example/xsvm/cmd/issue/export/flags.go | 2 +- vms/example/xsvm/cmd/issue/importtx/cmd.go | 2 +- vms/example/xsvm/cmd/issue/importtx/flags.go | 2 +- vms/example/xsvm/cmd/issue/transfer/cmd.go | 2 +- vms/example/xsvm/cmd/issue/transfer/flags.go | 2 +- vms/example/xsvm/cmd/run/cmd.go | 2 +- vms/example/xsvm/cmd/version/cmd.go | 2 +- vms/example/xsvm/cmd/xsvm/main.go | 2 +- vms/example/xsvm/constants.go | 2 +- vms/example/xsvm/execute/block.go | 2 +- vms/example/xsvm/execute/expects_context.go | 2 +- vms/example/xsvm/execute/genesis.go | 2 +- vms/example/xsvm/execute/tx.go | 2 +- vms/example/xsvm/factory.go | 2 +- vms/example/xsvm/genesis/codec.go | 2 +- vms/example/xsvm/genesis/genesis.go | 2 +- vms/example/xsvm/genesis/genesis_test.go | 2 +- vms/example/xsvm/state/keys.go | 2 +- vms/example/xsvm/state/storage.go | 2 +- vms/example/xsvm/tx/codec.go | 2 +- vms/example/xsvm/tx/export.go | 2 +- vms/example/xsvm/tx/import.go | 2 +- vms/example/xsvm/tx/payload.go | 2 +- vms/example/xsvm/tx/transfer.go | 2 +- vms/example/xsvm/tx/tx.go | 2 +- vms/example/xsvm/tx/unsigned.go | 2 +- vms/example/xsvm/tx/visitor.go | 2 +- vms/example/xsvm/vm.go | 2 +- vms/manager.go | 2 +- vms/metervm/batched_vm.go | 2 +- vms/metervm/block.go | 2 +- vms/metervm/block_metrics.go | 2 +- vms/metervm/block_vm.go | 2 +- vms/metervm/build_block_with_context_vm.go | 2 +- vms/metervm/metrics.go | 2 +- vms/metervm/state_syncable_vm.go | 2 +- vms/metervm/vertex_metrics.go | 2 +- vms/metervm/vertex_vm.go | 2 +- vms/nftfx/credential.go | 2 +- vms/nftfx/credential_test.go | 2 +- vms/nftfx/factory.go | 2 +- vms/nftfx/factory_test.go | 2 +- vms/nftfx/fx.go | 2 +- vms/nftfx/fx_test.go | 2 +- vms/nftfx/mint_operation.go | 2 +- vms/nftfx/mint_operation_test.go | 2 +- vms/nftfx/mint_output.go | 2 +- vms/nftfx/mint_output_test.go | 2 +- vms/nftfx/transfer_operation.go | 2 +- vms/nftfx/transfer_operation_test.go | 2 +- vms/nftfx/transfer_output.go | 2 +- vms/nftfx/transfer_output_test.go | 2 +- vms/platformvm/api/static_client.go | 2 +- vms/platformvm/api/static_service.go | 2 +- vms/platformvm/api/static_service_test.go | 2 +- vms/platformvm/block/abort_block.go | 2 +- vms/platformvm/block/abort_block_test.go | 2 +- vms/platformvm/block/atomic_block.go | 2 +- vms/platformvm/block/atomic_block_test.go | 2 +- vms/platformvm/block/block.go | 2 +- vms/platformvm/block/builder/builder.go | 2 +- vms/platformvm/block/builder/builder_test.go | 2 +- vms/platformvm/block/builder/helpers_test.go | 2 +- vms/platformvm/block/builder/main_test.go | 2 +- vms/platformvm/block/builder/standard_block_test.go | 2 +- vms/platformvm/block/codec.go | 2 +- vms/platformvm/block/commit_block.go | 2 +- vms/platformvm/block/commit_block_test.go | 2 +- vms/platformvm/block/common_block.go | 2 +- vms/platformvm/block/executor/acceptor.go | 2 +- vms/platformvm/block/executor/acceptor_test.go | 2 +- vms/platformvm/block/executor/backend.go | 2 +- vms/platformvm/block/executor/backend_test.go | 2 +- vms/platformvm/block/executor/block.go | 2 +- vms/platformvm/block/executor/block_state.go | 2 +- vms/platformvm/block/executor/block_test.go | 2 +- vms/platformvm/block/executor/helpers_test.go | 2 +- vms/platformvm/block/executor/manager.go | 2 +- vms/platformvm/block/executor/manager_test.go | 2 +- vms/platformvm/block/executor/options.go | 2 +- vms/platformvm/block/executor/options_test.go | 2 +- vms/platformvm/block/executor/proposal_block_test.go | 2 +- vms/platformvm/block/executor/rejector.go | 2 +- vms/platformvm/block/executor/rejector_test.go | 2 +- vms/platformvm/block/executor/standard_block_test.go | 2 +- vms/platformvm/block/executor/verifier.go | 2 +- vms/platformvm/block/executor/verifier_test.go | 2 +- vms/platformvm/block/parse.go | 2 +- vms/platformvm/block/parse_test.go | 2 +- vms/platformvm/block/proposal_block.go | 2 +- vms/platformvm/block/proposal_block_test.go | 2 +- vms/platformvm/block/serialization_test.go | 2 +- vms/platformvm/block/standard_block.go | 2 +- vms/platformvm/block/standard_block_test.go | 2 +- vms/platformvm/block/visitor.go | 2 +- vms/platformvm/client.go | 2 +- vms/platformvm/client_permissionless_validator.go | 2 +- vms/platformvm/config/config.go | 2 +- vms/platformvm/config/execution_config.go | 2 +- vms/platformvm/config/execution_config_test.go | 2 +- vms/platformvm/factory.go | 2 +- vms/platformvm/fx/fx.go | 2 +- vms/platformvm/genesis/codec.go | 2 +- vms/platformvm/genesis/genesis.go | 2 +- vms/platformvm/health.go | 2 +- vms/platformvm/main_test.go | 2 +- vms/platformvm/metrics/block_metrics.go | 2 +- vms/platformvm/metrics/metrics.go | 2 +- vms/platformvm/metrics/no_op.go | 2 +- vms/platformvm/metrics/tx_metrics.go | 2 +- vms/platformvm/network/config.go | 2 +- vms/platformvm/network/gossip.go | 2 +- vms/platformvm/network/gossip_test.go | 2 +- vms/platformvm/network/main_test.go | 2 +- vms/platformvm/network/network.go | 2 +- vms/platformvm/network/network_test.go | 2 +- vms/platformvm/network/tx_verifier.go | 2 +- vms/platformvm/reward/calculator.go | 2 +- vms/platformvm/reward/calculator_test.go | 2 +- vms/platformvm/reward/config.go | 2 +- vms/platformvm/service.go | 2 +- vms/platformvm/service_test.go | 2 +- vms/platformvm/signer/empty.go | 2 +- vms/platformvm/signer/empty_test.go | 2 +- vms/platformvm/signer/proof_of_possession.go | 2 +- vms/platformvm/signer/proof_of_possession_test.go | 2 +- vms/platformvm/signer/signer.go | 2 +- vms/platformvm/stakeable/stakeable_lock.go | 2 +- vms/platformvm/stakeable/stakeable_lock_test.go | 2 +- vms/platformvm/state/diff.go | 2 +- vms/platformvm/state/diff_test.go | 2 +- vms/platformvm/state/disk_staker_diff_iterator.go | 2 +- vms/platformvm/state/disk_staker_diff_iterator_test.go | 2 +- vms/platformvm/state/empty_iterator.go | 2 +- vms/platformvm/state/empty_iterator_test.go | 2 +- vms/platformvm/state/masked_iterator.go | 2 +- vms/platformvm/state/masked_iterator_test.go | 2 +- vms/platformvm/state/merged_iterator.go | 2 +- vms/platformvm/state/merged_iterator_test.go | 2 +- vms/platformvm/state/metadata_codec.go | 2 +- vms/platformvm/state/metadata_delegator.go | 2 +- vms/platformvm/state/metadata_delegator_test.go | 2 +- vms/platformvm/state/metadata_validator.go | 2 +- vms/platformvm/state/metadata_validator_test.go | 2 +- vms/platformvm/state/slice_iterator_test.go | 2 +- vms/platformvm/state/staker.go | 2 +- vms/platformvm/state/staker_diff_iterator.go | 2 +- vms/platformvm/state/staker_diff_iterator_test.go | 2 +- vms/platformvm/state/staker_status.go | 2 +- vms/platformvm/state/staker_test.go | 2 +- vms/platformvm/state/stakers.go | 2 +- vms/platformvm/state/stakers_test.go | 2 +- vms/platformvm/state/state.go | 2 +- vms/platformvm/state/state_test.go | 2 +- vms/platformvm/state/tree_iterator.go | 2 +- vms/platformvm/state/tree_iterator_test.go | 2 +- vms/platformvm/state/versions.go | 2 +- vms/platformvm/status/blockchain_status.go | 2 +- vms/platformvm/status/blockchain_status_test.go | 2 +- vms/platformvm/status/status.go | 2 +- vms/platformvm/status/status_test.go | 2 +- vms/platformvm/txs/add_delegator_test.go | 2 +- vms/platformvm/txs/add_delegator_tx.go | 2 +- vms/platformvm/txs/add_permissionless_delegator_tx.go | 2 +- vms/platformvm/txs/add_permissionless_delegator_tx_test.go | 2 +- vms/platformvm/txs/add_permissionless_validator_tx.go | 2 +- vms/platformvm/txs/add_permissionless_validator_tx_test.go | 2 +- vms/platformvm/txs/add_subnet_validator_test.go | 2 +- vms/platformvm/txs/add_subnet_validator_tx.go | 2 +- vms/platformvm/txs/add_validator_test.go | 2 +- vms/platformvm/txs/add_validator_tx.go | 2 +- vms/platformvm/txs/advance_time_tx.go | 2 +- vms/platformvm/txs/base_tx.go | 2 +- vms/platformvm/txs/base_tx_test.go | 2 +- vms/platformvm/txs/builder/builder.go | 2 +- vms/platformvm/txs/codec.go | 2 +- vms/platformvm/txs/create_chain_test.go | 2 +- vms/platformvm/txs/create_chain_tx.go | 2 +- vms/platformvm/txs/create_subnet_tx.go | 2 +- vms/platformvm/txs/executor/advance_time_test.go | 2 +- vms/platformvm/txs/executor/atomic_tx_executor.go | 2 +- vms/platformvm/txs/executor/backend.go | 2 +- vms/platformvm/txs/executor/create_chain_test.go | 2 +- vms/platformvm/txs/executor/create_subnet_test.go | 2 +- vms/platformvm/txs/executor/export_test.go | 2 +- vms/platformvm/txs/executor/helpers_test.go | 2 +- vms/platformvm/txs/executor/import_test.go | 2 +- vms/platformvm/txs/executor/proposal_tx_executor.go | 2 +- vms/platformvm/txs/executor/proposal_tx_executor_test.go | 2 +- vms/platformvm/txs/executor/reward_validator_test.go | 2 +- vms/platformvm/txs/executor/staker_tx_verification.go | 2 +- vms/platformvm/txs/executor/staker_tx_verification_helpers.go | 2 +- vms/platformvm/txs/executor/staker_tx_verification_test.go | 2 +- vms/platformvm/txs/executor/standard_tx_executor.go | 2 +- vms/platformvm/txs/executor/standard_tx_executor_test.go | 2 +- vms/platformvm/txs/executor/state_changes.go | 2 +- vms/platformvm/txs/executor/subnet_tx_verification.go | 2 +- vms/platformvm/txs/executor/tx_mempool_verifier.go | 2 +- vms/platformvm/txs/export_tx.go | 2 +- vms/platformvm/txs/import_tx.go | 2 +- vms/platformvm/txs/mempool/mempool.go | 2 +- vms/platformvm/txs/mempool/mempool_test.go | 2 +- vms/platformvm/txs/priorities.go | 2 +- vms/platformvm/txs/priorities_test.go | 2 +- vms/platformvm/txs/remove_subnet_validator_tx.go | 2 +- vms/platformvm/txs/remove_subnet_validator_tx_test.go | 2 +- vms/platformvm/txs/reward_validator_tx.go | 2 +- vms/platformvm/txs/staker_tx.go | 2 +- vms/platformvm/txs/subnet_validator.go | 2 +- vms/platformvm/txs/subnet_validator_test.go | 2 +- vms/platformvm/txs/transfer_subnet_ownership_tx.go | 2 +- vms/platformvm/txs/transfer_subnet_ownership_tx_test.go | 2 +- vms/platformvm/txs/transform_subnet_tx.go | 2 +- vms/platformvm/txs/transform_subnet_tx_test.go | 2 +- vms/platformvm/txs/tx.go | 2 +- vms/platformvm/txs/txheap/by_end_time.go | 2 +- vms/platformvm/txs/txheap/by_end_time_test.go | 2 +- vms/platformvm/txs/txheap/heap.go | 2 +- vms/platformvm/txs/unsigned_tx.go | 2 +- vms/platformvm/txs/validator.go | 2 +- vms/platformvm/txs/validator_test.go | 2 +- vms/platformvm/txs/visitor.go | 2 +- vms/platformvm/utxo/handler.go | 2 +- vms/platformvm/utxo/handler_test.go | 2 +- vms/platformvm/validator_set_property_test.go | 2 +- vms/platformvm/validators/manager.go | 2 +- vms/platformvm/validators/manager_benchmark_test.go | 2 +- vms/platformvm/validators/test_manager.go | 2 +- vms/platformvm/vm.go | 2 +- vms/platformvm/vm_regression_test.go | 2 +- vms/platformvm/vm_test.go | 2 +- vms/platformvm/warp/codec.go | 2 +- vms/platformvm/warp/constants.go | 2 +- vms/platformvm/warp/gwarp/client.go | 2 +- vms/platformvm/warp/gwarp/server.go | 2 +- vms/platformvm/warp/gwarp/signer_test.go | 2 +- vms/platformvm/warp/message.go | 2 +- vms/platformvm/warp/message_test.go | 2 +- vms/platformvm/warp/payload/addressed_call.go | 2 +- vms/platformvm/warp/payload/addressed_call_test.go | 2 +- vms/platformvm/warp/payload/codec.go | 2 +- vms/platformvm/warp/payload/hash.go | 2 +- vms/platformvm/warp/payload/hash_test.go | 2 +- vms/platformvm/warp/payload/payload.go | 2 +- vms/platformvm/warp/payload/payload_test.go | 2 +- vms/platformvm/warp/signature.go | 2 +- vms/platformvm/warp/signature_test.go | 2 +- vms/platformvm/warp/signer.go | 2 +- vms/platformvm/warp/signer_test.go | 2 +- vms/platformvm/warp/test_signer.go | 2 +- vms/platformvm/warp/unsigned_message.go | 2 +- vms/platformvm/warp/unsigned_message_test.go | 2 +- vms/platformvm/warp/validator.go | 2 +- vms/platformvm/warp/validator_test.go | 2 +- vms/propertyfx/burn_operation.go | 2 +- vms/propertyfx/burn_operation_test.go | 2 +- vms/propertyfx/credential.go | 2 +- vms/propertyfx/credential_test.go | 2 +- vms/propertyfx/factory.go | 2 +- vms/propertyfx/factory_test.go | 2 +- vms/propertyfx/fx.go | 2 +- vms/propertyfx/fx_test.go | 2 +- vms/propertyfx/mint_operation.go | 2 +- vms/propertyfx/mint_operation_test.go | 2 +- vms/propertyfx/mint_output.go | 2 +- vms/propertyfx/mint_output_test.go | 2 +- vms/propertyfx/owned_output.go | 2 +- vms/propertyfx/owned_output_test.go | 2 +- vms/proposervm/batched_vm.go | 2 +- vms/proposervm/batched_vm_test.go | 2 +- vms/proposervm/block.go | 2 +- vms/proposervm/block/block.go | 2 +- vms/proposervm/block/block_test.go | 2 +- vms/proposervm/block/build.go | 2 +- vms/proposervm/block/build_test.go | 2 +- vms/proposervm/block/codec.go | 2 +- vms/proposervm/block/header.go | 2 +- vms/proposervm/block/header_test.go | 2 +- vms/proposervm/block/option.go | 2 +- vms/proposervm/block/option_test.go | 2 +- vms/proposervm/block/parse.go | 2 +- vms/proposervm/block/parse_test.go | 2 +- vms/proposervm/block_server.go | 2 +- vms/proposervm/block_test.go | 2 +- vms/proposervm/config.go | 2 +- vms/proposervm/height_indexed_vm.go | 2 +- vms/proposervm/indexer/block_server.go | 2 +- vms/proposervm/indexer/block_server_test.go | 2 +- vms/proposervm/indexer/height_indexer.go | 2 +- vms/proposervm/indexer/height_indexer_test.go | 2 +- vms/proposervm/main_test.go | 2 +- vms/proposervm/post_fork_block.go | 2 +- vms/proposervm/post_fork_block_test.go | 2 +- vms/proposervm/post_fork_option.go | 2 +- vms/proposervm/post_fork_option_test.go | 2 +- vms/proposervm/pre_fork_block.go | 2 +- vms/proposervm/pre_fork_block_test.go | 2 +- vms/proposervm/proposer/validators.go | 2 +- vms/proposervm/proposer/validators_test.go | 2 +- vms/proposervm/proposer/windower.go | 2 +- vms/proposervm/proposer/windower_test.go | 2 +- vms/proposervm/scheduler/scheduler.go | 2 +- vms/proposervm/scheduler/scheduler_test.go | 2 +- vms/proposervm/state/block_height_index.go | 2 +- vms/proposervm/state/block_state.go | 2 +- vms/proposervm/state/block_state_test.go | 2 +- vms/proposervm/state/chain_state.go | 2 +- vms/proposervm/state/chain_state_test.go | 2 +- vms/proposervm/state/codec.go | 2 +- vms/proposervm/state/state.go | 2 +- vms/proposervm/state/state_test.go | 2 +- vms/proposervm/state_summary.go | 2 +- vms/proposervm/state_syncable_vm.go | 2 +- vms/proposervm/state_syncable_vm_test.go | 2 +- vms/proposervm/summary/build.go | 2 +- vms/proposervm/summary/build_test.go | 2 +- vms/proposervm/summary/codec.go | 2 +- vms/proposervm/summary/parse.go | 2 +- vms/proposervm/summary/parse_test.go | 2 +- vms/proposervm/summary/state_summary.go | 2 +- vms/proposervm/tree/tree.go | 2 +- vms/proposervm/tree/tree_test.go | 2 +- vms/proposervm/vm.go | 2 +- vms/proposervm/vm_byzantine_test.go | 2 +- vms/proposervm/vm_regression_test.go | 2 +- vms/proposervm/vm_test.go | 2 +- vms/registry/vm_getter.go | 2 +- vms/registry/vm_getter_test.go | 2 +- vms/registry/vm_registerer.go | 2 +- vms/registry/vm_registerer_test.go | 2 +- vms/registry/vm_registry.go | 2 +- vms/registry/vm_registry_test.go | 2 +- vms/rpcchainvm/batched_vm_test.go | 2 +- vms/rpcchainvm/errors.go | 2 +- vms/rpcchainvm/factory.go | 2 +- vms/rpcchainvm/ghttp/gconn/conn_client.go | 2 +- vms/rpcchainvm/ghttp/gconn/conn_server.go | 2 +- vms/rpcchainvm/ghttp/greader/reader_client.go | 2 +- vms/rpcchainvm/ghttp/greader/reader_server.go | 2 +- vms/rpcchainvm/ghttp/gresponsewriter/locked_writer.go | 2 +- vms/rpcchainvm/ghttp/gresponsewriter/writer_client.go | 2 +- vms/rpcchainvm/ghttp/gresponsewriter/writer_server.go | 2 +- vms/rpcchainvm/ghttp/gwriter/writer_client.go | 2 +- vms/rpcchainvm/ghttp/gwriter/writer_server.go | 2 +- vms/rpcchainvm/ghttp/http_client.go | 2 +- vms/rpcchainvm/ghttp/http_server.go | 2 +- vms/rpcchainvm/ghttp/http_test.go | 2 +- vms/rpcchainvm/grpcutils/client.go | 2 +- vms/rpcchainvm/grpcutils/client_test.go | 2 +- vms/rpcchainvm/grpcutils/server.go | 2 +- vms/rpcchainvm/grpcutils/server_closer.go | 2 +- vms/rpcchainvm/grpcutils/util.go | 2 +- vms/rpcchainvm/gruntime/runtime_client.go | 2 +- vms/rpcchainvm/gruntime/runtime_server.go | 2 +- vms/rpcchainvm/messenger/messenger_client.go | 2 +- vms/rpcchainvm/messenger/messenger_server.go | 2 +- vms/rpcchainvm/runtime/manager.go | 2 +- vms/rpcchainvm/runtime/runtime.go | 2 +- vms/rpcchainvm/runtime/subprocess/initializer.go | 2 +- vms/rpcchainvm/runtime/subprocess/linux_stopper.go | 2 +- vms/rpcchainvm/runtime/subprocess/non_linux_stopper.go | 2 +- vms/rpcchainvm/runtime/subprocess/runtime.go | 2 +- vms/rpcchainvm/runtime/subprocess/stopper.go | 2 +- vms/rpcchainvm/state_syncable_vm_test.go | 2 +- vms/rpcchainvm/vm.go | 2 +- vms/rpcchainvm/vm_client.go | 2 +- vms/rpcchainvm/vm_server.go | 2 +- vms/rpcchainvm/vm_test.go | 2 +- vms/rpcchainvm/with_context_vm_test.go | 2 +- vms/secp256k1fx/credential.go | 2 +- vms/secp256k1fx/credential_test.go | 2 +- vms/secp256k1fx/factory.go | 2 +- vms/secp256k1fx/factory_test.go | 2 +- vms/secp256k1fx/fx.go | 2 +- vms/secp256k1fx/fx_test.go | 2 +- vms/secp256k1fx/input.go | 2 +- vms/secp256k1fx/input_test.go | 2 +- vms/secp256k1fx/keychain.go | 2 +- vms/secp256k1fx/keychain_test.go | 2 +- vms/secp256k1fx/mint_operation.go | 2 +- vms/secp256k1fx/mint_operation_test.go | 2 +- vms/secp256k1fx/mint_output.go | 2 +- vms/secp256k1fx/mint_output_test.go | 2 +- vms/secp256k1fx/output_owners.go | 2 +- vms/secp256k1fx/output_owners_test.go | 2 +- vms/secp256k1fx/transfer_input.go | 2 +- vms/secp256k1fx/transfer_input_test.go | 2 +- vms/secp256k1fx/transfer_output.go | 2 +- vms/secp256k1fx/transfer_output_test.go | 2 +- vms/secp256k1fx/tx.go | 2 +- vms/secp256k1fx/vm.go | 2 +- vms/tracedvm/batched_vm.go | 2 +- vms/tracedvm/block.go | 2 +- vms/tracedvm/block_vm.go | 2 +- vms/tracedvm/build_block_with_context_vm.go | 2 +- vms/tracedvm/state_syncable_vm.go | 2 +- vms/tracedvm/tx.go | 2 +- vms/tracedvm/vertex_vm.go | 2 +- vms/types/blob_data.go | 2 +- wallet/chain/c/backend.go | 2 +- wallet/chain/c/builder.go | 2 +- wallet/chain/c/builder_with_options.go | 2 +- wallet/chain/c/context.go | 2 +- wallet/chain/c/signer.go | 2 +- wallet/chain/c/wallet.go | 2 +- wallet/chain/c/wallet_with_options.go | 2 +- wallet/chain/p/backend.go | 2 +- wallet/chain/p/backend_visitor.go | 2 +- wallet/chain/p/builder.go | 2 +- wallet/chain/p/builder_with_options.go | 2 +- wallet/chain/p/context.go | 2 +- wallet/chain/p/signer.go | 2 +- wallet/chain/p/signer_visitor.go | 2 +- wallet/chain/p/wallet.go | 2 +- wallet/chain/p/wallet_with_options.go | 2 +- wallet/chain/x/backend.go | 2 +- wallet/chain/x/backend_visitor.go | 2 +- wallet/chain/x/builder.go | 2 +- wallet/chain/x/builder_with_options.go | 2 +- wallet/chain/x/constants.go | 2 +- wallet/chain/x/context.go | 2 +- wallet/chain/x/signer.go | 2 +- wallet/chain/x/signer_visitor.go | 2 +- wallet/chain/x/wallet.go | 2 +- wallet/chain/x/wallet_with_options.go | 2 +- wallet/subnet/primary/api.go | 2 +- wallet/subnet/primary/common/options.go | 2 +- wallet/subnet/primary/common/spend.go | 2 +- wallet/subnet/primary/common/utxos.go | 2 +- wallet/subnet/primary/example_test.go | 2 +- .../primary/examples/add-permissioned-subnet-validator/main.go | 2 +- wallet/subnet/primary/examples/add-primary-validator/main.go | 2 +- wallet/subnet/primary/examples/c-chain-export/main.go | 2 +- wallet/subnet/primary/examples/c-chain-import/main.go | 2 +- wallet/subnet/primary/examples/create-asset/main.go | 2 +- wallet/subnet/primary/examples/create-chain/main.go | 2 +- wallet/subnet/primary/examples/create-locked-stakeable/main.go | 2 +- wallet/subnet/primary/examples/create-subnet/main.go | 2 +- wallet/subnet/primary/examples/get-p-chain-balance/main.go | 2 +- wallet/subnet/primary/examples/get-x-chain-balance/main.go | 2 +- wallet/subnet/primary/examples/remove-subnet-validator/main.go | 2 +- wallet/subnet/primary/utxos.go | 2 +- wallet/subnet/primary/wallet.go | 2 +- x/archivedb/batch.go | 2 +- x/archivedb/db.go | 2 +- x/archivedb/db_test.go | 2 +- x/archivedb/key.go | 2 +- x/archivedb/key_test.go | 2 +- x/archivedb/prefix_test.go | 2 +- x/archivedb/reader.go | 2 +- x/archivedb/value.go | 2 +- x/merkledb/batch.go | 2 +- x/merkledb/cache.go | 2 +- x/merkledb/cache_test.go | 2 +- x/merkledb/codec.go | 2 +- x/merkledb/codec_test.go | 2 +- x/merkledb/db.go | 2 +- x/merkledb/db_test.go | 2 +- x/merkledb/helpers_test.go | 2 +- x/merkledb/history.go | 2 +- x/merkledb/history_test.go | 2 +- x/merkledb/intermediate_node_db.go | 2 +- x/merkledb/intermediate_node_db_test.go | 2 +- x/merkledb/key.go | 2 +- x/merkledb/key_test.go | 2 +- x/merkledb/metrics.go | 2 +- x/merkledb/metrics_test.go | 2 +- x/merkledb/node.go | 2 +- x/merkledb/node_test.go | 2 +- x/merkledb/proof.go | 2 +- x/merkledb/proof_test.go | 2 +- x/merkledb/tracer.go | 2 +- x/merkledb/trie.go | 2 +- x/merkledb/trie_test.go | 2 +- x/merkledb/value_node_db.go | 2 +- x/merkledb/value_node_db_test.go | 2 +- x/merkledb/view.go | 2 +- x/merkledb/view_iterator.go | 2 +- x/merkledb/view_iterator_test.go | 2 +- x/sync/client.go | 2 +- x/sync/client_test.go | 2 +- x/sync/db.go | 2 +- x/sync/g_db/db_client.go | 2 +- x/sync/g_db/db_server.go | 2 +- x/sync/manager.go | 2 +- x/sync/metrics.go | 2 +- x/sync/network_client.go | 2 +- x/sync/network_server.go | 2 +- x/sync/network_server_test.go | 2 +- x/sync/response_handler.go | 2 +- x/sync/sync_test.go | 2 +- x/sync/workheap.go | 2 +- x/sync/workheap_test.go | 2 +- 1421 files changed, 1421 insertions(+), 1421 deletions(-) diff --git a/api/admin/client.go b/api/admin/client.go index 77f3835f060c..11ee2e5cef2c 100644 --- a/api/admin/client.go +++ b/api/admin/client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package admin diff --git a/api/admin/client_test.go b/api/admin/client_test.go index d005c49b448a..486a0a716564 100644 --- a/api/admin/client_test.go +++ b/api/admin/client_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package admin diff --git a/api/admin/service.go b/api/admin/service.go index f94a426b366c..5a60193acce8 100644 --- a/api/admin/service.go +++ b/api/admin/service.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package admin diff --git a/api/admin/service_test.go b/api/admin/service_test.go index 774c93440bc9..2076a5756b0b 100644 --- a/api/admin/service_test.go +++ b/api/admin/service_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package admin diff --git a/api/auth/auth.go b/api/auth/auth.go index a9869fe3ea23..f01b1d2fcd73 100644 --- a/api/auth/auth.go +++ b/api/auth/auth.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package auth diff --git a/api/auth/auth_test.go b/api/auth/auth_test.go index d8b7a4cca59b..caf921ca2a26 100644 --- a/api/auth/auth_test.go +++ b/api/auth/auth_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package auth diff --git a/api/auth/claims.go b/api/auth/claims.go index e2bf55d3078b..1cdda3d4a224 100644 --- a/api/auth/claims.go +++ b/api/auth/claims.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package auth diff --git a/api/auth/response.go b/api/auth/response.go index e87065c71501..eca4b39da9b8 100644 --- a/api/auth/response.go +++ b/api/auth/response.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package auth diff --git a/api/auth/service.go b/api/auth/service.go index 77517c174a5c..badb544c5ccb 100644 --- a/api/auth/service.go +++ b/api/auth/service.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package auth diff --git a/api/common_args_responses.go b/api/common_args_responses.go index 73624d529d9b..bcb33dcf4136 100644 --- a/api/common_args_responses.go +++ b/api/common_args_responses.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package api diff --git a/api/health/checker.go b/api/health/checker.go index efc895177ed3..b30e450660b8 100644 --- a/api/health/checker.go +++ b/api/health/checker.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package health diff --git a/api/health/client.go b/api/health/client.go index 7c615757f0ce..59daa555cdda 100644 --- a/api/health/client.go +++ b/api/health/client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package health diff --git a/api/health/client_test.go b/api/health/client_test.go index e42be5dbe852..e019829e68e4 100644 --- a/api/health/client_test.go +++ b/api/health/client_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package health diff --git a/api/health/handler.go b/api/health/handler.go index a8bd8269a158..a95c66a322c0 100644 --- a/api/health/handler.go +++ b/api/health/handler.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package health diff --git a/api/health/health.go b/api/health/health.go index 14f1bb7b4b4a..80012cf8c02e 100644 --- a/api/health/health.go +++ b/api/health/health.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package health diff --git a/api/health/health_test.go b/api/health/health_test.go index 432cefdf6194..64661c710929 100644 --- a/api/health/health_test.go +++ b/api/health/health_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package health diff --git a/api/health/metrics.go b/api/health/metrics.go index d567bc483d71..fdb7b2ed813b 100644 --- a/api/health/metrics.go +++ b/api/health/metrics.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package health diff --git a/api/health/result.go b/api/health/result.go index df9edb3419cc..e243cba1466d 100644 --- a/api/health/result.go +++ b/api/health/result.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package health diff --git a/api/health/service.go b/api/health/service.go index 368d986c52bb..7b48507075b2 100644 --- a/api/health/service.go +++ b/api/health/service.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package health diff --git a/api/health/service_test.go b/api/health/service_test.go index 0e60d467000a..b25e6dccc017 100644 --- a/api/health/service_test.go +++ b/api/health/service_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package health diff --git a/api/health/worker.go b/api/health/worker.go index f0e7a71ed13d..e42e77a4d52c 100644 --- a/api/health/worker.go +++ b/api/health/worker.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package health diff --git a/api/info/client.go b/api/info/client.go index f952f62a3c49..6caafd422233 100644 --- a/api/info/client.go +++ b/api/info/client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package info diff --git a/api/info/client_test.go b/api/info/client_test.go index 292a1841bd3c..7923ff94aff8 100644 --- a/api/info/client_test.go +++ b/api/info/client_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package info diff --git a/api/info/service.go b/api/info/service.go index 0ce1b38188c9..e315afd259ef 100644 --- a/api/info/service.go +++ b/api/info/service.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package info diff --git a/api/info/service_test.go b/api/info/service_test.go index ad6320df5a90..b91f87354d1d 100644 --- a/api/info/service_test.go +++ b/api/info/service_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package info diff --git a/api/ipcs/client.go b/api/ipcs/client.go index 95391f0f4469..121c1855bc8f 100644 --- a/api/ipcs/client.go +++ b/api/ipcs/client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package ipcs diff --git a/api/ipcs/service.go b/api/ipcs/service.go index b9bb90479ce9..efe6f2e7280b 100644 --- a/api/ipcs/service.go +++ b/api/ipcs/service.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package ipcs diff --git a/api/keystore/blockchain_keystore.go b/api/keystore/blockchain_keystore.go index 4c163b9627b7..31a3bdc59109 100644 --- a/api/keystore/blockchain_keystore.go +++ b/api/keystore/blockchain_keystore.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package keystore diff --git a/api/keystore/client.go b/api/keystore/client.go index 43442ace79fe..9d12ea0d1df9 100644 --- a/api/keystore/client.go +++ b/api/keystore/client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package keystore diff --git a/api/keystore/codec.go b/api/keystore/codec.go index 68025c140564..099bdbfa79e7 100644 --- a/api/keystore/codec.go +++ b/api/keystore/codec.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package keystore diff --git a/api/keystore/gkeystore/keystore_client.go b/api/keystore/gkeystore/keystore_client.go index 6bbfc6f92c1e..87527a640412 100644 --- a/api/keystore/gkeystore/keystore_client.go +++ b/api/keystore/gkeystore/keystore_client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package gkeystore diff --git a/api/keystore/gkeystore/keystore_server.go b/api/keystore/gkeystore/keystore_server.go index 9244939de3b9..65e6e90e99d9 100644 --- a/api/keystore/gkeystore/keystore_server.go +++ b/api/keystore/gkeystore/keystore_server.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package gkeystore diff --git a/api/keystore/keystore.go b/api/keystore/keystore.go index 02d5f5dc6238..ed3c9d21e57e 100644 --- a/api/keystore/keystore.go +++ b/api/keystore/keystore.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package keystore diff --git a/api/keystore/service.go b/api/keystore/service.go index d4c845743bbb..aa56433ee6e7 100644 --- a/api/keystore/service.go +++ b/api/keystore/service.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package keystore diff --git a/api/keystore/service_test.go b/api/keystore/service_test.go index 842ab7d76cc7..c011c92e78e1 100644 --- a/api/keystore/service_test.go +++ b/api/keystore/service_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package keystore diff --git a/api/metrics/gatherer_test.go b/api/metrics/gatherer_test.go index 2059c1ab584f..334c361ebcc0 100644 --- a/api/metrics/gatherer_test.go +++ b/api/metrics/gatherer_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package metrics diff --git a/api/metrics/multi_gatherer.go b/api/metrics/multi_gatherer.go index e3c88778ad4e..79affd4b7b2e 100644 --- a/api/metrics/multi_gatherer.go +++ b/api/metrics/multi_gatherer.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package metrics diff --git a/api/metrics/multi_gatherer_test.go b/api/metrics/multi_gatherer_test.go index a2e59a90d51e..033e3e88b1e6 100644 --- a/api/metrics/multi_gatherer_test.go +++ b/api/metrics/multi_gatherer_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package metrics diff --git a/api/metrics/optional_gatherer.go b/api/metrics/optional_gatherer.go index f31603281cee..686856efcc86 100644 --- a/api/metrics/optional_gatherer.go +++ b/api/metrics/optional_gatherer.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package metrics diff --git a/api/metrics/optional_gatherer_test.go b/api/metrics/optional_gatherer_test.go index 887029a3572b..201750701313 100644 --- a/api/metrics/optional_gatherer_test.go +++ b/api/metrics/optional_gatherer_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package metrics diff --git a/api/server/allowed_hosts.go b/api/server/allowed_hosts.go index 6745f0e17565..7d2812b2782a 100644 --- a/api/server/allowed_hosts.go +++ b/api/server/allowed_hosts.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package server diff --git a/api/server/allowed_hosts_test.go b/api/server/allowed_hosts_test.go index ae7a824834a9..47b1a53df0ba 100644 --- a/api/server/allowed_hosts_test.go +++ b/api/server/allowed_hosts_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package server diff --git a/api/server/metrics.go b/api/server/metrics.go index 9859494f3ae4..e3b2d76c83ea 100644 --- a/api/server/metrics.go +++ b/api/server/metrics.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package server diff --git a/api/server/router.go b/api/server/router.go index b37c6282c90d..6adadf608be4 100644 --- a/api/server/router.go +++ b/api/server/router.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package server diff --git a/api/server/router_test.go b/api/server/router_test.go index cae75d2c97bd..f6676a3727a3 100644 --- a/api/server/router_test.go +++ b/api/server/router_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package server diff --git a/api/server/server.go b/api/server/server.go index 0f676e0cef7f..a2364b6a17cd 100644 --- a/api/server/server.go +++ b/api/server/server.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package server diff --git a/api/server/server_test.go b/api/server/server_test.go index 865e090c10f1..584ad24a7862 100644 --- a/api/server/server_test.go +++ b/api/server/server_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package server diff --git a/api/server/wrapper.go b/api/server/wrapper.go index e467dc968065..b6cca85c731e 100644 --- a/api/server/wrapper.go +++ b/api/server/wrapper.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package server diff --git a/api/traced_handler.go b/api/traced_handler.go index 149be8208edc..9543c2ebbd15 100644 --- a/api/traced_handler.go +++ b/api/traced_handler.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package api diff --git a/app/app.go b/app/app.go index af651235ba77..c2da07b416a8 100644 --- a/app/app.go +++ b/app/app.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package app diff --git a/cache/cache.go b/cache/cache.go index 3d7206e79050..10ecad2c502f 100644 --- a/cache/cache.go +++ b/cache/cache.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package cache diff --git a/cache/empty_cache.go b/cache/empty_cache.go index 767cf5b74266..3a70ea91fe5d 100644 --- a/cache/empty_cache.go +++ b/cache/empty_cache.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package cache diff --git a/cache/lru_cache.go b/cache/lru_cache.go index 84d342db9f01..2a8a7ebe6d80 100644 --- a/cache/lru_cache.go +++ b/cache/lru_cache.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package cache diff --git a/cache/lru_cache_benchmark_test.go b/cache/lru_cache_benchmark_test.go index d8e4f4185933..3ddf03cb06f7 100644 --- a/cache/lru_cache_benchmark_test.go +++ b/cache/lru_cache_benchmark_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package cache diff --git a/cache/lru_cache_test.go b/cache/lru_cache_test.go index 9ae277299d94..e8f0b2883c1c 100644 --- a/cache/lru_cache_test.go +++ b/cache/lru_cache_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package cache diff --git a/cache/lru_sized_cache.go b/cache/lru_sized_cache.go index 6d093e033195..5dc9b5fdec01 100644 --- a/cache/lru_sized_cache.go +++ b/cache/lru_sized_cache.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package cache diff --git a/cache/lru_sized_cache_test.go b/cache/lru_sized_cache_test.go index 65dbcf8c8ab7..ad1c8b403362 100644 --- a/cache/lru_sized_cache_test.go +++ b/cache/lru_sized_cache_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package cache diff --git a/cache/metercacher/cache.go b/cache/metercacher/cache.go index 6b6fcd909c81..c2ff666f25e7 100644 --- a/cache/metercacher/cache.go +++ b/cache/metercacher/cache.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package metercacher diff --git a/cache/metercacher/cache_test.go b/cache/metercacher/cache_test.go index 7ef1676c0874..3f575acdc1d4 100644 --- a/cache/metercacher/cache_test.go +++ b/cache/metercacher/cache_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package metercacher diff --git a/cache/metercacher/metrics.go b/cache/metercacher/metrics.go index a65e31805934..f08082e1be71 100644 --- a/cache/metercacher/metrics.go +++ b/cache/metercacher/metrics.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package metercacher diff --git a/cache/test_cacher.go b/cache/test_cacher.go index 1b029bcb4b21..2e85502e4a55 100644 --- a/cache/test_cacher.go +++ b/cache/test_cacher.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package cache diff --git a/cache/unique_cache.go b/cache/unique_cache.go index 24052d79355e..b958b1f3a870 100644 --- a/cache/unique_cache.go +++ b/cache/unique_cache.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package cache diff --git a/cache/unique_cache_test.go b/cache/unique_cache_test.go index 3f0d40f8dc0d..199bdc87c081 100644 --- a/cache/unique_cache_test.go +++ b/cache/unique_cache_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package cache diff --git a/chains/atomic/codec.go b/chains/atomic/codec.go index 49bfd4bf9323..6a947fb27841 100644 --- a/chains/atomic/codec.go +++ b/chains/atomic/codec.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package atomic diff --git a/chains/atomic/gsharedmemory/filtered_batch.go b/chains/atomic/gsharedmemory/filtered_batch.go index df63e8df2d16..a6ba81251f57 100644 --- a/chains/atomic/gsharedmemory/filtered_batch.go +++ b/chains/atomic/gsharedmemory/filtered_batch.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package gsharedmemory diff --git a/chains/atomic/gsharedmemory/shared_memory_client.go b/chains/atomic/gsharedmemory/shared_memory_client.go index 649503a0313c..096a8117e7a1 100644 --- a/chains/atomic/gsharedmemory/shared_memory_client.go +++ b/chains/atomic/gsharedmemory/shared_memory_client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package gsharedmemory diff --git a/chains/atomic/gsharedmemory/shared_memory_server.go b/chains/atomic/gsharedmemory/shared_memory_server.go index 3e2d0d38940e..0aaa71c01f8e 100644 --- a/chains/atomic/gsharedmemory/shared_memory_server.go +++ b/chains/atomic/gsharedmemory/shared_memory_server.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package gsharedmemory diff --git a/chains/atomic/gsharedmemory/shared_memory_test.go b/chains/atomic/gsharedmemory/shared_memory_test.go index 0ce546c94f77..02dfb7324a78 100644 --- a/chains/atomic/gsharedmemory/shared_memory_test.go +++ b/chains/atomic/gsharedmemory/shared_memory_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package gsharedmemory diff --git a/chains/atomic/memory.go b/chains/atomic/memory.go index 77c1bb78cec6..76f5b6451d97 100644 --- a/chains/atomic/memory.go +++ b/chains/atomic/memory.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package atomic diff --git a/chains/atomic/memory_test.go b/chains/atomic/memory_test.go index 5acdb5233af4..7ca02e6d7275 100644 --- a/chains/atomic/memory_test.go +++ b/chains/atomic/memory_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package atomic diff --git a/chains/atomic/prefixes.go b/chains/atomic/prefixes.go index 08927384317e..adc21c36e2b0 100644 --- a/chains/atomic/prefixes.go +++ b/chains/atomic/prefixes.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package atomic diff --git a/chains/atomic/shared_memory.go b/chains/atomic/shared_memory.go index 7b2f8a562c82..d90c5685fa35 100644 --- a/chains/atomic/shared_memory.go +++ b/chains/atomic/shared_memory.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package atomic diff --git a/chains/atomic/shared_memory_test.go b/chains/atomic/shared_memory_test.go index bb3266d80602..1597d662131a 100644 --- a/chains/atomic/shared_memory_test.go +++ b/chains/atomic/shared_memory_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package atomic diff --git a/chains/atomic/state.go b/chains/atomic/state.go index 7751d452b510..a9e9bbd05cd8 100644 --- a/chains/atomic/state.go +++ b/chains/atomic/state.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package atomic diff --git a/chains/atomic/test_shared_memory.go b/chains/atomic/test_shared_memory.go index d89940c31c2f..82b1cbeff3a5 100644 --- a/chains/atomic/test_shared_memory.go +++ b/chains/atomic/test_shared_memory.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package atomic diff --git a/chains/atomic/writer.go b/chains/atomic/writer.go index d117218fe87d..6bcdd86b00b4 100644 --- a/chains/atomic/writer.go +++ b/chains/atomic/writer.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package atomic diff --git a/chains/linearizable_vm.go b/chains/linearizable_vm.go index f4fc93f7a696..97fe9eb4d1f4 100644 --- a/chains/linearizable_vm.go +++ b/chains/linearizable_vm.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package chains diff --git a/chains/manager.go b/chains/manager.go index 74263c85317e..97f80e1a79c5 100644 --- a/chains/manager.go +++ b/chains/manager.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package chains diff --git a/chains/registrant.go b/chains/registrant.go index 3a2137048c1b..cd3aa6e9c0bf 100644 --- a/chains/registrant.go +++ b/chains/registrant.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package chains diff --git a/chains/test_manager.go b/chains/test_manager.go index e4dabea426f9..d142035b422c 100644 --- a/chains/test_manager.go +++ b/chains/test_manager.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package chains diff --git a/codec/codec.go b/codec/codec.go index 413b6d174be2..7aacb9085848 100644 --- a/codec/codec.go +++ b/codec/codec.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package codec diff --git a/codec/general_codec.go b/codec/general_codec.go index ac32b84e6a87..3688065a021f 100644 --- a/codec/general_codec.go +++ b/codec/general_codec.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package codec diff --git a/codec/hierarchycodec/codec.go b/codec/hierarchycodec/codec.go index 1b82380bc576..63bd9efa0443 100644 --- a/codec/hierarchycodec/codec.go +++ b/codec/hierarchycodec/codec.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package hierarchycodec diff --git a/codec/hierarchycodec/codec_test.go b/codec/hierarchycodec/codec_test.go index c4c71d76571c..72f3e30982db 100644 --- a/codec/hierarchycodec/codec_test.go +++ b/codec/hierarchycodec/codec_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package hierarchycodec diff --git a/codec/linearcodec/codec.go b/codec/linearcodec/codec.go index 07097aee79eb..0bb0dbf27ed1 100644 --- a/codec/linearcodec/codec.go +++ b/codec/linearcodec/codec.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package linearcodec diff --git a/codec/linearcodec/codec_test.go b/codec/linearcodec/codec_test.go index db8a4e720dd6..1e9b14852a72 100644 --- a/codec/linearcodec/codec_test.go +++ b/codec/linearcodec/codec_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package linearcodec diff --git a/codec/manager.go b/codec/manager.go index 3a5e9eb174fc..6fb48aaad9f8 100644 --- a/codec/manager.go +++ b/codec/manager.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package codec diff --git a/codec/reflectcodec/struct_fielder.go b/codec/reflectcodec/struct_fielder.go index a16212a62103..efac391e8362 100644 --- a/codec/reflectcodec/struct_fielder.go +++ b/codec/reflectcodec/struct_fielder.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package reflectcodec diff --git a/codec/reflectcodec/type_codec.go b/codec/reflectcodec/type_codec.go index ad2e11378163..30a8d9dcc268 100644 --- a/codec/reflectcodec/type_codec.go +++ b/codec/reflectcodec/type_codec.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package reflectcodec diff --git a/codec/registry.go b/codec/registry.go index f0f1c2ff8157..de87e1a9b2aa 100644 --- a/codec/registry.go +++ b/codec/registry.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package codec diff --git a/codec/test_codec.go b/codec/test_codec.go index 3c933816a253..931f9bd2e89d 100644 --- a/codec/test_codec.go +++ b/codec/test_codec.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package codec diff --git a/config/config.go b/config/config.go index 4cae079f3572..0c53f46837a4 100644 --- a/config/config.go +++ b/config/config.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package config diff --git a/config/config_test.go b/config/config_test.go index 037b8ac450cc..4c64e448ac13 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package config diff --git a/config/flags.go b/config/flags.go index 333ea302be07..acf965aea3a2 100644 --- a/config/flags.go +++ b/config/flags.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package config diff --git a/config/keys.go b/config/keys.go index 078e08465721..45ccdf0a9d83 100644 --- a/config/keys.go +++ b/config/keys.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package config diff --git a/config/viper.go b/config/viper.go index 1e236ea32001..59ecf1941687 100644 --- a/config/viper.go +++ b/config/viper.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package config diff --git a/database/batch.go b/database/batch.go index b097dc60eea7..8699a90c2960 100644 --- a/database/batch.go +++ b/database/batch.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. // For ease of implementation, our database's interface matches Ethereum's diff --git a/database/benchmark_database.go b/database/benchmark_database.go index 949c071f84f5..b27eec902caa 100644 --- a/database/benchmark_database.go +++ b/database/benchmark_database.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package database diff --git a/database/common.go b/database/common.go index a27b0d27d4d0..651b8fe5719c 100644 --- a/database/common.go +++ b/database/common.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package database diff --git a/database/corruptabledb/db.go b/database/corruptabledb/db.go index cb46953f6858..d5bd6a711353 100644 --- a/database/corruptabledb/db.go +++ b/database/corruptabledb/db.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package corruptabledb diff --git a/database/corruptabledb/db_test.go b/database/corruptabledb/db_test.go index b58c65b4b162..566a6b084e19 100644 --- a/database/corruptabledb/db_test.go +++ b/database/corruptabledb/db_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package corruptabledb diff --git a/database/database.go b/database/database.go index d0c274131d75..938c7f631b93 100644 --- a/database/database.go +++ b/database/database.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. // For ease of implementation, our database's interface matches Ethereum's diff --git a/database/encdb/codec.go b/database/encdb/codec.go index ab9977945f6d..b786bec66916 100644 --- a/database/encdb/codec.go +++ b/database/encdb/codec.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package encdb diff --git a/database/encdb/db.go b/database/encdb/db.go index 27565c87f99b..1b225b38f3cd 100644 --- a/database/encdb/db.go +++ b/database/encdb/db.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package encdb diff --git a/database/encdb/db_test.go b/database/encdb/db_test.go index f49dd7ebb28d..871460a90a41 100644 --- a/database/encdb/db_test.go +++ b/database/encdb/db_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package encdb diff --git a/database/errors.go b/database/errors.go index ee46521b6499..24f93aa8da27 100644 --- a/database/errors.go +++ b/database/errors.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package database diff --git a/database/helpers.go b/database/helpers.go index d4261920dcdf..7e66c58fa770 100644 --- a/database/helpers.go +++ b/database/helpers.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package database diff --git a/database/helpers_test.go b/database/helpers_test.go index 79e37ea74b67..1ad3ccc2b20d 100644 --- a/database/helpers_test.go +++ b/database/helpers_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package database diff --git a/database/iterator.go b/database/iterator.go index c83ceac49639..75126006d4ac 100644 --- a/database/iterator.go +++ b/database/iterator.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. // For ease of implementation, our database's interface matches Ethereum's diff --git a/database/leveldb/db.go b/database/leveldb/db.go index ab08db75a1c8..8ae825ef2fb1 100644 --- a/database/leveldb/db.go +++ b/database/leveldb/db.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package leveldb diff --git a/database/leveldb/db_test.go b/database/leveldb/db_test.go index 23733dacaff4..bf70739ce222 100644 --- a/database/leveldb/db_test.go +++ b/database/leveldb/db_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package leveldb diff --git a/database/leveldb/metrics.go b/database/leveldb/metrics.go index 11bca8ddb07e..055579c8e6f4 100644 --- a/database/leveldb/metrics.go +++ b/database/leveldb/metrics.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package leveldb diff --git a/database/linkeddb/codec.go b/database/linkeddb/codec.go index b2607dfbb045..24c5398aa8a1 100644 --- a/database/linkeddb/codec.go +++ b/database/linkeddb/codec.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package linkeddb diff --git a/database/linkeddb/linkeddb.go b/database/linkeddb/linkeddb.go index 6120d182fbc2..f40498812cda 100644 --- a/database/linkeddb/linkeddb.go +++ b/database/linkeddb/linkeddb.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package linkeddb diff --git a/database/linkeddb/linkeddb_test.go b/database/linkeddb/linkeddb_test.go index 6f9cba4501de..815cac730b05 100644 --- a/database/linkeddb/linkeddb_test.go +++ b/database/linkeddb/linkeddb_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package linkeddb diff --git a/database/memdb/db.go b/database/memdb/db.go index 92b687afc0a5..914739f9e206 100644 --- a/database/memdb/db.go +++ b/database/memdb/db.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package memdb diff --git a/database/memdb/db_test.go b/database/memdb/db_test.go index 10d8ebe2be25..21c97909c7fb 100644 --- a/database/memdb/db_test.go +++ b/database/memdb/db_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package memdb diff --git a/database/meterdb/db.go b/database/meterdb/db.go index a2640ca2dc00..fd3b3b77d7a8 100644 --- a/database/meterdb/db.go +++ b/database/meterdb/db.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package meterdb diff --git a/database/meterdb/db_test.go b/database/meterdb/db_test.go index a54d25c21542..cd36a6fb34f2 100644 --- a/database/meterdb/db_test.go +++ b/database/meterdb/db_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package meterdb diff --git a/database/meterdb/metrics.go b/database/meterdb/metrics.go index a0a20e9d5f26..40cdf4566413 100644 --- a/database/meterdb/metrics.go +++ b/database/meterdb/metrics.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package meterdb diff --git a/database/pebble/batch.go b/database/pebble/batch.go index b6c9d283b64d..a53b962dc7be 100644 --- a/database/pebble/batch.go +++ b/database/pebble/batch.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package pebble diff --git a/database/pebble/batch_test.go b/database/pebble/batch_test.go index a84134708956..66f4075558fd 100644 --- a/database/pebble/batch_test.go +++ b/database/pebble/batch_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package pebble diff --git a/database/pebble/db.go b/database/pebble/db.go index 7aa718082a35..4838ff4b0ffe 100644 --- a/database/pebble/db.go +++ b/database/pebble/db.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package pebble diff --git a/database/pebble/db_test.go b/database/pebble/db_test.go index 043caa23c813..2ea3c354f3d8 100644 --- a/database/pebble/db_test.go +++ b/database/pebble/db_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package pebble diff --git a/database/pebble/iterator.go b/database/pebble/iterator.go index 115c122e30f4..5fc73f308a13 100644 --- a/database/pebble/iterator.go +++ b/database/pebble/iterator.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package pebble diff --git a/database/prefixdb/db.go b/database/prefixdb/db.go index f4ba04e31b06..64a644918241 100644 --- a/database/prefixdb/db.go +++ b/database/prefixdb/db.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package prefixdb diff --git a/database/prefixdb/db_test.go b/database/prefixdb/db_test.go index a0539b8e0105..109d8c4c9aba 100644 --- a/database/prefixdb/db_test.go +++ b/database/prefixdb/db_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package prefixdb diff --git a/database/rpcdb/db_client.go b/database/rpcdb/db_client.go index 3e92a9a8477a..9f91667b41b6 100644 --- a/database/rpcdb/db_client.go +++ b/database/rpcdb/db_client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package rpcdb diff --git a/database/rpcdb/db_server.go b/database/rpcdb/db_server.go index e9e135738e89..6bcbd4e0276b 100644 --- a/database/rpcdb/db_server.go +++ b/database/rpcdb/db_server.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package rpcdb diff --git a/database/rpcdb/db_test.go b/database/rpcdb/db_test.go index baabc9a69fbf..99323f8bd8c1 100644 --- a/database/rpcdb/db_test.go +++ b/database/rpcdb/db_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package rpcdb diff --git a/database/rpcdb/errors.go b/database/rpcdb/errors.go index 8a1fae2f0a1e..2cd759b6d612 100644 --- a/database/rpcdb/errors.go +++ b/database/rpcdb/errors.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package rpcdb diff --git a/database/test_database.go b/database/test_database.go index fc7e644ae5fd..1ce32bb54257 100644 --- a/database/test_database.go +++ b/database/test_database.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package database diff --git a/database/versiondb/db.go b/database/versiondb/db.go index d65dca947502..479e8af814d1 100644 --- a/database/versiondb/db.go +++ b/database/versiondb/db.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package versiondb diff --git a/database/versiondb/db_test.go b/database/versiondb/db_test.go index c2f57caacf61..c3093a9ee843 100644 --- a/database/versiondb/db_test.go +++ b/database/versiondb/db_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package versiondb diff --git a/genesis/aliases.go b/genesis/aliases.go index b12e50d6f885..c6f8b3df2b74 100644 --- a/genesis/aliases.go +++ b/genesis/aliases.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package genesis diff --git a/genesis/bootstrappers.go b/genesis/bootstrappers.go index 4aec33f9c3d9..cac90bb50301 100644 --- a/genesis/bootstrappers.go +++ b/genesis/bootstrappers.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package genesis diff --git a/genesis/bootstrappers_test.go b/genesis/bootstrappers_test.go index d14eebbb559a..cde226f283dc 100644 --- a/genesis/bootstrappers_test.go +++ b/genesis/bootstrappers_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package genesis diff --git a/genesis/config.go b/genesis/config.go index cedaf90127a9..6e8ea15e7432 100644 --- a/genesis/config.go +++ b/genesis/config.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package genesis diff --git a/genesis/config_test.go b/genesis/config_test.go index d83815cebfba..8a9bc96a9c94 100644 --- a/genesis/config_test.go +++ b/genesis/config_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package genesis diff --git a/genesis/genesis.go b/genesis/genesis.go index 567f21f061be..217713520fb0 100644 --- a/genesis/genesis.go +++ b/genesis/genesis.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package genesis diff --git a/genesis/genesis_fuji.go b/genesis/genesis_fuji.go index a9bcaffcb956..27c43f79fd0b 100644 --- a/genesis/genesis_fuji.go +++ b/genesis/genesis_fuji.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package genesis diff --git a/genesis/genesis_local.go b/genesis/genesis_local.go index de650009fd26..5a76aa25cfcf 100644 --- a/genesis/genesis_local.go +++ b/genesis/genesis_local.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package genesis diff --git a/genesis/genesis_mainnet.go b/genesis/genesis_mainnet.go index 4e55c891be73..3808174ebbd1 100644 --- a/genesis/genesis_mainnet.go +++ b/genesis/genesis_mainnet.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package genesis diff --git a/genesis/genesis_test.go b/genesis/genesis_test.go index b18bc7f521a3..3257d6a0c271 100644 --- a/genesis/genesis_test.go +++ b/genesis/genesis_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package genesis diff --git a/genesis/params.go b/genesis/params.go index 496a573c48f8..e2ae45c697e6 100644 --- a/genesis/params.go +++ b/genesis/params.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package genesis diff --git a/genesis/unparsed_config.go b/genesis/unparsed_config.go index 647443bae482..2ace7647c363 100644 --- a/genesis/unparsed_config.go +++ b/genesis/unparsed_config.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package genesis diff --git a/ids/aliases.go b/ids/aliases.go index c7958e1c425e..484c6f8aa4b3 100644 --- a/ids/aliases.go +++ b/ids/aliases.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package ids diff --git a/ids/aliases_test.go b/ids/aliases_test.go index b25177242ff2..6c77d7443703 100644 --- a/ids/aliases_test.go +++ b/ids/aliases_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package ids diff --git a/ids/bits.go b/ids/bits.go index a884578f420b..bb3586704c4f 100644 --- a/ids/bits.go +++ b/ids/bits.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package ids diff --git a/ids/bits_test.go b/ids/bits_test.go index 4b5783dded46..feb381902000 100644 --- a/ids/bits_test.go +++ b/ids/bits_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package ids diff --git a/ids/galiasreader/alias_reader_client.go b/ids/galiasreader/alias_reader_client.go index aa77f9ec870f..319d7508cbd4 100644 --- a/ids/galiasreader/alias_reader_client.go +++ b/ids/galiasreader/alias_reader_client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package galiasreader diff --git a/ids/galiasreader/alias_reader_server.go b/ids/galiasreader/alias_reader_server.go index 48f31bf74e3a..eeb9083ca1e4 100644 --- a/ids/galiasreader/alias_reader_server.go +++ b/ids/galiasreader/alias_reader_server.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package galiasreader diff --git a/ids/galiasreader/alias_reader_test.go b/ids/galiasreader/alias_reader_test.go index f268d10fc268..899c13a24ed2 100644 --- a/ids/galiasreader/alias_reader_test.go +++ b/ids/galiasreader/alias_reader_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package galiasreader diff --git a/ids/id.go b/ids/id.go index dc22ff0200ae..6cda4b6ec854 100644 --- a/ids/id.go +++ b/ids/id.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package ids diff --git a/ids/id_test.go b/ids/id_test.go index af12bc78f714..930a323e614c 100644 --- a/ids/id_test.go +++ b/ids/id_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package ids diff --git a/ids/node_id.go b/ids/node_id.go index f2ce6d9acfb7..7e9e94a12cdd 100644 --- a/ids/node_id.go +++ b/ids/node_id.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package ids diff --git a/ids/node_id_test.go b/ids/node_id_test.go index 4aac5875b104..2c94450f5b66 100644 --- a/ids/node_id_test.go +++ b/ids/node_id_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package ids diff --git a/ids/request_id.go b/ids/request_id.go index 779f819d9d4e..e1d9459866f7 100644 --- a/ids/request_id.go +++ b/ids/request_id.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package ids diff --git a/ids/short.go b/ids/short.go index 8de2a43828b8..7c01dca4785a 100644 --- a/ids/short.go +++ b/ids/short.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package ids diff --git a/ids/test_aliases.go b/ids/test_aliases.go index 7e2b4fb9790e..ce9991f5f737 100644 --- a/ids/test_aliases.go +++ b/ids/test_aliases.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package ids diff --git a/ids/test_generator.go b/ids/test_generator.go index 29ecfa8d409c..2df95ec0499f 100644 --- a/ids/test_generator.go +++ b/ids/test_generator.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package ids diff --git a/indexer/client.go b/indexer/client.go index 785018e3072c..821059a1d6c0 100644 --- a/indexer/client.go +++ b/indexer/client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package indexer diff --git a/indexer/client_test.go b/indexer/client_test.go index 004c8eeb283d..95124a2129ab 100644 --- a/indexer/client_test.go +++ b/indexer/client_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package indexer diff --git a/indexer/codec.go b/indexer/codec.go index f41cb8fa80f1..6addc9e3ca19 100644 --- a/indexer/codec.go +++ b/indexer/codec.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package indexer diff --git a/indexer/container.go b/indexer/container.go index c640fdd96d19..2bbb68e5db6f 100644 --- a/indexer/container.go +++ b/indexer/container.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package indexer diff --git a/indexer/examples/p-chain/main.go b/indexer/examples/p-chain/main.go index fb9ec2d6f2f6..9f8966d21546 100644 --- a/indexer/examples/p-chain/main.go +++ b/indexer/examples/p-chain/main.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package main diff --git a/indexer/examples/x-chain-blocks/main.go b/indexer/examples/x-chain-blocks/main.go index a995f9612bbd..92c5f7ad34e7 100644 --- a/indexer/examples/x-chain-blocks/main.go +++ b/indexer/examples/x-chain-blocks/main.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package main diff --git a/indexer/index.go b/indexer/index.go index d182c6938d8e..86d75b37d4cb 100644 --- a/indexer/index.go +++ b/indexer/index.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package indexer diff --git a/indexer/index_test.go b/indexer/index_test.go index 0007c8ae4e12..127aa64bda69 100644 --- a/indexer/index_test.go +++ b/indexer/index_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package indexer diff --git a/indexer/indexer.go b/indexer/indexer.go index 99f475892562..6b16f8245ebc 100644 --- a/indexer/indexer.go +++ b/indexer/indexer.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package indexer diff --git a/indexer/indexer_test.go b/indexer/indexer_test.go index 16c4aa7bc381..348aa87d13a9 100644 --- a/indexer/indexer_test.go +++ b/indexer/indexer_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package indexer diff --git a/indexer/service.go b/indexer/service.go index 5fae26bd3ee2..83f9912f2fea 100644 --- a/indexer/service.go +++ b/indexer/service.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package indexer diff --git a/ipcs/chainipc.go b/ipcs/chainipc.go index 56d4393360ff..bb78cc175327 100644 --- a/ipcs/chainipc.go +++ b/ipcs/chainipc.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package ipcs diff --git a/ipcs/eventsocket.go b/ipcs/eventsocket.go index 109b42bb34af..0dbbe1c92e5a 100644 --- a/ipcs/eventsocket.go +++ b/ipcs/eventsocket.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package ipcs diff --git a/ipcs/socket/socket.go b/ipcs/socket/socket.go index d3ca391dd019..77f2d6fdb8e2 100644 --- a/ipcs/socket/socket.go +++ b/ipcs/socket/socket.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package socket diff --git a/ipcs/socket/socket_test.go b/ipcs/socket/socket_test.go index a56329b28c3e..a2c1ec638754 100644 --- a/ipcs/socket/socket_test.go +++ b/ipcs/socket/socket_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package socket diff --git a/ipcs/socket/socket_unix.go b/ipcs/socket/socket_unix.go index 98f4ad492330..14d5aabde4e3 100644 --- a/ipcs/socket/socket_unix.go +++ b/ipcs/socket/socket_unix.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. //go:build !windows && !plan9 && !js diff --git a/ipcs/socket/socket_windows.go b/ipcs/socket/socket_windows.go index eb54ccf07066..99590cb674b4 100644 --- a/ipcs/socket/socket_windows.go +++ b/ipcs/socket/socket_windows.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. //go:build windows diff --git a/main/main.go b/main/main.go index 2b07898f9072..549ef65f48cf 100644 --- a/main/main.go +++ b/main/main.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package main diff --git a/message/creator.go b/message/creator.go index f1a6def2b21e..a5711375c331 100644 --- a/message/creator.go +++ b/message/creator.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package message diff --git a/message/fields.go b/message/fields.go index 87bffe518abd..08e744fab911 100644 --- a/message/fields.go +++ b/message/fields.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package message diff --git a/message/inbound_msg_builder.go b/message/inbound_msg_builder.go index 8541645840aa..b32dbc5d480d 100644 --- a/message/inbound_msg_builder.go +++ b/message/inbound_msg_builder.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package message diff --git a/message/inbound_msg_builder_test.go b/message/inbound_msg_builder_test.go index 08234b58fd88..b14b3ddedab7 100644 --- a/message/inbound_msg_builder_test.go +++ b/message/inbound_msg_builder_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package message diff --git a/message/internal_msg_builder.go b/message/internal_msg_builder.go index 9b1780b42571..38a95cb78a8c 100644 --- a/message/internal_msg_builder.go +++ b/message/internal_msg_builder.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. //nolint:stylecheck // proto generates interfaces that fail linting diff --git a/message/messages.go b/message/messages.go index 8d9671e63123..fbd3519de30d 100644 --- a/message/messages.go +++ b/message/messages.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package message diff --git a/message/messages_benchmark_test.go b/message/messages_benchmark_test.go index 9864e6a231f8..48ae10acf5dd 100644 --- a/message/messages_benchmark_test.go +++ b/message/messages_benchmark_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package message diff --git a/message/messages_test.go b/message/messages_test.go index 3ae3cf015119..e164e8993007 100644 --- a/message/messages_test.go +++ b/message/messages_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package message diff --git a/message/ops.go b/message/ops.go index 2ecae08db396..2f496713e419 100644 --- a/message/ops.go +++ b/message/ops.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package message diff --git a/message/outbound_msg_builder.go b/message/outbound_msg_builder.go index a6149fd35784..f50f5cf6ae5d 100644 --- a/message/outbound_msg_builder.go +++ b/message/outbound_msg_builder.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package message diff --git a/message/outbound_msg_builder_test.go b/message/outbound_msg_builder_test.go index 50f273bf4b13..1b6895f3f52c 100644 --- a/message/outbound_msg_builder_test.go +++ b/message/outbound_msg_builder_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package message diff --git a/nat/nat.go b/nat/nat.go index 33749ca0e572..20af4fe27ea9 100644 --- a/nat/nat.go +++ b/nat/nat.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package nat diff --git a/nat/no_router.go b/nat/no_router.go index 5c894c8c673c..19c68dac5538 100644 --- a/nat/no_router.go +++ b/nat/no_router.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package nat diff --git a/nat/pmp.go b/nat/pmp.go index ad2032ec1493..ecee9793f934 100644 --- a/nat/pmp.go +++ b/nat/pmp.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package nat diff --git a/nat/upnp.go b/nat/upnp.go index 2571048e367e..aa26d6d82fc6 100644 --- a/nat/upnp.go +++ b/nat/upnp.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package nat diff --git a/network/certs_test.go b/network/certs_test.go index 10b92586ed5c..483d6ea4eeee 100644 --- a/network/certs_test.go +++ b/network/certs_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package network diff --git a/network/config.go b/network/config.go index e1a32e4ee1a5..eda7257fa62c 100644 --- a/network/config.go +++ b/network/config.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package network diff --git a/network/conn_test.go b/network/conn_test.go index 4394cd885e3c..6a44c6153992 100644 --- a/network/conn_test.go +++ b/network/conn_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package network diff --git a/network/dialer/dialer.go b/network/dialer/dialer.go index 22e8c3ba1bfe..109b63cc2002 100644 --- a/network/dialer/dialer.go +++ b/network/dialer/dialer.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package dialer diff --git a/network/dialer/dialer_test.go b/network/dialer/dialer_test.go index 95011996bcdf..a824b8b03e08 100644 --- a/network/dialer/dialer_test.go +++ b/network/dialer/dialer_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package dialer diff --git a/network/dialer_test.go b/network/dialer_test.go index b6f2eef15def..ecc506ba2927 100644 --- a/network/dialer_test.go +++ b/network/dialer_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package network diff --git a/network/example_test.go b/network/example_test.go index 8f20900a7e8d..bfac03fba44f 100644 --- a/network/example_test.go +++ b/network/example_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package network diff --git a/network/handler_test.go b/network/handler_test.go index 64350b3b289a..08c99a0d4e70 100644 --- a/network/handler_test.go +++ b/network/handler_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package network diff --git a/network/listener_test.go b/network/listener_test.go index 1b15b0062536..5d6073c6b383 100644 --- a/network/listener_test.go +++ b/network/listener_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package network diff --git a/network/metrics.go b/network/metrics.go index 3e566a31c99f..e2a3a363b403 100644 --- a/network/metrics.go +++ b/network/metrics.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package network diff --git a/network/network.go b/network/network.go index 8359bd37841b..2dc6b2bbfdcb 100644 --- a/network/network.go +++ b/network/network.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package network diff --git a/network/network_test.go b/network/network_test.go index 65d4809101fb..916b527da82b 100644 --- a/network/network_test.go +++ b/network/network_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package network diff --git a/network/p2p/client.go b/network/p2p/client.go index 982b7c50f1f0..6107f8abb7d9 100644 --- a/network/p2p/client.go +++ b/network/p2p/client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package p2p diff --git a/network/p2p/gossip/bloom.go b/network/p2p/gossip/bloom.go index bb588b23bb4f..12fca6bfcad4 100644 --- a/network/p2p/gossip/bloom.go +++ b/network/p2p/gossip/bloom.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package gossip diff --git a/network/p2p/gossip/bloom_test.go b/network/p2p/gossip/bloom_test.go index 1a05a7eb9bd5..9eb06a6a2458 100644 --- a/network/p2p/gossip/bloom_test.go +++ b/network/p2p/gossip/bloom_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package gossip diff --git a/network/p2p/gossip/gossip.go b/network/p2p/gossip/gossip.go index 60eb5560babf..dfeb50d201a1 100644 --- a/network/p2p/gossip/gossip.go +++ b/network/p2p/gossip/gossip.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package gossip diff --git a/network/p2p/gossip/gossip_test.go b/network/p2p/gossip/gossip_test.go index 25bfac3a4303..94387ebd9420 100644 --- a/network/p2p/gossip/gossip_test.go +++ b/network/p2p/gossip/gossip_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package gossip diff --git a/network/p2p/gossip/gossipable.go b/network/p2p/gossip/gossipable.go index bf6ff1644634..a204c465720d 100644 --- a/network/p2p/gossip/gossipable.go +++ b/network/p2p/gossip/gossipable.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package gossip diff --git a/network/p2p/gossip/handler.go b/network/p2p/gossip/handler.go index 85d2d1413544..380b67ad2dc3 100644 --- a/network/p2p/gossip/handler.go +++ b/network/p2p/gossip/handler.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package gossip diff --git a/network/p2p/gossip/test_gossip.go b/network/p2p/gossip/test_gossip.go index 4603333ba28f..f903693c8054 100644 --- a/network/p2p/gossip/test_gossip.go +++ b/network/p2p/gossip/test_gossip.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package gossip diff --git a/network/p2p/handler.go b/network/p2p/handler.go index 6829f0b94213..3ff4de29037e 100644 --- a/network/p2p/handler.go +++ b/network/p2p/handler.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package p2p diff --git a/network/p2p/handler_test.go b/network/p2p/handler_test.go index 3ed82cb06cbd..0633b70f00a8 100644 --- a/network/p2p/handler_test.go +++ b/network/p2p/handler_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package p2p diff --git a/network/p2p/network.go b/network/p2p/network.go index 76b5c13e76ad..604d06db617f 100644 --- a/network/p2p/network.go +++ b/network/p2p/network.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package p2p diff --git a/network/p2p/network_test.go b/network/p2p/network_test.go index f86399809885..6aea3bc554d0 100644 --- a/network/p2p/network_test.go +++ b/network/p2p/network_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package p2p diff --git a/network/p2p/node_sampler.go b/network/p2p/node_sampler.go index 057a175027a4..5bb3815e3b90 100644 --- a/network/p2p/node_sampler.go +++ b/network/p2p/node_sampler.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package p2p diff --git a/network/p2p/peer_tracker.go b/network/p2p/peer_tracker.go index 338d890bed22..c0eda693859b 100644 --- a/network/p2p/peer_tracker.go +++ b/network/p2p/peer_tracker.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package p2p diff --git a/network/p2p/peer_tracker_test.go b/network/p2p/peer_tracker_test.go index d7c38b828e9d..bf771d177841 100644 --- a/network/p2p/peer_tracker_test.go +++ b/network/p2p/peer_tracker_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package p2p diff --git a/network/p2p/router.go b/network/p2p/router.go index 5c52b3d1aaa2..82fdbf24fbc3 100644 --- a/network/p2p/router.go +++ b/network/p2p/router.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package p2p diff --git a/network/p2p/throttler.go b/network/p2p/throttler.go index de173a655266..c8f34a7ee90f 100644 --- a/network/p2p/throttler.go +++ b/network/p2p/throttler.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package p2p diff --git a/network/p2p/throttler_handler.go b/network/p2p/throttler_handler.go index aee5bee70795..8fa3df93faee 100644 --- a/network/p2p/throttler_handler.go +++ b/network/p2p/throttler_handler.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package p2p diff --git a/network/p2p/throttler_handler_test.go b/network/p2p/throttler_handler_test.go index 8c18a10dc308..1f5a07069d8e 100644 --- a/network/p2p/throttler_handler_test.go +++ b/network/p2p/throttler_handler_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package p2p diff --git a/network/p2p/throttler_test.go b/network/p2p/throttler_test.go index c7b0153e671d..3c3c56360dc1 100644 --- a/network/p2p/throttler_test.go +++ b/network/p2p/throttler_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package p2p diff --git a/network/p2p/validators.go b/network/p2p/validators.go index 06a1e913bd0f..3ece6559af42 100644 --- a/network/p2p/validators.go +++ b/network/p2p/validators.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package p2p diff --git a/network/p2p/validators_test.go b/network/p2p/validators_test.go index 9e90242e201d..a5d4e7724cdd 100644 --- a/network/p2p/validators_test.go +++ b/network/p2p/validators_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package p2p diff --git a/network/peer/config.go b/network/peer/config.go index 403ddfeb5334..0a01cf87fb92 100644 --- a/network/peer/config.go +++ b/network/peer/config.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package peer diff --git a/network/peer/example_test.go b/network/peer/example_test.go index 75eaecee53d5..d6c8ba20c913 100644 --- a/network/peer/example_test.go +++ b/network/peer/example_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package peer diff --git a/network/peer/gossip_tracker.go b/network/peer/gossip_tracker.go index 5676b0734fc8..105d3e5ce64d 100644 --- a/network/peer/gossip_tracker.go +++ b/network/peer/gossip_tracker.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package peer diff --git a/network/peer/gossip_tracker_callback.go b/network/peer/gossip_tracker_callback.go index 28514ac163a6..5863b236e069 100644 --- a/network/peer/gossip_tracker_callback.go +++ b/network/peer/gossip_tracker_callback.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package peer diff --git a/network/peer/gossip_tracker_metrics.go b/network/peer/gossip_tracker_metrics.go index e80f31765b9c..080f37fde5c1 100644 --- a/network/peer/gossip_tracker_metrics.go +++ b/network/peer/gossip_tracker_metrics.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package peer diff --git a/network/peer/gossip_tracker_test.go b/network/peer/gossip_tracker_test.go index 1bd420c4f433..c9ab1ef8e026 100644 --- a/network/peer/gossip_tracker_test.go +++ b/network/peer/gossip_tracker_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package peer diff --git a/network/peer/info.go b/network/peer/info.go index 468d00be9fef..00ccaec7953b 100644 --- a/network/peer/info.go +++ b/network/peer/info.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package peer diff --git a/network/peer/ip.go b/network/peer/ip.go index 8fb9d744f974..0112374b9b80 100644 --- a/network/peer/ip.go +++ b/network/peer/ip.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package peer diff --git a/network/peer/ip_signer.go b/network/peer/ip_signer.go index b524d3463619..cfe85f387819 100644 --- a/network/peer/ip_signer.go +++ b/network/peer/ip_signer.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package peer diff --git a/network/peer/ip_signer_test.go b/network/peer/ip_signer_test.go index 382501a825bc..7e5314f5f58a 100644 --- a/network/peer/ip_signer_test.go +++ b/network/peer/ip_signer_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package peer diff --git a/network/peer/message_queue.go b/network/peer/message_queue.go index b9d38996723b..f2ccef6dc915 100644 --- a/network/peer/message_queue.go +++ b/network/peer/message_queue.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package peer diff --git a/network/peer/message_queue_test.go b/network/peer/message_queue_test.go index 2e1e46f5e2f5..496f19425f20 100644 --- a/network/peer/message_queue_test.go +++ b/network/peer/message_queue_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package peer diff --git a/network/peer/metrics.go b/network/peer/metrics.go index 602726131134..cad8797addfb 100644 --- a/network/peer/metrics.go +++ b/network/peer/metrics.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package peer diff --git a/network/peer/msg_length.go b/network/peer/msg_length.go index 27a48dea3060..625034913d9f 100644 --- a/network/peer/msg_length.go +++ b/network/peer/msg_length.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package peer diff --git a/network/peer/msg_length_test.go b/network/peer/msg_length_test.go index 52767888c8c2..97866a7d95cf 100644 --- a/network/peer/msg_length_test.go +++ b/network/peer/msg_length_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package peer diff --git a/network/peer/network.go b/network/peer/network.go index fc136f0bcb9c..8c18ef0ac899 100644 --- a/network/peer/network.go +++ b/network/peer/network.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package peer diff --git a/network/peer/peer.go b/network/peer/peer.go index 37824f16990a..5b6f38c6f19f 100644 --- a/network/peer/peer.go +++ b/network/peer/peer.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package peer diff --git a/network/peer/peer_test.go b/network/peer/peer_test.go index 95c756b4d454..77dd47e73f2c 100644 --- a/network/peer/peer_test.go +++ b/network/peer/peer_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package peer diff --git a/network/peer/set.go b/network/peer/set.go index bc3fbe60743d..cbb9675ec305 100644 --- a/network/peer/set.go +++ b/network/peer/set.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package peer diff --git a/network/peer/set_test.go b/network/peer/set_test.go index fb67d25ef05f..fbdbc3e84643 100644 --- a/network/peer/set_test.go +++ b/network/peer/set_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package peer diff --git a/network/peer/test_network.go b/network/peer/test_network.go index 9bac6260bece..1ba047e1d423 100644 --- a/network/peer/test_network.go +++ b/network/peer/test_network.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package peer diff --git a/network/peer/test_peer.go b/network/peer/test_peer.go index 62717e27dca1..74627930c952 100644 --- a/network/peer/test_peer.go +++ b/network/peer/test_peer.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package peer diff --git a/network/peer/tls_config.go b/network/peer/tls_config.go index 733812db5f7e..7de848ed062a 100644 --- a/network/peer/tls_config.go +++ b/network/peer/tls_config.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package peer diff --git a/network/peer/upgrader.go b/network/peer/upgrader.go index b601ee370947..dd973af1b825 100644 --- a/network/peer/upgrader.go +++ b/network/peer/upgrader.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package peer diff --git a/network/peer/validator_id.go b/network/peer/validator_id.go index 5471fda20118..078929d0f90a 100644 --- a/network/peer/validator_id.go +++ b/network/peer/validator_id.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package peer diff --git a/network/test_network.go b/network/test_network.go index 1d3bcd933844..e1c76e92774a 100644 --- a/network/test_network.go +++ b/network/test_network.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package network diff --git a/network/throttling/bandwidth_throttler.go b/network/throttling/bandwidth_throttler.go index 5adfcb0062a2..d8244eb37974 100644 --- a/network/throttling/bandwidth_throttler.go +++ b/network/throttling/bandwidth_throttler.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package throttling diff --git a/network/throttling/bandwidth_throttler_test.go b/network/throttling/bandwidth_throttler_test.go index 5d51555baa9f..11a687f3a91b 100644 --- a/network/throttling/bandwidth_throttler_test.go +++ b/network/throttling/bandwidth_throttler_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package throttling diff --git a/network/throttling/common.go b/network/throttling/common.go index 9350fb4f684c..cedd5d732dbb 100644 --- a/network/throttling/common.go +++ b/network/throttling/common.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package throttling diff --git a/network/throttling/dial_throttler.go b/network/throttling/dial_throttler.go index 491c312b95ef..07c04aefb812 100644 --- a/network/throttling/dial_throttler.go +++ b/network/throttling/dial_throttler.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package throttling diff --git a/network/throttling/dial_throttler_test.go b/network/throttling/dial_throttler_test.go index db1776e8e24b..1dd57c2e78ad 100644 --- a/network/throttling/dial_throttler_test.go +++ b/network/throttling/dial_throttler_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package throttling diff --git a/network/throttling/inbound_conn_throttler.go b/network/throttling/inbound_conn_throttler.go index 7f2206396ca8..5e1528074135 100644 --- a/network/throttling/inbound_conn_throttler.go +++ b/network/throttling/inbound_conn_throttler.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package throttling diff --git a/network/throttling/inbound_conn_throttler_test.go b/network/throttling/inbound_conn_throttler_test.go index 0b5d1ccd7fb8..9e2fde15e825 100644 --- a/network/throttling/inbound_conn_throttler_test.go +++ b/network/throttling/inbound_conn_throttler_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package throttling diff --git a/network/throttling/inbound_conn_upgrade_throttler.go b/network/throttling/inbound_conn_upgrade_throttler.go index 9d058e29ba12..4df5ee39b776 100644 --- a/network/throttling/inbound_conn_upgrade_throttler.go +++ b/network/throttling/inbound_conn_upgrade_throttler.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package throttling diff --git a/network/throttling/inbound_conn_upgrade_throttler_test.go b/network/throttling/inbound_conn_upgrade_throttler_test.go index d0e1fe93c84a..2f6cd926451e 100644 --- a/network/throttling/inbound_conn_upgrade_throttler_test.go +++ b/network/throttling/inbound_conn_upgrade_throttler_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package throttling diff --git a/network/throttling/inbound_msg_buffer_throttler.go b/network/throttling/inbound_msg_buffer_throttler.go index d06177839ea2..65306eea7d51 100644 --- a/network/throttling/inbound_msg_buffer_throttler.go +++ b/network/throttling/inbound_msg_buffer_throttler.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package throttling diff --git a/network/throttling/inbound_msg_buffer_throttler_test.go b/network/throttling/inbound_msg_buffer_throttler_test.go index 76f399b6e94e..11d655c1c4fc 100644 --- a/network/throttling/inbound_msg_buffer_throttler_test.go +++ b/network/throttling/inbound_msg_buffer_throttler_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package throttling diff --git a/network/throttling/inbound_msg_byte_throttler.go b/network/throttling/inbound_msg_byte_throttler.go index 659d9f398309..459df7a11b5d 100644 --- a/network/throttling/inbound_msg_byte_throttler.go +++ b/network/throttling/inbound_msg_byte_throttler.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package throttling diff --git a/network/throttling/inbound_msg_byte_throttler_test.go b/network/throttling/inbound_msg_byte_throttler_test.go index e71f0abba238..68a12965ff1e 100644 --- a/network/throttling/inbound_msg_byte_throttler_test.go +++ b/network/throttling/inbound_msg_byte_throttler_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package throttling diff --git a/network/throttling/inbound_msg_throttler.go b/network/throttling/inbound_msg_throttler.go index 3d79f640ae1a..86e20085466c 100644 --- a/network/throttling/inbound_msg_throttler.go +++ b/network/throttling/inbound_msg_throttler.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package throttling diff --git a/network/throttling/inbound_resource_throttler.go b/network/throttling/inbound_resource_throttler.go index 42873fe42d6a..eb0e939b8d9e 100644 --- a/network/throttling/inbound_resource_throttler.go +++ b/network/throttling/inbound_resource_throttler.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package throttling diff --git a/network/throttling/inbound_resource_throttler_test.go b/network/throttling/inbound_resource_throttler_test.go index eebbaf7dc851..bfc5a726c14b 100644 --- a/network/throttling/inbound_resource_throttler_test.go +++ b/network/throttling/inbound_resource_throttler_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package throttling diff --git a/network/throttling/no_inbound_msg_throttler.go b/network/throttling/no_inbound_msg_throttler.go index de6e03f81502..6f7af32fb135 100644 --- a/network/throttling/no_inbound_msg_throttler.go +++ b/network/throttling/no_inbound_msg_throttler.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package throttling diff --git a/network/throttling/outbound_msg_throttler.go b/network/throttling/outbound_msg_throttler.go index 6f5ad24561f3..e1656c04ffe1 100644 --- a/network/throttling/outbound_msg_throttler.go +++ b/network/throttling/outbound_msg_throttler.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package throttling diff --git a/network/throttling/outbound_msg_throttler_test.go b/network/throttling/outbound_msg_throttler_test.go index 09d8b6f272ef..1930d935171b 100644 --- a/network/throttling/outbound_msg_throttler_test.go +++ b/network/throttling/outbound_msg_throttler_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package throttling diff --git a/network/throttling/release_func.go b/network/throttling/release_func.go index 0abe2bf4270d..e2cbcf1b1b20 100644 --- a/network/throttling/release_func.go +++ b/network/throttling/release_func.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package throttling diff --git a/network/tracked_ip.go b/network/tracked_ip.go index ca673f76b91d..6a95bbee5a47 100644 --- a/network/tracked_ip.go +++ b/network/tracked_ip.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package network diff --git a/network/tracked_ip_test.go b/network/tracked_ip_test.go index bbf6267d86db..956f02cc19b4 100644 --- a/network/tracked_ip_test.go +++ b/network/tracked_ip_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package network diff --git a/node/beacon_manager.go b/node/beacon_manager.go index 8e6ddeb23cc1..9b6806fdf037 100644 --- a/node/beacon_manager.go +++ b/node/beacon_manager.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package node diff --git a/node/beacon_manager_test.go b/node/beacon_manager_test.go index 2e282d06015c..82b47efdacd6 100644 --- a/node/beacon_manager_test.go +++ b/node/beacon_manager_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package node diff --git a/node/config.go b/node/config.go index 5839da75960a..768f23cab3e9 100644 --- a/node/config.go +++ b/node/config.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package node diff --git a/node/insecure_validator_manager.go b/node/insecure_validator_manager.go index d2cdab94cc89..0e23b8b90cc3 100644 --- a/node/insecure_validator_manager.go +++ b/node/insecure_validator_manager.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package node diff --git a/node/node.go b/node/node.go index 22be7d5436eb..c5d75c2e1d59 100644 --- a/node/node.go +++ b/node/node.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package node diff --git a/node/overridden_manager.go b/node/overridden_manager.go index 91d8c198a4c3..4dd49b65eab6 100644 --- a/node/overridden_manager.go +++ b/node/overridden_manager.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package node diff --git a/node/overridden_manager_test.go b/node/overridden_manager_test.go index 80dfabe10552..8af93ff68071 100644 --- a/node/overridden_manager_test.go +++ b/node/overridden_manager_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package node diff --git a/pubsub/connection.go b/pubsub/connection.go index 2dae38acd1e6..f5f471c64c08 100644 --- a/pubsub/connection.go +++ b/pubsub/connection.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package pubsub diff --git a/pubsub/connections.go b/pubsub/connections.go index 417e1aa8f365..25d35ac8cd82 100644 --- a/pubsub/connections.go +++ b/pubsub/connections.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package pubsub diff --git a/pubsub/filter_param.go b/pubsub/filter_param.go index e7e2453c3e95..1a1306c8d10d 100644 --- a/pubsub/filter_param.go +++ b/pubsub/filter_param.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package pubsub diff --git a/pubsub/filter_test.go b/pubsub/filter_test.go index edc88794fa34..d32c3e87bdfd 100644 --- a/pubsub/filter_test.go +++ b/pubsub/filter_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package pubsub diff --git a/pubsub/filterer.go b/pubsub/filterer.go index 389448ea7af2..3ec2910a9c4c 100644 --- a/pubsub/filterer.go +++ b/pubsub/filterer.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package pubsub diff --git a/pubsub/messages.go b/pubsub/messages.go index 525ae035f15a..ec41af813cdb 100644 --- a/pubsub/messages.go +++ b/pubsub/messages.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package pubsub diff --git a/pubsub/server.go b/pubsub/server.go index b7e4eaf74377..6cc8b649296c 100644 --- a/pubsub/server.go +++ b/pubsub/server.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package pubsub diff --git a/snow/acceptor.go b/snow/acceptor.go index 9c07a2aa0235..83575e5cf3e2 100644 --- a/snow/acceptor.go +++ b/snow/acceptor.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snow diff --git a/snow/choices/decidable.go b/snow/choices/decidable.go index b49cd75d3a1d..4c9ba886b105 100644 --- a/snow/choices/decidable.go +++ b/snow/choices/decidable.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package choices diff --git a/snow/choices/status.go b/snow/choices/status.go index 9a8d410cf005..ff530e9b7547 100644 --- a/snow/choices/status.go +++ b/snow/choices/status.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package choices diff --git a/snow/choices/status_test.go b/snow/choices/status_test.go index 59d2c4071fc5..5134ca2b752f 100644 --- a/snow/choices/status_test.go +++ b/snow/choices/status_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package choices diff --git a/snow/choices/test_decidable.go b/snow/choices/test_decidable.go index 055a54050d32..39e8ed67b7c1 100644 --- a/snow/choices/test_decidable.go +++ b/snow/choices/test_decidable.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package choices diff --git a/snow/consensus/avalanche/test_vertex.go b/snow/consensus/avalanche/test_vertex.go index 60bfdc10c1b0..a3bc2fb06723 100644 --- a/snow/consensus/avalanche/test_vertex.go +++ b/snow/consensus/avalanche/test_vertex.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avalanche diff --git a/snow/consensus/avalanche/vertex.go b/snow/consensus/avalanche/vertex.go index 9f8af73264fe..0356dc1902da 100644 --- a/snow/consensus/avalanche/vertex.go +++ b/snow/consensus/avalanche/vertex.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avalanche diff --git a/snow/consensus/snowball/binary_slush.go b/snow/consensus/snowball/binary_slush.go index b4e1bc2ace08..a440fce0e1ec 100644 --- a/snow/consensus/snowball/binary_slush.go +++ b/snow/consensus/snowball/binary_slush.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowball diff --git a/snow/consensus/snowball/binary_snowball.go b/snow/consensus/snowball/binary_snowball.go index aa1dc37bbe34..f1b213ad98fc 100644 --- a/snow/consensus/snowball/binary_snowball.go +++ b/snow/consensus/snowball/binary_snowball.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowball diff --git a/snow/consensus/snowball/binary_snowball_test.go b/snow/consensus/snowball/binary_snowball_test.go index 42b6b404caa0..2c2a8421e043 100644 --- a/snow/consensus/snowball/binary_snowball_test.go +++ b/snow/consensus/snowball/binary_snowball_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowball diff --git a/snow/consensus/snowball/binary_snowflake.go b/snow/consensus/snowball/binary_snowflake.go index d95ef9709ec6..139bd40361f7 100644 --- a/snow/consensus/snowball/binary_snowflake.go +++ b/snow/consensus/snowball/binary_snowflake.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowball diff --git a/snow/consensus/snowball/binary_snowflake_test.go b/snow/consensus/snowball/binary_snowflake_test.go index 2f14396da959..085b94c5f450 100644 --- a/snow/consensus/snowball/binary_snowflake_test.go +++ b/snow/consensus/snowball/binary_snowflake_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowball diff --git a/snow/consensus/snowball/consensus.go b/snow/consensus/snowball/consensus.go index 3f3c508af053..e28f4cad4d36 100644 --- a/snow/consensus/snowball/consensus.go +++ b/snow/consensus/snowball/consensus.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowball diff --git a/snow/consensus/snowball/consensus_performance_test.go b/snow/consensus/snowball/consensus_performance_test.go index febb7c6877e6..9ebb3362720d 100644 --- a/snow/consensus/snowball/consensus_performance_test.go +++ b/snow/consensus/snowball/consensus_performance_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowball diff --git a/snow/consensus/snowball/consensus_reversibility_test.go b/snow/consensus/snowball/consensus_reversibility_test.go index a3c5d3e98690..d0f3065a9db9 100644 --- a/snow/consensus/snowball/consensus_reversibility_test.go +++ b/snow/consensus/snowball/consensus_reversibility_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowball diff --git a/snow/consensus/snowball/consensus_test.go b/snow/consensus/snowball/consensus_test.go index 484c5c9fbc87..264edaa733d9 100644 --- a/snow/consensus/snowball/consensus_test.go +++ b/snow/consensus/snowball/consensus_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowball diff --git a/snow/consensus/snowball/flat.go b/snow/consensus/snowball/flat.go index 7f633efb8006..97c549816be0 100644 --- a/snow/consensus/snowball/flat.go +++ b/snow/consensus/snowball/flat.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowball diff --git a/snow/consensus/snowball/flat_test.go b/snow/consensus/snowball/flat_test.go index dac78fc0cede..38ca57d83b0e 100644 --- a/snow/consensus/snowball/flat_test.go +++ b/snow/consensus/snowball/flat_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowball diff --git a/snow/consensus/snowball/network_test.go b/snow/consensus/snowball/network_test.go index 747b51087926..56e7d0ca7dbc 100644 --- a/snow/consensus/snowball/network_test.go +++ b/snow/consensus/snowball/network_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowball diff --git a/snow/consensus/snowball/nnary_slush.go b/snow/consensus/snowball/nnary_slush.go index 2987861f7943..dad85252906f 100644 --- a/snow/consensus/snowball/nnary_slush.go +++ b/snow/consensus/snowball/nnary_slush.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowball diff --git a/snow/consensus/snowball/nnary_snowball.go b/snow/consensus/snowball/nnary_snowball.go index 0fe8c25f8617..2a968c0ba91c 100644 --- a/snow/consensus/snowball/nnary_snowball.go +++ b/snow/consensus/snowball/nnary_snowball.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowball diff --git a/snow/consensus/snowball/nnary_snowball_test.go b/snow/consensus/snowball/nnary_snowball_test.go index 10b63ce647cb..18bea5eef65e 100644 --- a/snow/consensus/snowball/nnary_snowball_test.go +++ b/snow/consensus/snowball/nnary_snowball_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowball diff --git a/snow/consensus/snowball/nnary_snowflake.go b/snow/consensus/snowball/nnary_snowflake.go index 503fcd614c7b..de898f155f38 100644 --- a/snow/consensus/snowball/nnary_snowflake.go +++ b/snow/consensus/snowball/nnary_snowflake.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowball diff --git a/snow/consensus/snowball/nnary_snowflake_test.go b/snow/consensus/snowball/nnary_snowflake_test.go index 07601a6065eb..5df8c2966335 100644 --- a/snow/consensus/snowball/nnary_snowflake_test.go +++ b/snow/consensus/snowball/nnary_snowflake_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowball diff --git a/snow/consensus/snowball/parameters.go b/snow/consensus/snowball/parameters.go index 00f6d5bb95c4..640b8702817e 100644 --- a/snow/consensus/snowball/parameters.go +++ b/snow/consensus/snowball/parameters.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowball diff --git a/snow/consensus/snowball/parameters_test.go b/snow/consensus/snowball/parameters_test.go index 26ffab8763c7..525001fd535f 100644 --- a/snow/consensus/snowball/parameters_test.go +++ b/snow/consensus/snowball/parameters_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowball diff --git a/snow/consensus/snowball/tree.go b/snow/consensus/snowball/tree.go index 052e75ec8d35..2278975f8843 100644 --- a/snow/consensus/snowball/tree.go +++ b/snow/consensus/snowball/tree.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowball diff --git a/snow/consensus/snowball/tree_test.go b/snow/consensus/snowball/tree_test.go index 9d96c53bd7d5..99bf25769f98 100644 --- a/snow/consensus/snowball/tree_test.go +++ b/snow/consensus/snowball/tree_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. //nolint:goconst diff --git a/snow/consensus/snowball/unary_snowball.go b/snow/consensus/snowball/unary_snowball.go index 6223d6f3a0cc..3e4477b4b82a 100644 --- a/snow/consensus/snowball/unary_snowball.go +++ b/snow/consensus/snowball/unary_snowball.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowball diff --git a/snow/consensus/snowball/unary_snowball_test.go b/snow/consensus/snowball/unary_snowball_test.go index 6fd6cd9b40c7..d94d2b61d63d 100644 --- a/snow/consensus/snowball/unary_snowball_test.go +++ b/snow/consensus/snowball/unary_snowball_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowball diff --git a/snow/consensus/snowball/unary_snowflake.go b/snow/consensus/snowball/unary_snowflake.go index 68def8663724..6bcfebe23fe8 100644 --- a/snow/consensus/snowball/unary_snowflake.go +++ b/snow/consensus/snowball/unary_snowflake.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowball diff --git a/snow/consensus/snowball/unary_snowflake_test.go b/snow/consensus/snowball/unary_snowflake_test.go index 162f4a56e200..0791b688065e 100644 --- a/snow/consensus/snowball/unary_snowflake_test.go +++ b/snow/consensus/snowball/unary_snowflake_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowball diff --git a/snow/consensus/snowman/block.go b/snow/consensus/snowman/block.go index b5d79983ef6a..c950ac3c29ee 100644 --- a/snow/consensus/snowman/block.go +++ b/snow/consensus/snowman/block.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowman diff --git a/snow/consensus/snowman/bootstrapper/majority.go b/snow/consensus/snowman/bootstrapper/majority.go index 1decb837ef40..7fe028288656 100644 --- a/snow/consensus/snowman/bootstrapper/majority.go +++ b/snow/consensus/snowman/bootstrapper/majority.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bootstrapper diff --git a/snow/consensus/snowman/bootstrapper/majority_test.go b/snow/consensus/snowman/bootstrapper/majority_test.go index d276566fb910..819840f28311 100644 --- a/snow/consensus/snowman/bootstrapper/majority_test.go +++ b/snow/consensus/snowman/bootstrapper/majority_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bootstrapper diff --git a/snow/consensus/snowman/bootstrapper/minority.go b/snow/consensus/snowman/bootstrapper/minority.go index 52b45c4407ba..4674921aaf6b 100644 --- a/snow/consensus/snowman/bootstrapper/minority.go +++ b/snow/consensus/snowman/bootstrapper/minority.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bootstrapper diff --git a/snow/consensus/snowman/bootstrapper/minority_test.go b/snow/consensus/snowman/bootstrapper/minority_test.go index f720ee18025a..c44b314f3443 100644 --- a/snow/consensus/snowman/bootstrapper/minority_test.go +++ b/snow/consensus/snowman/bootstrapper/minority_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bootstrapper diff --git a/snow/consensus/snowman/bootstrapper/noop.go b/snow/consensus/snowman/bootstrapper/noop.go index 1cd3bffd58b7..6d97eed069a8 100644 --- a/snow/consensus/snowman/bootstrapper/noop.go +++ b/snow/consensus/snowman/bootstrapper/noop.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bootstrapper diff --git a/snow/consensus/snowman/bootstrapper/noop_test.go b/snow/consensus/snowman/bootstrapper/noop_test.go index 0a485a8fae76..e0bccb8aad7f 100644 --- a/snow/consensus/snowman/bootstrapper/noop_test.go +++ b/snow/consensus/snowman/bootstrapper/noop_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bootstrapper diff --git a/snow/consensus/snowman/bootstrapper/poll.go b/snow/consensus/snowman/bootstrapper/poll.go index 450341d9d64d..0d3eb7143167 100644 --- a/snow/consensus/snowman/bootstrapper/poll.go +++ b/snow/consensus/snowman/bootstrapper/poll.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bootstrapper diff --git a/snow/consensus/snowman/bootstrapper/poll_test.go b/snow/consensus/snowman/bootstrapper/poll_test.go index 134867ae1822..bbdcc0db51a4 100644 --- a/snow/consensus/snowman/bootstrapper/poll_test.go +++ b/snow/consensus/snowman/bootstrapper/poll_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bootstrapper diff --git a/snow/consensus/snowman/bootstrapper/requests.go b/snow/consensus/snowman/bootstrapper/requests.go index 28fc25ce1643..ebeaf57ac70f 100644 --- a/snow/consensus/snowman/bootstrapper/requests.go +++ b/snow/consensus/snowman/bootstrapper/requests.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bootstrapper diff --git a/snow/consensus/snowman/bootstrapper/sampler.go b/snow/consensus/snowman/bootstrapper/sampler.go index 9511a1e4243f..e23253864669 100644 --- a/snow/consensus/snowman/bootstrapper/sampler.go +++ b/snow/consensus/snowman/bootstrapper/sampler.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bootstrapper diff --git a/snow/consensus/snowman/bootstrapper/sampler_test.go b/snow/consensus/snowman/bootstrapper/sampler_test.go index 1b9e366decc7..b438a5fb2629 100644 --- a/snow/consensus/snowman/bootstrapper/sampler_test.go +++ b/snow/consensus/snowman/bootstrapper/sampler_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bootstrapper diff --git a/snow/consensus/snowman/consensus.go b/snow/consensus/snowman/consensus.go index 25b2c7242ec1..3f1006416366 100644 --- a/snow/consensus/snowman/consensus.go +++ b/snow/consensus/snowman/consensus.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowman diff --git a/snow/consensus/snowman/consensus_test.go b/snow/consensus/snowman/consensus_test.go index 375f81d5b3a8..15e56709dd28 100644 --- a/snow/consensus/snowman/consensus_test.go +++ b/snow/consensus/snowman/consensus_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowman diff --git a/snow/consensus/snowman/factory.go b/snow/consensus/snowman/factory.go index 06341981aef4..c2fc76e83ef9 100644 --- a/snow/consensus/snowman/factory.go +++ b/snow/consensus/snowman/factory.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowman diff --git a/snow/consensus/snowman/metrics.go b/snow/consensus/snowman/metrics.go index 6e5159d6c1a5..a052db5144d4 100644 --- a/snow/consensus/snowman/metrics.go +++ b/snow/consensus/snowman/metrics.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowman diff --git a/snow/consensus/snowman/network_test.go b/snow/consensus/snowman/network_test.go index 9b402450c2de..aead346fb5e4 100644 --- a/snow/consensus/snowman/network_test.go +++ b/snow/consensus/snowman/network_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowman diff --git a/snow/consensus/snowman/oracle_block.go b/snow/consensus/snowman/oracle_block.go index 0ead79d03d22..4688927e566e 100644 --- a/snow/consensus/snowman/oracle_block.go +++ b/snow/consensus/snowman/oracle_block.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowman diff --git a/snow/consensus/snowman/poll/early_term_no_traversal.go b/snow/consensus/snowman/poll/early_term_no_traversal.go index fcad5b71932b..460805ab7820 100644 --- a/snow/consensus/snowman/poll/early_term_no_traversal.go +++ b/snow/consensus/snowman/poll/early_term_no_traversal.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package poll diff --git a/snow/consensus/snowman/poll/early_term_no_traversal_test.go b/snow/consensus/snowman/poll/early_term_no_traversal_test.go index 8255818abdbb..9d215c246eec 100644 --- a/snow/consensus/snowman/poll/early_term_no_traversal_test.go +++ b/snow/consensus/snowman/poll/early_term_no_traversal_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package poll diff --git a/snow/consensus/snowman/poll/interfaces.go b/snow/consensus/snowman/poll/interfaces.go index cab31cfc54ce..c1a776b4dc5f 100644 --- a/snow/consensus/snowman/poll/interfaces.go +++ b/snow/consensus/snowman/poll/interfaces.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package poll diff --git a/snow/consensus/snowman/poll/set.go b/snow/consensus/snowman/poll/set.go index e58059f20c3d..4c085b7aa4bc 100644 --- a/snow/consensus/snowman/poll/set.go +++ b/snow/consensus/snowman/poll/set.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package poll diff --git a/snow/consensus/snowman/poll/set_test.go b/snow/consensus/snowman/poll/set_test.go index 84ed8f7a5c8c..cdcf0e7d8903 100644 --- a/snow/consensus/snowman/poll/set_test.go +++ b/snow/consensus/snowman/poll/set_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package poll diff --git a/snow/consensus/snowman/snowman_block.go b/snow/consensus/snowman/snowman_block.go index 782c77d8e415..a25099b4519f 100644 --- a/snow/consensus/snowman/snowman_block.go +++ b/snow/consensus/snowman/snowman_block.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowman diff --git a/snow/consensus/snowman/test_block.go b/snow/consensus/snowman/test_block.go index f340a0291b00..b59eb2ed5f89 100644 --- a/snow/consensus/snowman/test_block.go +++ b/snow/consensus/snowman/test_block.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowman diff --git a/snow/consensus/snowman/topological.go b/snow/consensus/snowman/topological.go index f3fc838a8f8b..5b12ce3f2e6b 100644 --- a/snow/consensus/snowman/topological.go +++ b/snow/consensus/snowman/topological.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowman diff --git a/snow/consensus/snowman/topological_test.go b/snow/consensus/snowman/topological_test.go index 53a1b4416d9a..540b5a8f2eb1 100644 --- a/snow/consensus/snowman/topological_test.go +++ b/snow/consensus/snowman/topological_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowman diff --git a/snow/consensus/snowman/traced_consensus.go b/snow/consensus/snowman/traced_consensus.go index 67a8797b294a..363fa15334b0 100644 --- a/snow/consensus/snowman/traced_consensus.go +++ b/snow/consensus/snowman/traced_consensus.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowman diff --git a/snow/consensus/snowstorm/test_tx.go b/snow/consensus/snowstorm/test_tx.go index 8c5aa9aa3544..a8b514c8164d 100644 --- a/snow/consensus/snowstorm/test_tx.go +++ b/snow/consensus/snowstorm/test_tx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowstorm diff --git a/snow/consensus/snowstorm/tx.go b/snow/consensus/snowstorm/tx.go index 54a56a42f5b4..cc1cf649e9a8 100644 --- a/snow/consensus/snowstorm/tx.go +++ b/snow/consensus/snowstorm/tx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowstorm diff --git a/snow/context.go b/snow/context.go index 60e2a305eb2b..2cbbedb38b47 100644 --- a/snow/context.go +++ b/snow/context.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snow diff --git a/snow/engine/avalanche/bootstrap/bootstrapper.go b/snow/engine/avalanche/bootstrap/bootstrapper.go index 162937dc7860..cd530d1cb1f8 100644 --- a/snow/engine/avalanche/bootstrap/bootstrapper.go +++ b/snow/engine/avalanche/bootstrap/bootstrapper.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bootstrap diff --git a/snow/engine/avalanche/bootstrap/bootstrapper_test.go b/snow/engine/avalanche/bootstrap/bootstrapper_test.go index 1ef3ef7102ef..7da0b99a8736 100644 --- a/snow/engine/avalanche/bootstrap/bootstrapper_test.go +++ b/snow/engine/avalanche/bootstrap/bootstrapper_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bootstrap diff --git a/snow/engine/avalanche/bootstrap/config.go b/snow/engine/avalanche/bootstrap/config.go index 54fe7f2e45fa..a674c2758460 100644 --- a/snow/engine/avalanche/bootstrap/config.go +++ b/snow/engine/avalanche/bootstrap/config.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bootstrap diff --git a/snow/engine/avalanche/bootstrap/metrics.go b/snow/engine/avalanche/bootstrap/metrics.go index b9d5824ec95a..cc357f25901f 100644 --- a/snow/engine/avalanche/bootstrap/metrics.go +++ b/snow/engine/avalanche/bootstrap/metrics.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bootstrap diff --git a/snow/engine/avalanche/bootstrap/tx_job.go b/snow/engine/avalanche/bootstrap/tx_job.go index 615108c992ba..9bb939d3d186 100644 --- a/snow/engine/avalanche/bootstrap/tx_job.go +++ b/snow/engine/avalanche/bootstrap/tx_job.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bootstrap diff --git a/snow/engine/avalanche/bootstrap/vertex_job.go b/snow/engine/avalanche/bootstrap/vertex_job.go index 3001ce89904c..30d33c5dc9fb 100644 --- a/snow/engine/avalanche/bootstrap/vertex_job.go +++ b/snow/engine/avalanche/bootstrap/vertex_job.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bootstrap diff --git a/snow/engine/avalanche/engine.go b/snow/engine/avalanche/engine.go index 375666c99598..530a319e0fc6 100644 --- a/snow/engine/avalanche/engine.go +++ b/snow/engine/avalanche/engine.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avalanche diff --git a/snow/engine/avalanche/getter/getter.go b/snow/engine/avalanche/getter/getter.go index a93d2f1d069e..8903eec1b3ba 100644 --- a/snow/engine/avalanche/getter/getter.go +++ b/snow/engine/avalanche/getter/getter.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package getter diff --git a/snow/engine/avalanche/getter/getter_test.go b/snow/engine/avalanche/getter/getter_test.go index 4d25e29f296b..4977d53fa7ee 100644 --- a/snow/engine/avalanche/getter/getter_test.go +++ b/snow/engine/avalanche/getter/getter_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package getter diff --git a/snow/engine/avalanche/state/prefixed_state.go b/snow/engine/avalanche/state/prefixed_state.go index 5fac890b9ed1..1ff634d5c61e 100644 --- a/snow/engine/avalanche/state/prefixed_state.go +++ b/snow/engine/avalanche/state/prefixed_state.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/snow/engine/avalanche/state/serializer.go b/snow/engine/avalanche/state/serializer.go index 88dc7afefae4..b305100b9ce2 100644 --- a/snow/engine/avalanche/state/serializer.go +++ b/snow/engine/avalanche/state/serializer.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. // Package state manages the meta-data required by consensus for an avalanche diff --git a/snow/engine/avalanche/state/state.go b/snow/engine/avalanche/state/state.go index f7f94c5e6923..021a4c7e1d68 100644 --- a/snow/engine/avalanche/state/state.go +++ b/snow/engine/avalanche/state/state.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/snow/engine/avalanche/state/unique_vertex.go b/snow/engine/avalanche/state/unique_vertex.go index 73c1ef94ccdc..bc245d1b5496 100644 --- a/snow/engine/avalanche/state/unique_vertex.go +++ b/snow/engine/avalanche/state/unique_vertex.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/snow/engine/avalanche/state/unique_vertex_test.go b/snow/engine/avalanche/state/unique_vertex_test.go index cdd503157dbd..6f644680d290 100644 --- a/snow/engine/avalanche/state/unique_vertex_test.go +++ b/snow/engine/avalanche/state/unique_vertex_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/snow/engine/avalanche/vertex/builder.go b/snow/engine/avalanche/vertex/builder.go index dd83016d7ee6..cf3e88ee6a35 100644 --- a/snow/engine/avalanche/vertex/builder.go +++ b/snow/engine/avalanche/vertex/builder.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package vertex diff --git a/snow/engine/avalanche/vertex/builder_test.go b/snow/engine/avalanche/vertex/builder_test.go index 132ccbc33f73..a70b14ba8ff1 100644 --- a/snow/engine/avalanche/vertex/builder_test.go +++ b/snow/engine/avalanche/vertex/builder_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package vertex diff --git a/snow/engine/avalanche/vertex/codec.go b/snow/engine/avalanche/vertex/codec.go index 65c0ff84cdc2..c6da27f1f57f 100644 --- a/snow/engine/avalanche/vertex/codec.go +++ b/snow/engine/avalanche/vertex/codec.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package vertex diff --git a/snow/engine/avalanche/vertex/manager.go b/snow/engine/avalanche/vertex/manager.go index cf206742b629..a300affdb0e9 100644 --- a/snow/engine/avalanche/vertex/manager.go +++ b/snow/engine/avalanche/vertex/manager.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package vertex diff --git a/snow/engine/avalanche/vertex/parser.go b/snow/engine/avalanche/vertex/parser.go index f0b7a8aa5571..41f848e781c6 100644 --- a/snow/engine/avalanche/vertex/parser.go +++ b/snow/engine/avalanche/vertex/parser.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package vertex diff --git a/snow/engine/avalanche/vertex/parser_test.go b/snow/engine/avalanche/vertex/parser_test.go index 5d765d8384dd..f3016895848d 100644 --- a/snow/engine/avalanche/vertex/parser_test.go +++ b/snow/engine/avalanche/vertex/parser_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package vertex diff --git a/snow/engine/avalanche/vertex/stateless_vertex.go b/snow/engine/avalanche/vertex/stateless_vertex.go index d5e51671bb42..88884d9e90bb 100644 --- a/snow/engine/avalanche/vertex/stateless_vertex.go +++ b/snow/engine/avalanche/vertex/stateless_vertex.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package vertex diff --git a/snow/engine/avalanche/vertex/stateless_vertex_test.go b/snow/engine/avalanche/vertex/stateless_vertex_test.go index a18a045a95d4..35ece98c51da 100644 --- a/snow/engine/avalanche/vertex/stateless_vertex_test.go +++ b/snow/engine/avalanche/vertex/stateless_vertex_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package vertex diff --git a/snow/engine/avalanche/vertex/storage.go b/snow/engine/avalanche/vertex/storage.go index 40ec863d2cba..cac766c6b103 100644 --- a/snow/engine/avalanche/vertex/storage.go +++ b/snow/engine/avalanche/vertex/storage.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package vertex diff --git a/snow/engine/avalanche/vertex/test_builder.go b/snow/engine/avalanche/vertex/test_builder.go index 0bd63b26bcb1..534629372249 100644 --- a/snow/engine/avalanche/vertex/test_builder.go +++ b/snow/engine/avalanche/vertex/test_builder.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package vertex diff --git a/snow/engine/avalanche/vertex/test_manager.go b/snow/engine/avalanche/vertex/test_manager.go index a2f55ee7f8b8..6954161cdd46 100644 --- a/snow/engine/avalanche/vertex/test_manager.go +++ b/snow/engine/avalanche/vertex/test_manager.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package vertex diff --git a/snow/engine/avalanche/vertex/test_parser.go b/snow/engine/avalanche/vertex/test_parser.go index 3ca17b3440f1..2ee10add6090 100644 --- a/snow/engine/avalanche/vertex/test_parser.go +++ b/snow/engine/avalanche/vertex/test_parser.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package vertex diff --git a/snow/engine/avalanche/vertex/test_storage.go b/snow/engine/avalanche/vertex/test_storage.go index b5250ee1fca4..8e0b8bc1e84d 100644 --- a/snow/engine/avalanche/vertex/test_storage.go +++ b/snow/engine/avalanche/vertex/test_storage.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package vertex diff --git a/snow/engine/avalanche/vertex/test_vm.go b/snow/engine/avalanche/vertex/test_vm.go index d20e57000da9..ee17c8b13ae0 100644 --- a/snow/engine/avalanche/vertex/test_vm.go +++ b/snow/engine/avalanche/vertex/test_vm.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package vertex diff --git a/snow/engine/avalanche/vertex/vm.go b/snow/engine/avalanche/vertex/vm.go index 67f3fc586b26..9987fe164d35 100644 --- a/snow/engine/avalanche/vertex/vm.go +++ b/snow/engine/avalanche/vertex/vm.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package vertex diff --git a/snow/engine/common/appsender/appsender_client.go b/snow/engine/common/appsender/appsender_client.go index c74616d71006..acde7109f751 100644 --- a/snow/engine/common/appsender/appsender_client.go +++ b/snow/engine/common/appsender/appsender_client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package appsender diff --git a/snow/engine/common/appsender/appsender_server.go b/snow/engine/common/appsender/appsender_server.go index 3583940db108..84763e17bf11 100644 --- a/snow/engine/common/appsender/appsender_server.go +++ b/snow/engine/common/appsender/appsender_server.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package appsender diff --git a/snow/engine/common/bootstrap_tracker.go b/snow/engine/common/bootstrap_tracker.go index 04b90a122f98..bd2ef43cf1f3 100644 --- a/snow/engine/common/bootstrap_tracker.go +++ b/snow/engine/common/bootstrap_tracker.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package common diff --git a/snow/engine/common/bootstrapable.go b/snow/engine/common/bootstrapable.go index 256acb6d468e..517eba2aa154 100644 --- a/snow/engine/common/bootstrapable.go +++ b/snow/engine/common/bootstrapable.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package common diff --git a/snow/engine/common/engine.go b/snow/engine/common/engine.go index aea725ccf8a1..cbd9c37dc10c 100644 --- a/snow/engine/common/engine.go +++ b/snow/engine/common/engine.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package common diff --git a/snow/engine/common/error.go b/snow/engine/common/error.go index 9e83325ddd4e..261fedaa260c 100644 --- a/snow/engine/common/error.go +++ b/snow/engine/common/error.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package common diff --git a/snow/engine/common/error_test.go b/snow/engine/common/error_test.go index 124eaad33870..0204e010045b 100644 --- a/snow/engine/common/error_test.go +++ b/snow/engine/common/error_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package common diff --git a/snow/engine/common/fx.go b/snow/engine/common/fx.go index 861986462bb2..000c22ed6baf 100644 --- a/snow/engine/common/fx.go +++ b/snow/engine/common/fx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package common diff --git a/snow/engine/common/halter.go b/snow/engine/common/halter.go index bdfe3c9d489e..1fcea981d2e4 100644 --- a/snow/engine/common/halter.go +++ b/snow/engine/common/halter.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package common diff --git a/snow/engine/common/message.go b/snow/engine/common/message.go index 6ce1c4501a1c..1bc05991973e 100644 --- a/snow/engine/common/message.go +++ b/snow/engine/common/message.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package common diff --git a/snow/engine/common/no_ops_handlers.go b/snow/engine/common/no_ops_handlers.go index 15a3f2900ccb..870c6694a7a7 100644 --- a/snow/engine/common/no_ops_handlers.go +++ b/snow/engine/common/no_ops_handlers.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package common diff --git a/snow/engine/common/queue/job.go b/snow/engine/common/queue/job.go index 4ac5a60fb835..3b36893f1d96 100644 --- a/snow/engine/common/queue/job.go +++ b/snow/engine/common/queue/job.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package queue diff --git a/snow/engine/common/queue/jobs.go b/snow/engine/common/queue/jobs.go index 5592ad822439..0577602a3729 100644 --- a/snow/engine/common/queue/jobs.go +++ b/snow/engine/common/queue/jobs.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package queue diff --git a/snow/engine/common/queue/jobs_test.go b/snow/engine/common/queue/jobs_test.go index a50b3cb60e8a..a098cb6e6d6d 100644 --- a/snow/engine/common/queue/jobs_test.go +++ b/snow/engine/common/queue/jobs_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package queue diff --git a/snow/engine/common/queue/parser.go b/snow/engine/common/queue/parser.go index ee8f39807f35..07e9df50887d 100644 --- a/snow/engine/common/queue/parser.go +++ b/snow/engine/common/queue/parser.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package queue diff --git a/snow/engine/common/queue/state.go b/snow/engine/common/queue/state.go index cae43f8c2101..68ba67ce38c1 100644 --- a/snow/engine/common/queue/state.go +++ b/snow/engine/common/queue/state.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package queue diff --git a/snow/engine/common/queue/test_job.go b/snow/engine/common/queue/test_job.go index 98ea33614b50..fd9af544fb62 100644 --- a/snow/engine/common/queue/test_job.go +++ b/snow/engine/common/queue/test_job.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package queue diff --git a/snow/engine/common/queue/test_parser.go b/snow/engine/common/queue/test_parser.go index 85a079cc1435..1cc1cfd2973f 100644 --- a/snow/engine/common/queue/test_parser.go +++ b/snow/engine/common/queue/test_parser.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package queue diff --git a/snow/engine/common/request.go b/snow/engine/common/request.go index d677a485c8f4..f9cccb3b0d29 100644 --- a/snow/engine/common/request.go +++ b/snow/engine/common/request.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package common diff --git a/snow/engine/common/sender.go b/snow/engine/common/sender.go index 885f4d9bd78f..b40084fc714f 100644 --- a/snow/engine/common/sender.go +++ b/snow/engine/common/sender.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package common diff --git a/snow/engine/common/state_syncer.go b/snow/engine/common/state_syncer.go index e23ad126407c..a6d159bb6949 100644 --- a/snow/engine/common/state_syncer.go +++ b/snow/engine/common/state_syncer.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package common diff --git a/snow/engine/common/test_bootstrap_tracker.go b/snow/engine/common/test_bootstrap_tracker.go index ba377b39dce3..2e940f1a43b1 100644 --- a/snow/engine/common/test_bootstrap_tracker.go +++ b/snow/engine/common/test_bootstrap_tracker.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package common diff --git a/snow/engine/common/test_bootstrapper.go b/snow/engine/common/test_bootstrapper.go index 6ee9e223dc18..259fcb07fb3e 100644 --- a/snow/engine/common/test_bootstrapper.go +++ b/snow/engine/common/test_bootstrapper.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package common diff --git a/snow/engine/common/test_engine.go b/snow/engine/common/test_engine.go index 414048366336..e07352d43713 100644 --- a/snow/engine/common/test_engine.go +++ b/snow/engine/common/test_engine.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package common diff --git a/snow/engine/common/test_sender.go b/snow/engine/common/test_sender.go index 4ef33192bd93..32af682838fa 100644 --- a/snow/engine/common/test_sender.go +++ b/snow/engine/common/test_sender.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package common diff --git a/snow/engine/common/test_timer.go b/snow/engine/common/test_timer.go index e5e2b232d390..6da0d9251712 100644 --- a/snow/engine/common/test_timer.go +++ b/snow/engine/common/test_timer.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package common diff --git a/snow/engine/common/test_vm.go b/snow/engine/common/test_vm.go index 8146a5f6746b..b576e8e389c7 100644 --- a/snow/engine/common/test_vm.go +++ b/snow/engine/common/test_vm.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package common diff --git a/snow/engine/common/timer.go b/snow/engine/common/timer.go index 56312d08a4fa..432bb9170ccb 100644 --- a/snow/engine/common/timer.go +++ b/snow/engine/common/timer.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package common diff --git a/snow/engine/common/traced_bootstrapable_engine.go b/snow/engine/common/traced_bootstrapable_engine.go index d387df04ac34..4c64206ae081 100644 --- a/snow/engine/common/traced_bootstrapable_engine.go +++ b/snow/engine/common/traced_bootstrapable_engine.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package common diff --git a/snow/engine/common/traced_engine.go b/snow/engine/common/traced_engine.go index 13ecc92a97ca..5ffad7c543d7 100644 --- a/snow/engine/common/traced_engine.go +++ b/snow/engine/common/traced_engine.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package common diff --git a/snow/engine/common/traced_state_syncer.go b/snow/engine/common/traced_state_syncer.go index db2569eef995..e598b6094076 100644 --- a/snow/engine/common/traced_state_syncer.go +++ b/snow/engine/common/traced_state_syncer.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package common diff --git a/snow/engine/common/tracker/accepted.go b/snow/engine/common/tracker/accepted.go index 0be64bc9035e..f6c63e3ff28d 100644 --- a/snow/engine/common/tracker/accepted.go +++ b/snow/engine/common/tracker/accepted.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tracker diff --git a/snow/engine/common/tracker/accepted_test.go b/snow/engine/common/tracker/accepted_test.go index 7bb617d789f9..8ff489f51aea 100644 --- a/snow/engine/common/tracker/accepted_test.go +++ b/snow/engine/common/tracker/accepted_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tracker diff --git a/snow/engine/common/tracker/peers.go b/snow/engine/common/tracker/peers.go index 94d653a53b1f..fdf070613d83 100644 --- a/snow/engine/common/tracker/peers.go +++ b/snow/engine/common/tracker/peers.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tracker diff --git a/snow/engine/common/tracker/peers_test.go b/snow/engine/common/tracker/peers_test.go index 4af065113385..b627b79a16ed 100644 --- a/snow/engine/common/tracker/peers_test.go +++ b/snow/engine/common/tracker/peers_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tracker diff --git a/snow/engine/common/tracker/startup.go b/snow/engine/common/tracker/startup.go index 282d88ce832d..c5e75613fcaa 100644 --- a/snow/engine/common/tracker/startup.go +++ b/snow/engine/common/tracker/startup.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tracker diff --git a/snow/engine/common/vm.go b/snow/engine/common/vm.go index e77bdd552bbf..dc201c95602f 100644 --- a/snow/engine/common/vm.go +++ b/snow/engine/common/vm.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package common diff --git a/snow/engine/snowman/ancestor/tree.go b/snow/engine/snowman/ancestor/tree.go index 3d7fda833cbc..9e0eb4e4f02f 100644 --- a/snow/engine/snowman/ancestor/tree.go +++ b/snow/engine/snowman/ancestor/tree.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package ancestor diff --git a/snow/engine/snowman/ancestor/tree_test.go b/snow/engine/snowman/ancestor/tree_test.go index 605f2a08572d..d17d38ceb0ca 100644 --- a/snow/engine/snowman/ancestor/tree_test.go +++ b/snow/engine/snowman/ancestor/tree_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package ancestor diff --git a/snow/engine/snowman/block/batched_vm.go b/snow/engine/snowman/block/batched_vm.go index 3d5b869b98c1..ad52e3592ae6 100644 --- a/snow/engine/snowman/block/batched_vm.go +++ b/snow/engine/snowman/block/batched_vm.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/snow/engine/snowman/block/batched_vm_test.go b/snow/engine/snowman/block/batched_vm_test.go index 92426c1b474d..b4d251c284ba 100644 --- a/snow/engine/snowman/block/batched_vm_test.go +++ b/snow/engine/snowman/block/batched_vm_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/snow/engine/snowman/block/block_context_vm.go b/snow/engine/snowman/block/block_context_vm.go index 4a259571a006..6b8b78235431 100644 --- a/snow/engine/snowman/block/block_context_vm.go +++ b/snow/engine/snowman/block/block_context_vm.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/snow/engine/snowman/block/state_summary.go b/snow/engine/snowman/block/state_summary.go index 337a27d9f1d8..d89d77a22396 100644 --- a/snow/engine/snowman/block/state_summary.go +++ b/snow/engine/snowman/block/state_summary.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/snow/engine/snowman/block/state_sync_mode.go b/snow/engine/snowman/block/state_sync_mode.go index 79f5c2e8043e..35da3ab4eda9 100644 --- a/snow/engine/snowman/block/state_sync_mode.go +++ b/snow/engine/snowman/block/state_sync_mode.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/snow/engine/snowman/block/state_syncable_vm.go b/snow/engine/snowman/block/state_syncable_vm.go index 5c25f37a7ad7..0457505183e5 100644 --- a/snow/engine/snowman/block/state_syncable_vm.go +++ b/snow/engine/snowman/block/state_syncable_vm.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/snow/engine/snowman/block/test_batched_vm.go b/snow/engine/snowman/block/test_batched_vm.go index ef7991156070..e5d654ec4a87 100644 --- a/snow/engine/snowman/block/test_batched_vm.go +++ b/snow/engine/snowman/block/test_batched_vm.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/snow/engine/snowman/block/test_state_summary.go b/snow/engine/snowman/block/test_state_summary.go index 089e6dcfd364..7287cff10120 100644 --- a/snow/engine/snowman/block/test_state_summary.go +++ b/snow/engine/snowman/block/test_state_summary.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/snow/engine/snowman/block/test_state_syncable_vm.go b/snow/engine/snowman/block/test_state_syncable_vm.go index b05dd8118683..f1eeb9606642 100644 --- a/snow/engine/snowman/block/test_state_syncable_vm.go +++ b/snow/engine/snowman/block/test_state_syncable_vm.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/snow/engine/snowman/block/test_vm.go b/snow/engine/snowman/block/test_vm.go index 4f3a2835eda5..376dd27066f7 100644 --- a/snow/engine/snowman/block/test_vm.go +++ b/snow/engine/snowman/block/test_vm.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/snow/engine/snowman/block/vm.go b/snow/engine/snowman/block/vm.go index 13d4fa75ed02..4153632a7616 100644 --- a/snow/engine/snowman/block/vm.go +++ b/snow/engine/snowman/block/vm.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/snow/engine/snowman/bootstrap/block_job.go b/snow/engine/snowman/bootstrap/block_job.go index 06ae8fbcb84f..696cbddb58a9 100644 --- a/snow/engine/snowman/bootstrap/block_job.go +++ b/snow/engine/snowman/bootstrap/block_job.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bootstrap diff --git a/snow/engine/snowman/bootstrap/bootstrapper.go b/snow/engine/snowman/bootstrap/bootstrapper.go index b819c9573b48..29754a24d734 100644 --- a/snow/engine/snowman/bootstrap/bootstrapper.go +++ b/snow/engine/snowman/bootstrap/bootstrapper.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bootstrap diff --git a/snow/engine/snowman/bootstrap/bootstrapper_test.go b/snow/engine/snowman/bootstrap/bootstrapper_test.go index 363af8c11488..08f63f163b80 100644 --- a/snow/engine/snowman/bootstrap/bootstrapper_test.go +++ b/snow/engine/snowman/bootstrap/bootstrapper_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bootstrap diff --git a/snow/engine/snowman/bootstrap/config.go b/snow/engine/snowman/bootstrap/config.go index 785654cb72dc..6fb8894db96f 100644 --- a/snow/engine/snowman/bootstrap/config.go +++ b/snow/engine/snowman/bootstrap/config.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bootstrap diff --git a/snow/engine/snowman/bootstrap/metrics.go b/snow/engine/snowman/bootstrap/metrics.go index 9359ecfadb19..f6ad90d16419 100644 --- a/snow/engine/snowman/bootstrap/metrics.go +++ b/snow/engine/snowman/bootstrap/metrics.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bootstrap diff --git a/snow/engine/snowman/config.go b/snow/engine/snowman/config.go index 65a24a2ea816..3162471a2476 100644 --- a/snow/engine/snowman/config.go +++ b/snow/engine/snowman/config.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowman diff --git a/snow/engine/snowman/config_test.go b/snow/engine/snowman/config_test.go index 2991a092bdfc..fe66256c68db 100644 --- a/snow/engine/snowman/config_test.go +++ b/snow/engine/snowman/config_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowman diff --git a/snow/engine/snowman/engine.go b/snow/engine/snowman/engine.go index 37985f5b48fa..b5e3fb1020e3 100644 --- a/snow/engine/snowman/engine.go +++ b/snow/engine/snowman/engine.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowman diff --git a/snow/engine/snowman/getter/getter.go b/snow/engine/snowman/getter/getter.go index 0f9dc40b0a19..ff8fe13f8fe9 100644 --- a/snow/engine/snowman/getter/getter.go +++ b/snow/engine/snowman/getter/getter.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package getter diff --git a/snow/engine/snowman/getter/getter_test.go b/snow/engine/snowman/getter/getter_test.go index 1e0647b1911e..4fc03d4795d6 100644 --- a/snow/engine/snowman/getter/getter_test.go +++ b/snow/engine/snowman/getter/getter_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package getter diff --git a/snow/engine/snowman/issuer.go b/snow/engine/snowman/issuer.go index 3558d47360dc..d952dfe2cc6b 100644 --- a/snow/engine/snowman/issuer.go +++ b/snow/engine/snowman/issuer.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowman diff --git a/snow/engine/snowman/memory_block.go b/snow/engine/snowman/memory_block.go index c3b476b9f496..d91118afa5b3 100644 --- a/snow/engine/snowman/memory_block.go +++ b/snow/engine/snowman/memory_block.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowman diff --git a/snow/engine/snowman/metrics.go b/snow/engine/snowman/metrics.go index dfdc92c636db..5dd65d8afa14 100644 --- a/snow/engine/snowman/metrics.go +++ b/snow/engine/snowman/metrics.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowman diff --git a/snow/engine/snowman/syncer/config.go b/snow/engine/snowman/syncer/config.go index 9f7acf7a4910..b5fae133a376 100644 --- a/snow/engine/snowman/syncer/config.go +++ b/snow/engine/snowman/syncer/config.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package syncer diff --git a/snow/engine/snowman/syncer/state_syncer.go b/snow/engine/snowman/syncer/state_syncer.go index 42db0b264cd1..bc549a0ce93a 100644 --- a/snow/engine/snowman/syncer/state_syncer.go +++ b/snow/engine/snowman/syncer/state_syncer.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package syncer diff --git a/snow/engine/snowman/syncer/state_syncer_test.go b/snow/engine/snowman/syncer/state_syncer_test.go index bb0ed52e6bae..11faeae69f67 100644 --- a/snow/engine/snowman/syncer/state_syncer_test.go +++ b/snow/engine/snowman/syncer/state_syncer_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package syncer diff --git a/snow/engine/snowman/syncer/utils_test.go b/snow/engine/snowman/syncer/utils_test.go index 149d1fe0e681..a5217a4bf0dd 100644 --- a/snow/engine/snowman/syncer/utils_test.go +++ b/snow/engine/snowman/syncer/utils_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package syncer diff --git a/snow/engine/snowman/test_engine.go b/snow/engine/snowman/test_engine.go index ed6e1b1743c5..eada8463a041 100644 --- a/snow/engine/snowman/test_engine.go +++ b/snow/engine/snowman/test_engine.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowman diff --git a/snow/engine/snowman/traced_engine.go b/snow/engine/snowman/traced_engine.go index 56b46de45d4e..f736dff48fbf 100644 --- a/snow/engine/snowman/traced_engine.go +++ b/snow/engine/snowman/traced_engine.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowman diff --git a/snow/engine/snowman/transitive.go b/snow/engine/snowman/transitive.go index 4b43dcda0acb..34954885a66d 100644 --- a/snow/engine/snowman/transitive.go +++ b/snow/engine/snowman/transitive.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowman diff --git a/snow/engine/snowman/transitive_test.go b/snow/engine/snowman/transitive_test.go index c06dc5c924cf..a6b96ced21bd 100644 --- a/snow/engine/snowman/transitive_test.go +++ b/snow/engine/snowman/transitive_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowman diff --git a/snow/engine/snowman/voter.go b/snow/engine/snowman/voter.go index 7d267b2efbcf..0a029e870ec2 100644 --- a/snow/engine/snowman/voter.go +++ b/snow/engine/snowman/voter.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowman diff --git a/snow/event/blockable.go b/snow/event/blockable.go index 05521dc2fe16..404e95c2aee3 100644 --- a/snow/event/blockable.go +++ b/snow/event/blockable.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package event diff --git a/snow/event/blocker.go b/snow/event/blocker.go index 6f8e76b2d476..9c15ffb50604 100644 --- a/snow/event/blocker.go +++ b/snow/event/blocker.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package event diff --git a/snow/event/blocker_test.go b/snow/event/blocker_test.go index 838a4f69d24b..d7620bfebe1a 100644 --- a/snow/event/blocker_test.go +++ b/snow/event/blocker_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package event diff --git a/snow/networking/benchlist/benchable.go b/snow/networking/benchlist/benchable.go index e7ed46c678f9..f1cc85d9fe05 100644 --- a/snow/networking/benchlist/benchable.go +++ b/snow/networking/benchlist/benchable.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package benchlist diff --git a/snow/networking/benchlist/benchlist.go b/snow/networking/benchlist/benchlist.go index 15b42b76b467..08f7e7d8d65e 100644 --- a/snow/networking/benchlist/benchlist.go +++ b/snow/networking/benchlist/benchlist.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package benchlist diff --git a/snow/networking/benchlist/benchlist_test.go b/snow/networking/benchlist/benchlist_test.go index 5e068e78aef4..45568392297e 100644 --- a/snow/networking/benchlist/benchlist_test.go +++ b/snow/networking/benchlist/benchlist_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package benchlist diff --git a/snow/networking/benchlist/manager.go b/snow/networking/benchlist/manager.go index 7a42e8245267..e6ac45da4400 100644 --- a/snow/networking/benchlist/manager.go +++ b/snow/networking/benchlist/manager.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package benchlist diff --git a/snow/networking/benchlist/metrics.go b/snow/networking/benchlist/metrics.go index 12da52d396a0..25f9e50f7da8 100644 --- a/snow/networking/benchlist/metrics.go +++ b/snow/networking/benchlist/metrics.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package benchlist diff --git a/snow/networking/benchlist/test_benchable.go b/snow/networking/benchlist/test_benchable.go index 5e179763d2d1..dabfab564829 100644 --- a/snow/networking/benchlist/test_benchable.go +++ b/snow/networking/benchlist/test_benchable.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package benchlist diff --git a/snow/networking/handler/engine.go b/snow/networking/handler/engine.go index 94ae54ff08c6..e3de84ac8989 100644 --- a/snow/networking/handler/engine.go +++ b/snow/networking/handler/engine.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package handler diff --git a/snow/networking/handler/engine_test.go b/snow/networking/handler/engine_test.go index 142441cfda6d..e9b2b8ae0162 100644 --- a/snow/networking/handler/engine_test.go +++ b/snow/networking/handler/engine_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package handler diff --git a/snow/networking/handler/handler.go b/snow/networking/handler/handler.go index b11f719cca13..35dc40f57f98 100644 --- a/snow/networking/handler/handler.go +++ b/snow/networking/handler/handler.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package handler diff --git a/snow/networking/handler/handler_test.go b/snow/networking/handler/handler_test.go index 71c3042c1807..1f51aa4f1d23 100644 --- a/snow/networking/handler/handler_test.go +++ b/snow/networking/handler/handler_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package handler diff --git a/snow/networking/handler/health.go b/snow/networking/handler/health.go index b68ead089639..3f4af4299d1c 100644 --- a/snow/networking/handler/health.go +++ b/snow/networking/handler/health.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package handler diff --git a/snow/networking/handler/health_test.go b/snow/networking/handler/health_test.go index 31c3d35ce348..f3fe456fa023 100644 --- a/snow/networking/handler/health_test.go +++ b/snow/networking/handler/health_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package handler diff --git a/snow/networking/handler/message_queue.go b/snow/networking/handler/message_queue.go index bc6ec7908a0f..58e4f2b3b29e 100644 --- a/snow/networking/handler/message_queue.go +++ b/snow/networking/handler/message_queue.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package handler diff --git a/snow/networking/handler/message_queue_metrics.go b/snow/networking/handler/message_queue_metrics.go index ce28769a41ca..429295ae04cb 100644 --- a/snow/networking/handler/message_queue_metrics.go +++ b/snow/networking/handler/message_queue_metrics.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package handler diff --git a/snow/networking/handler/message_queue_test.go b/snow/networking/handler/message_queue_test.go index 266843772c3c..457ba86ceda1 100644 --- a/snow/networking/handler/message_queue_test.go +++ b/snow/networking/handler/message_queue_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package handler diff --git a/snow/networking/handler/metrics.go b/snow/networking/handler/metrics.go index a8776b30832e..3fe9f2d9a2b3 100644 --- a/snow/networking/handler/metrics.go +++ b/snow/networking/handler/metrics.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package handler diff --git a/snow/networking/handler/parser.go b/snow/networking/handler/parser.go index 148572484ef5..4dc954e4e9f2 100644 --- a/snow/networking/handler/parser.go +++ b/snow/networking/handler/parser.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package handler diff --git a/snow/networking/router/chain_router.go b/snow/networking/router/chain_router.go index b55e77f66f41..f2c6d11775dd 100644 --- a/snow/networking/router/chain_router.go +++ b/snow/networking/router/chain_router.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package router diff --git a/snow/networking/router/chain_router_metrics.go b/snow/networking/router/chain_router_metrics.go index 58440377ba82..bc8f26223586 100644 --- a/snow/networking/router/chain_router_metrics.go +++ b/snow/networking/router/chain_router_metrics.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package router diff --git a/snow/networking/router/chain_router_test.go b/snow/networking/router/chain_router_test.go index d99fecd1af00..1897aae89bc2 100644 --- a/snow/networking/router/chain_router_test.go +++ b/snow/networking/router/chain_router_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package router diff --git a/snow/networking/router/health.go b/snow/networking/router/health.go index d678f0f19aa1..3968f981d084 100644 --- a/snow/networking/router/health.go +++ b/snow/networking/router/health.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package router diff --git a/snow/networking/router/inbound_handler.go b/snow/networking/router/inbound_handler.go index cfd6d5fa222f..81d2d9b810be 100644 --- a/snow/networking/router/inbound_handler.go +++ b/snow/networking/router/inbound_handler.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package router diff --git a/snow/networking/router/main_test.go b/snow/networking/router/main_test.go index afc1dddb173e..4398ad2eefeb 100644 --- a/snow/networking/router/main_test.go +++ b/snow/networking/router/main_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package router diff --git a/snow/networking/router/router.go b/snow/networking/router/router.go index bba00eb7ae06..4df5614c25fb 100644 --- a/snow/networking/router/router.go +++ b/snow/networking/router/router.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package router diff --git a/snow/networking/router/traced_router.go b/snow/networking/router/traced_router.go index fe493e6717a8..955ccb43bbed 100644 --- a/snow/networking/router/traced_router.go +++ b/snow/networking/router/traced_router.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package router diff --git a/snow/networking/sender/external_sender.go b/snow/networking/sender/external_sender.go index 72d9539d41e5..7d279889e3af 100644 --- a/snow/networking/sender/external_sender.go +++ b/snow/networking/sender/external_sender.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sender diff --git a/snow/networking/sender/sender.go b/snow/networking/sender/sender.go index b6fe0bbb2844..08a05305029a 100644 --- a/snow/networking/sender/sender.go +++ b/snow/networking/sender/sender.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sender diff --git a/snow/networking/sender/sender_test.go b/snow/networking/sender/sender_test.go index 69363b2eeb67..5ad019731857 100644 --- a/snow/networking/sender/sender_test.go +++ b/snow/networking/sender/sender_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sender diff --git a/snow/networking/sender/test_external_sender.go b/snow/networking/sender/test_external_sender.go index 7b8bef90e8eb..ae06187216bf 100644 --- a/snow/networking/sender/test_external_sender.go +++ b/snow/networking/sender/test_external_sender.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sender diff --git a/snow/networking/sender/traced_sender.go b/snow/networking/sender/traced_sender.go index 2011cdc38fb1..c5fdf6dcbc54 100644 --- a/snow/networking/sender/traced_sender.go +++ b/snow/networking/sender/traced_sender.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sender diff --git a/snow/networking/timeout/main_test.go b/snow/networking/timeout/main_test.go index f3bee130e58b..c8a597fa91b1 100644 --- a/snow/networking/timeout/main_test.go +++ b/snow/networking/timeout/main_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package timeout diff --git a/snow/networking/timeout/manager.go b/snow/networking/timeout/manager.go index f1db8a1e01a0..95a3be25e166 100644 --- a/snow/networking/timeout/manager.go +++ b/snow/networking/timeout/manager.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package timeout diff --git a/snow/networking/timeout/manager_test.go b/snow/networking/timeout/manager_test.go index 582da3a9ea1b..73313322a81a 100644 --- a/snow/networking/timeout/manager_test.go +++ b/snow/networking/timeout/manager_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package timeout diff --git a/snow/networking/timeout/metrics.go b/snow/networking/timeout/metrics.go index 6be45fd2a97e..def073b56558 100644 --- a/snow/networking/timeout/metrics.go +++ b/snow/networking/timeout/metrics.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package timeout diff --git a/snow/networking/tracker/resource_tracker.go b/snow/networking/tracker/resource_tracker.go index 7910c2fff475..b4b14a7561cf 100644 --- a/snow/networking/tracker/resource_tracker.go +++ b/snow/networking/tracker/resource_tracker.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tracker diff --git a/snow/networking/tracker/resource_tracker_test.go b/snow/networking/tracker/resource_tracker_test.go index 64a897589f90..a87958708cb1 100644 --- a/snow/networking/tracker/resource_tracker_test.go +++ b/snow/networking/tracker/resource_tracker_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tracker diff --git a/snow/networking/tracker/targeter.go b/snow/networking/tracker/targeter.go index 4c69ab9508c1..39a7398e391c 100644 --- a/snow/networking/tracker/targeter.go +++ b/snow/networking/tracker/targeter.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tracker diff --git a/snow/networking/tracker/targeter_test.go b/snow/networking/tracker/targeter_test.go index 55974dbf4ac6..cc533791cf91 100644 --- a/snow/networking/tracker/targeter_test.go +++ b/snow/networking/tracker/targeter_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tracker diff --git a/snow/snowtest/snowtest.go b/snow/snowtest/snowtest.go index 2450ebaf941d..83fd98925d90 100644 --- a/snow/snowtest/snowtest.go +++ b/snow/snowtest/snowtest.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snowtest diff --git a/snow/state.go b/snow/state.go index bb671f26e672..091cd31f50f1 100644 --- a/snow/state.go +++ b/snow/state.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package snow diff --git a/snow/uptime/locked_calculator.go b/snow/uptime/locked_calculator.go index 687b5f5905f5..884878ab24f6 100644 --- a/snow/uptime/locked_calculator.go +++ b/snow/uptime/locked_calculator.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package uptime diff --git a/snow/uptime/locked_calculator_test.go b/snow/uptime/locked_calculator_test.go index 254497f62d02..3b073726e654 100644 --- a/snow/uptime/locked_calculator_test.go +++ b/snow/uptime/locked_calculator_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package uptime diff --git a/snow/uptime/manager.go b/snow/uptime/manager.go index 2fc2e1605298..a64b71ca62de 100644 --- a/snow/uptime/manager.go +++ b/snow/uptime/manager.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package uptime diff --git a/snow/uptime/manager_test.go b/snow/uptime/manager_test.go index de2c038086d5..e04fcc3a9fbe 100644 --- a/snow/uptime/manager_test.go +++ b/snow/uptime/manager_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package uptime diff --git a/snow/uptime/no_op_calculator.go b/snow/uptime/no_op_calculator.go index 44c688e31be7..fb308f4f6030 100644 --- a/snow/uptime/no_op_calculator.go +++ b/snow/uptime/no_op_calculator.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package uptime diff --git a/snow/uptime/state.go b/snow/uptime/state.go index 5b2592acc70d..f9edeb76a3ee 100644 --- a/snow/uptime/state.go +++ b/snow/uptime/state.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package uptime diff --git a/snow/uptime/test_state.go b/snow/uptime/test_state.go index 58687e1671b8..23879b5cb3a9 100644 --- a/snow/uptime/test_state.go +++ b/snow/uptime/test_state.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package uptime diff --git a/snow/validators/connector.go b/snow/validators/connector.go index abb28d084c20..e3e7e1f94ed4 100644 --- a/snow/validators/connector.go +++ b/snow/validators/connector.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package validators diff --git a/snow/validators/gvalidators/validator_state_client.go b/snow/validators/gvalidators/validator_state_client.go index 51e68592c001..49fa1e641417 100644 --- a/snow/validators/gvalidators/validator_state_client.go +++ b/snow/validators/gvalidators/validator_state_client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package gvalidators diff --git a/snow/validators/gvalidators/validator_state_server.go b/snow/validators/gvalidators/validator_state_server.go index ad9b75197947..5476dca4db99 100644 --- a/snow/validators/gvalidators/validator_state_server.go +++ b/snow/validators/gvalidators/validator_state_server.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package gvalidators diff --git a/snow/validators/gvalidators/validator_state_test.go b/snow/validators/gvalidators/validator_state_test.go index da8a66570f0b..9b6e692d8645 100644 --- a/snow/validators/gvalidators/validator_state_test.go +++ b/snow/validators/gvalidators/validator_state_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package gvalidators diff --git a/snow/validators/logger.go b/snow/validators/logger.go index 2e672a1827ba..40613b76b68d 100644 --- a/snow/validators/logger.go +++ b/snow/validators/logger.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package validators diff --git a/snow/validators/manager.go b/snow/validators/manager.go index c42ea779d96b..5844c1e7f185 100644 --- a/snow/validators/manager.go +++ b/snow/validators/manager.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package validators diff --git a/snow/validators/manager_test.go b/snow/validators/manager_test.go index 6980510fecd1..781d2e784e1d 100644 --- a/snow/validators/manager_test.go +++ b/snow/validators/manager_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package validators diff --git a/snow/validators/set.go b/snow/validators/set.go index dfa294a70bbe..5e7c81a2310e 100644 --- a/snow/validators/set.go +++ b/snow/validators/set.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package validators diff --git a/snow/validators/set_test.go b/snow/validators/set_test.go index 48c19e59b11a..4554f930fa37 100644 --- a/snow/validators/set_test.go +++ b/snow/validators/set_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package validators diff --git a/snow/validators/state.go b/snow/validators/state.go index fa9ef2783165..3f92df35231b 100644 --- a/snow/validators/state.go +++ b/snow/validators/state.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package validators diff --git a/snow/validators/subnet_connector.go b/snow/validators/subnet_connector.go index 6b4a24bd85e5..06b02ff90820 100644 --- a/snow/validators/subnet_connector.go +++ b/snow/validators/subnet_connector.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package validators diff --git a/snow/validators/test_state.go b/snow/validators/test_state.go index eb6af391a1d8..ee4102cf7194 100644 --- a/snow/validators/test_state.go +++ b/snow/validators/test_state.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package validators diff --git a/snow/validators/traced_state.go b/snow/validators/traced_state.go index e1f5472001e2..126a2b009eb0 100644 --- a/snow/validators/traced_state.go +++ b/snow/validators/traced_state.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package validators diff --git a/snow/validators/unhandled_subnet_connector.go b/snow/validators/unhandled_subnet_connector.go index de7225aa2a80..08447c4582ad 100644 --- a/snow/validators/unhandled_subnet_connector.go +++ b/snow/validators/unhandled_subnet_connector.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package validators diff --git a/snow/validators/validator.go b/snow/validators/validator.go index 56664ddc00a1..499b5189e424 100644 --- a/snow/validators/validator.go +++ b/snow/validators/validator.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package validators diff --git a/staking/asn1.go b/staking/asn1.go index 13579600eb3c..a21ebc7ff88c 100644 --- a/staking/asn1.go +++ b/staking/asn1.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package staking diff --git a/staking/certificate.go b/staking/certificate.go index 9521f43abef0..53d86a748b97 100644 --- a/staking/certificate.go +++ b/staking/certificate.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package staking diff --git a/staking/parse.go b/staking/parse.go index 04b47aba5a32..6de6b63dd4dd 100644 --- a/staking/parse.go +++ b/staking/parse.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package staking diff --git a/staking/tls.go b/staking/tls.go index fe461d52e32e..fbb5d9e488ae 100644 --- a/staking/tls.go +++ b/staking/tls.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package staking diff --git a/staking/tls_test.go b/staking/tls_test.go index 2282090b4c8e..6de376c2a538 100644 --- a/staking/tls_test.go +++ b/staking/tls_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package staking diff --git a/staking/verify.go b/staking/verify.go index 8da442e8b998..5fc8d77278e1 100644 --- a/staking/verify.go +++ b/staking/verify.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package staking diff --git a/staking/verify_test.go b/staking/verify_test.go index e7cee91c1b43..7fcf0ba8d624 100644 --- a/staking/verify_test.go +++ b/staking/verify_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package staking diff --git a/subnets/config.go b/subnets/config.go index 3ccbab79c50e..9a12c550b833 100644 --- a/subnets/config.go +++ b/subnets/config.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package subnets diff --git a/subnets/config_test.go b/subnets/config_test.go index 2294a1e5176a..fdb10c4e072a 100644 --- a/subnets/config_test.go +++ b/subnets/config_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package subnets diff --git a/subnets/no_op_allower.go b/subnets/no_op_allower.go index 9d2d51ea26d3..9cb7115e910d 100644 --- a/subnets/no_op_allower.go +++ b/subnets/no_op_allower.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package subnets diff --git a/subnets/subnet.go b/subnets/subnet.go index 31bc9dcb562b..95425ba30500 100644 --- a/subnets/subnet.go +++ b/subnets/subnet.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package subnets diff --git a/subnets/subnet_test.go b/subnets/subnet_test.go index 98a75dfd2813..3a816a158f04 100644 --- a/subnets/subnet_test.go +++ b/subnets/subnet_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package subnets diff --git a/tests/colors.go b/tests/colors.go index 3aa935a5fce9..6cfec4df3dc0 100644 --- a/tests/colors.go +++ b/tests/colors.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tests diff --git a/tests/e2e/banff/suites.go b/tests/e2e/banff/suites.go index 37d0aa90156a..009bad3494b3 100644 --- a/tests/e2e/banff/suites.go +++ b/tests/e2e/banff/suites.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. // Implements tests for the banff network upgrade. diff --git a/tests/e2e/c/dynamic_fees.go b/tests/e2e/c/dynamic_fees.go index 5e80573542b4..0978bddc91d2 100644 --- a/tests/e2e/c/dynamic_fees.go +++ b/tests/e2e/c/dynamic_fees.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package c diff --git a/tests/e2e/c/hashing_contract.go b/tests/e2e/c/hashing_contract.go index af5e81eb9057..7bf1db76c7cf 100644 --- a/tests/e2e/c/hashing_contract.go +++ b/tests/e2e/c/hashing_contract.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. // AUTOMATICALLY GENERATED. DO NOT EDIT! diff --git a/tests/e2e/c/interchain_workflow.go b/tests/e2e/c/interchain_workflow.go index e959418e878a..0ce0ace59113 100644 --- a/tests/e2e/c/interchain_workflow.go +++ b/tests/e2e/c/interchain_workflow.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package c diff --git a/tests/e2e/e2e_test.go b/tests/e2e/e2e_test.go index 3245516262d2..7b9677dd7fc9 100644 --- a/tests/e2e/e2e_test.go +++ b/tests/e2e/e2e_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package e2e_test diff --git a/tests/e2e/faultinjection/duplicate_node_id.go b/tests/e2e/faultinjection/duplicate_node_id.go index 938d60f9303f..d20ef1a28c0c 100644 --- a/tests/e2e/faultinjection/duplicate_node_id.go +++ b/tests/e2e/faultinjection/duplicate_node_id.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package faultinjection diff --git a/tests/e2e/ignore.go b/tests/e2e/ignore.go index 50332a1ac80e..ddf89c5d1bcc 100644 --- a/tests/e2e/ignore.go +++ b/tests/e2e/ignore.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package e2e diff --git a/tests/e2e/p/interchain_workflow.go b/tests/e2e/p/interchain_workflow.go index 59e90198bed0..8983c46adcbd 100644 --- a/tests/e2e/p/interchain_workflow.go +++ b/tests/e2e/p/interchain_workflow.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package p diff --git a/tests/e2e/p/permissionless_subnets.go b/tests/e2e/p/permissionless_subnets.go index 566e36aa6178..ebb9dc602e6c 100644 --- a/tests/e2e/p/permissionless_subnets.go +++ b/tests/e2e/p/permissionless_subnets.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package p diff --git a/tests/e2e/p/staking_rewards.go b/tests/e2e/p/staking_rewards.go index 134c055dcde4..43b64456de96 100644 --- a/tests/e2e/p/staking_rewards.go +++ b/tests/e2e/p/staking_rewards.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package p diff --git a/tests/e2e/p/workflow.go b/tests/e2e/p/workflow.go index 12410f1eeb54..8bf7efca2c2c 100644 --- a/tests/e2e/p/workflow.go +++ b/tests/e2e/p/workflow.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package p diff --git a/tests/e2e/static-handlers/suites.go b/tests/e2e/static-handlers/suites.go index 09367186da32..e18f16adaebf 100644 --- a/tests/e2e/static-handlers/suites.go +++ b/tests/e2e/static-handlers/suites.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. // Implements static handlers tests for avm and platformvm diff --git a/tests/e2e/x/interchain_workflow.go b/tests/e2e/x/interchain_workflow.go index f0c2951feb84..eec7b3427c19 100644 --- a/tests/e2e/x/interchain_workflow.go +++ b/tests/e2e/x/interchain_workflow.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package x diff --git a/tests/e2e/x/transfer/virtuous.go b/tests/e2e/x/transfer/virtuous.go index b409f7e5e555..9fc8ae89ec44 100644 --- a/tests/e2e/x/transfer/virtuous.go +++ b/tests/e2e/x/transfer/virtuous.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. // Implements X-chain transfer tests. diff --git a/tests/fixture/e2e/describe.go b/tests/fixture/e2e/describe.go index 5475a7114c96..2810117758c6 100644 --- a/tests/fixture/e2e/describe.go +++ b/tests/fixture/e2e/describe.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package e2e diff --git a/tests/fixture/e2e/env.go b/tests/fixture/e2e/env.go index 1ea9dc69f2b9..ddd50580ade5 100644 --- a/tests/fixture/e2e/env.go +++ b/tests/fixture/e2e/env.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package e2e diff --git a/tests/fixture/e2e/flags.go b/tests/fixture/e2e/flags.go index b1354473fe86..6cedf003b3a3 100644 --- a/tests/fixture/e2e/flags.go +++ b/tests/fixture/e2e/flags.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package e2e diff --git a/tests/fixture/e2e/helpers.go b/tests/fixture/e2e/helpers.go index ddebfbc8b81c..e57949106805 100644 --- a/tests/fixture/e2e/helpers.go +++ b/tests/fixture/e2e/helpers.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package e2e diff --git a/tests/fixture/test_data_server.go b/tests/fixture/test_data_server.go index 77e79b278b13..b79dcc2bb26b 100644 --- a/tests/fixture/test_data_server.go +++ b/tests/fixture/test_data_server.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package fixture diff --git a/tests/fixture/test_data_server_test.go b/tests/fixture/test_data_server_test.go index 7f68a6935da3..6ad7644264d7 100644 --- a/tests/fixture/test_data_server_test.go +++ b/tests/fixture/test_data_server_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package fixture diff --git a/tests/fixture/tmpnet/cmd/main.go b/tests/fixture/tmpnet/cmd/main.go index 9baf4557bca4..45ed58cef7a5 100644 --- a/tests/fixture/tmpnet/cmd/main.go +++ b/tests/fixture/tmpnet/cmd/main.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package main diff --git a/tests/fixture/tmpnet/defaults.go b/tests/fixture/tmpnet/defaults.go index 11e9ab72787d..8ae303cf9af4 100644 --- a/tests/fixture/tmpnet/defaults.go +++ b/tests/fixture/tmpnet/defaults.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tmpnet diff --git a/tests/fixture/tmpnet/flags.go b/tests/fixture/tmpnet/flags.go index 556bfbec961e..3084982ea704 100644 --- a/tests/fixture/tmpnet/flags.go +++ b/tests/fixture/tmpnet/flags.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tmpnet diff --git a/tests/fixture/tmpnet/genesis.go b/tests/fixture/tmpnet/genesis.go index 5ee605702482..a200efb3b065 100644 --- a/tests/fixture/tmpnet/genesis.go +++ b/tests/fixture/tmpnet/genesis.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tmpnet diff --git a/tests/fixture/tmpnet/network.go b/tests/fixture/tmpnet/network.go index 5f1eaf5a4513..0c5818efa0ee 100644 --- a/tests/fixture/tmpnet/network.go +++ b/tests/fixture/tmpnet/network.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tmpnet diff --git a/tests/fixture/tmpnet/network_test.go b/tests/fixture/tmpnet/network_test.go index 1a06a07f4a38..a797ff873a25 100644 --- a/tests/fixture/tmpnet/network_test.go +++ b/tests/fixture/tmpnet/network_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tmpnet diff --git a/tests/fixture/tmpnet/node.go b/tests/fixture/tmpnet/node.go index 955e38dc6995..f0f800802046 100644 --- a/tests/fixture/tmpnet/node.go +++ b/tests/fixture/tmpnet/node.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tmpnet diff --git a/tests/fixture/tmpnet/node_config.go b/tests/fixture/tmpnet/node_config.go index 8771ce48f2bd..15000ae279fb 100644 --- a/tests/fixture/tmpnet/node_config.go +++ b/tests/fixture/tmpnet/node_config.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tmpnet diff --git a/tests/fixture/tmpnet/node_process.go b/tests/fixture/tmpnet/node_process.go index bec294b20713..c2e2e33139bf 100644 --- a/tests/fixture/tmpnet/node_process.go +++ b/tests/fixture/tmpnet/node_process.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tmpnet diff --git a/tests/fixture/tmpnet/utils.go b/tests/fixture/tmpnet/utils.go index 74e6e3737069..b363bdec8671 100644 --- a/tests/fixture/tmpnet/utils.go +++ b/tests/fixture/tmpnet/utils.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tmpnet diff --git a/tests/http.go b/tests/http.go index 77c309f16f86..073b6d2df126 100644 --- a/tests/http.go +++ b/tests/http.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tests diff --git a/tests/upgrade/upgrade_test.go b/tests/upgrade/upgrade_test.go index 862b08555b4f..9f56c79ad910 100644 --- a/tests/upgrade/upgrade_test.go +++ b/tests/upgrade/upgrade_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package upgrade diff --git a/trace/exporter.go b/trace/exporter.go index 252200975caf..4cca5fe3e53e 100644 --- a/trace/exporter.go +++ b/trace/exporter.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package trace diff --git a/trace/exporter_type.go b/trace/exporter_type.go index 52d0124fe2b7..206731acc3bd 100644 --- a/trace/exporter_type.go +++ b/trace/exporter_type.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package trace diff --git a/trace/noop.go b/trace/noop.go index faa512b3429e..153934b143af 100644 --- a/trace/noop.go +++ b/trace/noop.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package trace diff --git a/trace/tracer.go b/trace/tracer.go index c511ff3bb0c9..1c8d40e8347f 100644 --- a/trace/tracer.go +++ b/trace/tracer.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package trace diff --git a/utils/atomic.go b/utils/atomic.go index 2d75a4f47d6f..3bb125ee8af6 100644 --- a/utils/atomic.go +++ b/utils/atomic.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package utils diff --git a/utils/atomic_test.go b/utils/atomic_test.go index 1af2ba490f2f..3fa74063c18a 100644 --- a/utils/atomic_test.go +++ b/utils/atomic_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package utils diff --git a/utils/bag/bag.go b/utils/bag/bag.go index 496969a01b17..a9af1acbcf49 100644 --- a/utils/bag/bag.go +++ b/utils/bag/bag.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bag diff --git a/utils/bag/bag_benchmark_test.go b/utils/bag/bag_benchmark_test.go index 833ce755af93..e17b27b891bc 100644 --- a/utils/bag/bag_benchmark_test.go +++ b/utils/bag/bag_benchmark_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bag diff --git a/utils/bag/bag_test.go b/utils/bag/bag_test.go index ffbda6379c77..3b6e0faa07f0 100644 --- a/utils/bag/bag_test.go +++ b/utils/bag/bag_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bag diff --git a/utils/bag/unique_bag.go b/utils/bag/unique_bag.go index 751159f16d9b..f5d679a5b816 100644 --- a/utils/bag/unique_bag.go +++ b/utils/bag/unique_bag.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bag diff --git a/utils/bag/unique_bag_test.go b/utils/bag/unique_bag_test.go index d15ecbf3a5cf..1562b5c9f04c 100644 --- a/utils/bag/unique_bag_test.go +++ b/utils/bag/unique_bag_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bag diff --git a/utils/beacon/beacon.go b/utils/beacon/beacon.go index 47e41032677e..38ac6df5b0f5 100644 --- a/utils/beacon/beacon.go +++ b/utils/beacon/beacon.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package beacon diff --git a/utils/beacon/set.go b/utils/beacon/set.go index 243f8399a915..8b6970b55421 100644 --- a/utils/beacon/set.go +++ b/utils/beacon/set.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package beacon diff --git a/utils/beacon/set_test.go b/utils/beacon/set_test.go index 3f4d6cbc4053..976d0582e3ff 100644 --- a/utils/beacon/set_test.go +++ b/utils/beacon/set_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package beacon diff --git a/utils/bimap/bimap.go b/utils/bimap/bimap.go index 28d20750bace..c44ff0ff60a9 100644 --- a/utils/bimap/bimap.go +++ b/utils/bimap/bimap.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bimap diff --git a/utils/bimap/bimap_test.go b/utils/bimap/bimap_test.go index 9914578c6070..dffa80dc008d 100644 --- a/utils/bimap/bimap_test.go +++ b/utils/bimap/bimap_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bimap diff --git a/utils/bloom/bloom_filter.go b/utils/bloom/bloom_filter.go index 498c57d3552f..c4a0ff4c4ae8 100644 --- a/utils/bloom/bloom_filter.go +++ b/utils/bloom/bloom_filter.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bloom diff --git a/utils/bloom/bloom_filter_test.go b/utils/bloom/bloom_filter_test.go index 7e810add0f3e..c28443d99912 100644 --- a/utils/bloom/bloom_filter_test.go +++ b/utils/bloom/bloom_filter_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bloom diff --git a/utils/bloom/map_filter.go b/utils/bloom/map_filter.go index 19046bea4c11..d0edcbe88fd0 100644 --- a/utils/bloom/map_filter.go +++ b/utils/bloom/map_filter.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bloom diff --git a/utils/buffer/bounded_nonblocking_queue.go b/utils/buffer/bounded_nonblocking_queue.go index 0b5d5f945d52..f8b0030e9687 100644 --- a/utils/buffer/bounded_nonblocking_queue.go +++ b/utils/buffer/bounded_nonblocking_queue.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package buffer diff --git a/utils/buffer/bounded_nonblocking_queue_test.go b/utils/buffer/bounded_nonblocking_queue_test.go index e6a6fdac3e49..323ea92589be 100644 --- a/utils/buffer/bounded_nonblocking_queue_test.go +++ b/utils/buffer/bounded_nonblocking_queue_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package buffer diff --git a/utils/buffer/unbounded_blocking_deque.go b/utils/buffer/unbounded_blocking_deque.go index 078d8d908ee8..a6c7fb66d6e1 100644 --- a/utils/buffer/unbounded_blocking_deque.go +++ b/utils/buffer/unbounded_blocking_deque.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package buffer diff --git a/utils/buffer/unbounded_blocking_deque_test.go b/utils/buffer/unbounded_blocking_deque_test.go index 054d3a2e6bed..1f22db9916b9 100644 --- a/utils/buffer/unbounded_blocking_deque_test.go +++ b/utils/buffer/unbounded_blocking_deque_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package buffer diff --git a/utils/buffer/unbounded_deque.go b/utils/buffer/unbounded_deque.go index 336f0869c907..873f33f14817 100644 --- a/utils/buffer/unbounded_deque.go +++ b/utils/buffer/unbounded_deque.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package buffer diff --git a/utils/buffer/unbounded_deque_test.go b/utils/buffer/unbounded_deque_test.go index 5b759da1c0e9..dfdac4a53412 100644 --- a/utils/buffer/unbounded_deque_test.go +++ b/utils/buffer/unbounded_deque_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package buffer diff --git a/utils/bytes.go b/utils/bytes.go index c025c4915c9e..a32f353cf75e 100644 --- a/utils/bytes.go +++ b/utils/bytes.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package utils diff --git a/utils/cb58/cb58.go b/utils/cb58/cb58.go index 4d9cbd6f7449..27d8265cd2f9 100644 --- a/utils/cb58/cb58.go +++ b/utils/cb58/cb58.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package cb58 diff --git a/utils/cb58/cb58_test.go b/utils/cb58/cb58_test.go index 858c0b8783ba..9d28c6f90fa4 100644 --- a/utils/cb58/cb58_test.go +++ b/utils/cb58/cb58_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package cb58 diff --git a/utils/compression/compressor.go b/utils/compression/compressor.go index f0848357a882..c8624f9baf84 100644 --- a/utils/compression/compressor.go +++ b/utils/compression/compressor.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package compression diff --git a/utils/compression/compressor_test.go b/utils/compression/compressor_test.go index 0467c2c1b234..f4f024e550b9 100644 --- a/utils/compression/compressor_test.go +++ b/utils/compression/compressor_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package compression diff --git a/utils/compression/gzip_compressor.go b/utils/compression/gzip_compressor.go index a17c46f6d6a3..90067512a771 100644 --- a/utils/compression/gzip_compressor.go +++ b/utils/compression/gzip_compressor.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package compression diff --git a/utils/compression/no_compressor.go b/utils/compression/no_compressor.go index 1eb4237d9766..3c444c71d993 100644 --- a/utils/compression/no_compressor.go +++ b/utils/compression/no_compressor.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package compression diff --git a/utils/compression/no_compressor_test.go b/utils/compression/no_compressor_test.go index 95000667658c..3b99a101814d 100644 --- a/utils/compression/no_compressor_test.go +++ b/utils/compression/no_compressor_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package compression diff --git a/utils/compression/type.go b/utils/compression/type.go index fd58a21f70fa..6af0cf75407d 100644 --- a/utils/compression/type.go +++ b/utils/compression/type.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package compression diff --git a/utils/compression/type_test.go b/utils/compression/type_test.go index 13d6b313aa48..eacad3bad598 100644 --- a/utils/compression/type_test.go +++ b/utils/compression/type_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package compression diff --git a/utils/compression/zstd_compressor.go b/utils/compression/zstd_compressor.go index eafc1071845f..b374fa850ee6 100644 --- a/utils/compression/zstd_compressor.go +++ b/utils/compression/zstd_compressor.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package compression diff --git a/utils/constants/acps.go b/utils/constants/acps.go index ea49d7c7812f..6774828cde31 100644 --- a/utils/constants/acps.go +++ b/utils/constants/acps.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package constants diff --git a/utils/constants/aliases.go b/utils/constants/aliases.go index dd94bd363925..494165019688 100644 --- a/utils/constants/aliases.go +++ b/utils/constants/aliases.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package constants diff --git a/utils/constants/application.go b/utils/constants/application.go index 117b85d9eb9e..4e59fd3777fb 100644 --- a/utils/constants/application.go +++ b/utils/constants/application.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package constants diff --git a/utils/constants/memory.go b/utils/constants/memory.go index c8740ceba6f7..cca6ee7af0f9 100644 --- a/utils/constants/memory.go +++ b/utils/constants/memory.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package constants diff --git a/utils/constants/network_ids.go b/utils/constants/network_ids.go index fe2819d376ee..d00472a39f32 100644 --- a/utils/constants/network_ids.go +++ b/utils/constants/network_ids.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package constants diff --git a/utils/constants/network_ids_test.go b/utils/constants/network_ids_test.go index 69557096efd8..a368a2d36532 100644 --- a/utils/constants/network_ids_test.go +++ b/utils/constants/network_ids_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package constants diff --git a/utils/constants/networking.go b/utils/constants/networking.go index a9417eac37c9..8d60d27af58a 100644 --- a/utils/constants/networking.go +++ b/utils/constants/networking.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package constants diff --git a/utils/constants/vm_ids.go b/utils/constants/vm_ids.go index 4fb887c425f2..9fda498f1f31 100644 --- a/utils/constants/vm_ids.go +++ b/utils/constants/vm_ids.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package constants diff --git a/utils/context.go b/utils/context.go index 9ff300186881..453c45e948a4 100644 --- a/utils/context.go +++ b/utils/context.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package utils diff --git a/utils/crypto/bls/bls_benchmark_test.go b/utils/crypto/bls/bls_benchmark_test.go index cd3568005764..b9648b43c04e 100644 --- a/utils/crypto/bls/bls_benchmark_test.go +++ b/utils/crypto/bls/bls_benchmark_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bls diff --git a/utils/crypto/bls/bls_test.go b/utils/crypto/bls/bls_test.go index f3bb05004376..e8a4a45bb97d 100644 --- a/utils/crypto/bls/bls_test.go +++ b/utils/crypto/bls/bls_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bls diff --git a/utils/crypto/bls/public.go b/utils/crypto/bls/public.go index 8d8237f83d5e..2c3cca7a0181 100644 --- a/utils/crypto/bls/public.go +++ b/utils/crypto/bls/public.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bls diff --git a/utils/crypto/bls/public_test.go b/utils/crypto/bls/public_test.go index 9cd886400b2d..4465b014cff4 100644 --- a/utils/crypto/bls/public_test.go +++ b/utils/crypto/bls/public_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bls diff --git a/utils/crypto/bls/secret.go b/utils/crypto/bls/secret.go index 3f385624520c..049938bdaf8e 100644 --- a/utils/crypto/bls/secret.go +++ b/utils/crypto/bls/secret.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bls diff --git a/utils/crypto/bls/secret_test.go b/utils/crypto/bls/secret_test.go index c01540ac4f98..d3d46e1aa737 100644 --- a/utils/crypto/bls/secret_test.go +++ b/utils/crypto/bls/secret_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bls diff --git a/utils/crypto/bls/signature.go b/utils/crypto/bls/signature.go index cafba33c48e6..0d0d029b796e 100644 --- a/utils/crypto/bls/signature.go +++ b/utils/crypto/bls/signature.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bls diff --git a/utils/crypto/bls/signature_test.go b/utils/crypto/bls/signature_test.go index caf613fc18df..3d43282c487a 100644 --- a/utils/crypto/bls/signature_test.go +++ b/utils/crypto/bls/signature_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package bls diff --git a/utils/crypto/keychain/keychain.go b/utils/crypto/keychain/keychain.go index 5899bb40382a..47d39b59f07c 100644 --- a/utils/crypto/keychain/keychain.go +++ b/utils/crypto/keychain/keychain.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package keychain diff --git a/utils/crypto/keychain/keychain_test.go b/utils/crypto/keychain/keychain_test.go index 73aa476122db..1d1dd86b6055 100644 --- a/utils/crypto/keychain/keychain_test.go +++ b/utils/crypto/keychain/keychain_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package keychain diff --git a/utils/crypto/keychain/ledger.go b/utils/crypto/keychain/ledger.go index d709ed19c939..955eb4480e24 100644 --- a/utils/crypto/keychain/ledger.go +++ b/utils/crypto/keychain/ledger.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package keychain diff --git a/utils/crypto/ledger/ledger.go b/utils/crypto/ledger/ledger.go index 5f8c34fe5715..70f6d4f07b84 100644 --- a/utils/crypto/ledger/ledger.go +++ b/utils/crypto/ledger/ledger.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package ledger diff --git a/utils/crypto/ledger/ledger_test.go b/utils/crypto/ledger/ledger_test.go index 118dc8758d1b..160b26365f84 100644 --- a/utils/crypto/ledger/ledger_test.go +++ b/utils/crypto/ledger/ledger_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package ledger diff --git a/utils/crypto/secp256k1/rfc6979_test.go b/utils/crypto/secp256k1/rfc6979_test.go index 5d9ee8b4f033..7efc019a3429 100644 --- a/utils/crypto/secp256k1/rfc6979_test.go +++ b/utils/crypto/secp256k1/rfc6979_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package secp256k1 diff --git a/utils/crypto/secp256k1/secp256k1.go b/utils/crypto/secp256k1/secp256k1.go index 733cee732d74..93ef887bf71d 100644 --- a/utils/crypto/secp256k1/secp256k1.go +++ b/utils/crypto/secp256k1/secp256k1.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package secp256k1 diff --git a/utils/crypto/secp256k1/secp256k1_benchmark_test.go b/utils/crypto/secp256k1/secp256k1_benchmark_test.go index 1d55f38f7d86..ca4f98e38fb5 100644 --- a/utils/crypto/secp256k1/secp256k1_benchmark_test.go +++ b/utils/crypto/secp256k1/secp256k1_benchmark_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package secp256k1 diff --git a/utils/crypto/secp256k1/secp256k1_test.go b/utils/crypto/secp256k1/secp256k1_test.go index a2074dff5229..39a915b9f9b3 100644 --- a/utils/crypto/secp256k1/secp256k1_test.go +++ b/utils/crypto/secp256k1/secp256k1_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package secp256k1 diff --git a/utils/crypto/secp256k1/test_keys.go b/utils/crypto/secp256k1/test_keys.go index 3122f2617ddf..4ceb567469b2 100644 --- a/utils/crypto/secp256k1/test_keys.go +++ b/utils/crypto/secp256k1/test_keys.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package secp256k1 diff --git a/utils/dynamicip/ifconfig_resolver.go b/utils/dynamicip/ifconfig_resolver.go index 0bbabcb58612..36c8d5adf04c 100644 --- a/utils/dynamicip/ifconfig_resolver.go +++ b/utils/dynamicip/ifconfig_resolver.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package dynamicip diff --git a/utils/dynamicip/no_updater.go b/utils/dynamicip/no_updater.go index 5c9e38bd54a1..e3e7c6155bd0 100644 --- a/utils/dynamicip/no_updater.go +++ b/utils/dynamicip/no_updater.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package dynamicip diff --git a/utils/dynamicip/opendns_resolver.go b/utils/dynamicip/opendns_resolver.go index 3bda76c46404..5c39c95535fc 100644 --- a/utils/dynamicip/opendns_resolver.go +++ b/utils/dynamicip/opendns_resolver.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package dynamicip diff --git a/utils/dynamicip/resolver.go b/utils/dynamicip/resolver.go index b3a341cd2121..45ad3778bc01 100644 --- a/utils/dynamicip/resolver.go +++ b/utils/dynamicip/resolver.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package dynamicip diff --git a/utils/dynamicip/resolver_test.go b/utils/dynamicip/resolver_test.go index e5e53d40f9f3..6af72a98a50a 100644 --- a/utils/dynamicip/resolver_test.go +++ b/utils/dynamicip/resolver_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package dynamicip diff --git a/utils/dynamicip/updater.go b/utils/dynamicip/updater.go index 87c99e6db0c5..9a59c9fd25e0 100644 --- a/utils/dynamicip/updater.go +++ b/utils/dynamicip/updater.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package dynamicip diff --git a/utils/dynamicip/updater_test.go b/utils/dynamicip/updater_test.go index 98ce26b4a189..66c9a21c4c6a 100644 --- a/utils/dynamicip/updater_test.go +++ b/utils/dynamicip/updater_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package dynamicip diff --git a/utils/error.go b/utils/error.go index b58c60cd001a..0a6a9f323e03 100644 --- a/utils/error.go +++ b/utils/error.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package utils diff --git a/utils/filesystem/io.go b/utils/filesystem/io.go index 939e635a2ca9..28a0c4aa1e32 100644 --- a/utils/filesystem/io.go +++ b/utils/filesystem/io.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package filesystem diff --git a/utils/filesystem/rename.go b/utils/filesystem/rename.go index 3ab7c147d355..578c46fb6c9e 100644 --- a/utils/filesystem/rename.go +++ b/utils/filesystem/rename.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package filesystem diff --git a/utils/filesystem/rename_test.go b/utils/filesystem/rename_test.go index 305a65092727..53c8a503bcf6 100644 --- a/utils/filesystem/rename_test.go +++ b/utils/filesystem/rename_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package filesystem diff --git a/utils/formatting/address/address.go b/utils/formatting/address/address.go index 321fe692bf57..97d4e0552969 100644 --- a/utils/formatting/address/address.go +++ b/utils/formatting/address/address.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package address diff --git a/utils/formatting/address/converter.go b/utils/formatting/address/converter.go index 8a5812a5bb2c..f043ab6a3489 100644 --- a/utils/formatting/address/converter.go +++ b/utils/formatting/address/converter.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package address diff --git a/utils/formatting/encoding.go b/utils/formatting/encoding.go index b80c82779810..742800fee86e 100644 --- a/utils/formatting/encoding.go +++ b/utils/formatting/encoding.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package formatting diff --git a/utils/formatting/encoding_benchmark_test.go b/utils/formatting/encoding_benchmark_test.go index 598ed39310ca..879933418e3e 100644 --- a/utils/formatting/encoding_benchmark_test.go +++ b/utils/formatting/encoding_benchmark_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package formatting diff --git a/utils/formatting/encoding_test.go b/utils/formatting/encoding_test.go index 29f6c1d5df39..6623e325e9cf 100644 --- a/utils/formatting/encoding_test.go +++ b/utils/formatting/encoding_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package formatting diff --git a/utils/formatting/int_format.go b/utils/formatting/int_format.go index 6cd8c870a43d..7c26655f2aba 100644 --- a/utils/formatting/int_format.go +++ b/utils/formatting/int_format.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package formatting diff --git a/utils/formatting/int_format_test.go b/utils/formatting/int_format_test.go index febf23bca4a2..aa5dce1dc8db 100644 --- a/utils/formatting/int_format_test.go +++ b/utils/formatting/int_format_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package formatting diff --git a/utils/formatting/prefixed_stringer.go b/utils/formatting/prefixed_stringer.go index 15fe720398a8..3c82cddd88a7 100644 --- a/utils/formatting/prefixed_stringer.go +++ b/utils/formatting/prefixed_stringer.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package formatting diff --git a/utils/hashing/consistent/hashable.go b/utils/hashing/consistent/hashable.go index df4a08d0ba44..a51ce4dfc817 100644 --- a/utils/hashing/consistent/hashable.go +++ b/utils/hashing/consistent/hashable.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package consistent diff --git a/utils/hashing/consistent/ring.go b/utils/hashing/consistent/ring.go index 1ade42ff359f..c99dd276047f 100644 --- a/utils/hashing/consistent/ring.go +++ b/utils/hashing/consistent/ring.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package consistent diff --git a/utils/hashing/consistent/ring_test.go b/utils/hashing/consistent/ring_test.go index ec9e69098b1a..4a8f3ca5b71b 100644 --- a/utils/hashing/consistent/ring_test.go +++ b/utils/hashing/consistent/ring_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package consistent diff --git a/utils/hashing/hasher.go b/utils/hashing/hasher.go index 7519dfbb69ec..be74c160d00f 100644 --- a/utils/hashing/hasher.go +++ b/utils/hashing/hasher.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package hashing diff --git a/utils/hashing/hashing.go b/utils/hashing/hashing.go index f2c79e235a64..0d09fd457247 100644 --- a/utils/hashing/hashing.go +++ b/utils/hashing/hashing.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package hashing diff --git a/utils/heap/map.go b/utils/heap/map.go index dbe06c06446e..1162e95fd15f 100644 --- a/utils/heap/map.go +++ b/utils/heap/map.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package heap diff --git a/utils/heap/map_test.go b/utils/heap/map_test.go index cc774a5a50df..64e3e4e29132 100644 --- a/utils/heap/map_test.go +++ b/utils/heap/map_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package heap diff --git a/utils/heap/queue.go b/utils/heap/queue.go index fc3bebaa0b8d..62687635f93e 100644 --- a/utils/heap/queue.go +++ b/utils/heap/queue.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package heap diff --git a/utils/heap/queue_test.go b/utils/heap/queue_test.go index e7481eddbbe3..66e3417178bd 100644 --- a/utils/heap/queue_test.go +++ b/utils/heap/queue_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package heap diff --git a/utils/heap/set.go b/utils/heap/set.go index 15fab421b278..e1865f1e64f7 100644 --- a/utils/heap/set.go +++ b/utils/heap/set.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package heap diff --git a/utils/heap/set_test.go b/utils/heap/set_test.go index fd93f996d5ff..d475226118ee 100644 --- a/utils/heap/set_test.go +++ b/utils/heap/set_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package heap diff --git a/utils/ips/claimed_ip_port.go b/utils/ips/claimed_ip_port.go index 4ba4a6085e79..76920f31559d 100644 --- a/utils/ips/claimed_ip_port.go +++ b/utils/ips/claimed_ip_port.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package ips diff --git a/utils/ips/dynamic_ip_port.go b/utils/ips/dynamic_ip_port.go index 3f30dc0a24b5..0b83ab5924f1 100644 --- a/utils/ips/dynamic_ip_port.go +++ b/utils/ips/dynamic_ip_port.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package ips diff --git a/utils/ips/ip_port.go b/utils/ips/ip_port.go index 3ca5bfe176d4..661747cb9cbe 100644 --- a/utils/ips/ip_port.go +++ b/utils/ips/ip_port.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package ips diff --git a/utils/ips/ip_test.go b/utils/ips/ip_test.go index 30a72017e6da..903f26a2d070 100644 --- a/utils/ips/ip_test.go +++ b/utils/ips/ip_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package ips diff --git a/utils/ips/lookup.go b/utils/ips/lookup.go index 8ae3de470ff0..cdf9176f9568 100644 --- a/utils/ips/lookup.go +++ b/utils/ips/lookup.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package ips diff --git a/utils/ips/lookup_test.go b/utils/ips/lookup_test.go index 52c0e5eda860..9fecccc54593 100644 --- a/utils/ips/lookup_test.go +++ b/utils/ips/lookup_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package ips diff --git a/utils/json/codec.go b/utils/json/codec.go index 5871d67fd793..0bf51dcee2c2 100644 --- a/utils/json/codec.go +++ b/utils/json/codec.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package json diff --git a/utils/json/float32.go b/utils/json/float32.go index 26694b090b68..ca35a760e3be 100644 --- a/utils/json/float32.go +++ b/utils/json/float32.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package json diff --git a/utils/json/float32_test.go b/utils/json/float32_test.go index 3d336927ced5..519ca7f4d561 100644 --- a/utils/json/float32_test.go +++ b/utils/json/float32_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package json diff --git a/utils/json/float64.go b/utils/json/float64.go index 8467fbf94745..80fb8ae738da 100644 --- a/utils/json/float64.go +++ b/utils/json/float64.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package json diff --git a/utils/json/uint16.go b/utils/json/uint16.go index ae537ab2c9fb..03e0f133d1a9 100644 --- a/utils/json/uint16.go +++ b/utils/json/uint16.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package json diff --git a/utils/json/uint32.go b/utils/json/uint32.go index c367051b2938..bae5b8857496 100644 --- a/utils/json/uint32.go +++ b/utils/json/uint32.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package json diff --git a/utils/json/uint64.go b/utils/json/uint64.go index c28229024284..60bc99887439 100644 --- a/utils/json/uint64.go +++ b/utils/json/uint64.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package json diff --git a/utils/json/uint8.go b/utils/json/uint8.go index c4a34bdb2074..da2ca5270a83 100644 --- a/utils/json/uint8.go +++ b/utils/json/uint8.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package json diff --git a/utils/linkedhashmap/iterator.go b/utils/linkedhashmap/iterator.go index 306e41e872fd..a2869aac2a54 100644 --- a/utils/linkedhashmap/iterator.go +++ b/utils/linkedhashmap/iterator.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package linkedhashmap diff --git a/utils/linkedhashmap/linkedhashmap.go b/utils/linkedhashmap/linkedhashmap.go index fa5a123a0942..9ae5b83ad7ae 100644 --- a/utils/linkedhashmap/linkedhashmap.go +++ b/utils/linkedhashmap/linkedhashmap.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package linkedhashmap diff --git a/utils/linkedhashmap/linkedhashmap_test.go b/utils/linkedhashmap/linkedhashmap_test.go index 0c95c30b24a8..372bd24baa4c 100644 --- a/utils/linkedhashmap/linkedhashmap_test.go +++ b/utils/linkedhashmap/linkedhashmap_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package linkedhashmap diff --git a/utils/logging/color.go b/utils/logging/color.go index 323d1d1373f5..8fb7a8b6a29d 100644 --- a/utils/logging/color.go +++ b/utils/logging/color.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package logging diff --git a/utils/logging/config.go b/utils/logging/config.go index baeb666d753f..06d7f8ca92c4 100644 --- a/utils/logging/config.go +++ b/utils/logging/config.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package logging diff --git a/utils/logging/factory.go b/utils/logging/factory.go index b3426257956f..e6bb90272282 100644 --- a/utils/logging/factory.go +++ b/utils/logging/factory.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package logging diff --git a/utils/logging/format.go b/utils/logging/format.go index 5ea9de28f087..53313c3dad8f 100644 --- a/utils/logging/format.go +++ b/utils/logging/format.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package logging diff --git a/utils/logging/level.go b/utils/logging/level.go index 173c606c44e2..7c1696b3202f 100644 --- a/utils/logging/level.go +++ b/utils/logging/level.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package logging diff --git a/utils/logging/log.go b/utils/logging/log.go index a5e6c9d79a05..b9fc8f796ce7 100644 --- a/utils/logging/log.go +++ b/utils/logging/log.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package logging diff --git a/utils/logging/log_test.go b/utils/logging/log_test.go index c968747ba726..cd7396b6ac6a 100644 --- a/utils/logging/log_test.go +++ b/utils/logging/log_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package logging diff --git a/utils/logging/logger.go b/utils/logging/logger.go index 50d035e02fa8..2ca95bff104c 100644 --- a/utils/logging/logger.go +++ b/utils/logging/logger.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package logging diff --git a/utils/logging/sanitize.go b/utils/logging/sanitize.go index c4fdf7124fdd..18fc4021d965 100644 --- a/utils/logging/sanitize.go +++ b/utils/logging/sanitize.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package logging diff --git a/utils/logging/test_log.go b/utils/logging/test_log.go index 7df7df276a15..a8a85dc78e07 100644 --- a/utils/logging/test_log.go +++ b/utils/logging/test_log.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package logging diff --git a/utils/math/averager.go b/utils/math/averager.go index 14147d7ef54f..8573fbc80bb7 100644 --- a/utils/math/averager.go +++ b/utils/math/averager.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package math diff --git a/utils/math/averager_heap.go b/utils/math/averager_heap.go index 070593f0eeb8..57d046786a99 100644 --- a/utils/math/averager_heap.go +++ b/utils/math/averager_heap.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package math diff --git a/utils/math/averager_heap_test.go b/utils/math/averager_heap_test.go index 0586eb77947e..94f160a3a388 100644 --- a/utils/math/averager_heap_test.go +++ b/utils/math/averager_heap_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package math diff --git a/utils/math/continuous_averager.go b/utils/math/continuous_averager.go index e60832f23a58..7bc892576b9f 100644 --- a/utils/math/continuous_averager.go +++ b/utils/math/continuous_averager.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package math diff --git a/utils/math/continuous_averager_benchmark_test.go b/utils/math/continuous_averager_benchmark_test.go index 7a8d30a3736c..3ebee526997d 100644 --- a/utils/math/continuous_averager_benchmark_test.go +++ b/utils/math/continuous_averager_benchmark_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package math diff --git a/utils/math/continuous_averager_test.go b/utils/math/continuous_averager_test.go index 16f0f6913b90..c169f3903066 100644 --- a/utils/math/continuous_averager_test.go +++ b/utils/math/continuous_averager_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package math diff --git a/utils/math/meter/continuous_meter.go b/utils/math/meter/continuous_meter.go index 4bd3f000524e..378248a15027 100644 --- a/utils/math/meter/continuous_meter.go +++ b/utils/math/meter/continuous_meter.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package meter diff --git a/utils/math/meter/factory.go b/utils/math/meter/factory.go index 3fe1c3bb04b4..a4d3722e8f3c 100644 --- a/utils/math/meter/factory.go +++ b/utils/math/meter/factory.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package meter diff --git a/utils/math/meter/meter.go b/utils/math/meter/meter.go index 07c03e37017a..e9ec6782b8c6 100644 --- a/utils/math/meter/meter.go +++ b/utils/math/meter/meter.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package meter diff --git a/utils/math/meter/meter_benchmark_test.go b/utils/math/meter/meter_benchmark_test.go index 65f3dcfa56e0..80ed1ad9573c 100644 --- a/utils/math/meter/meter_benchmark_test.go +++ b/utils/math/meter/meter_benchmark_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package meter diff --git a/utils/math/meter/meter_test.go b/utils/math/meter/meter_test.go index 9bffb77d9d1e..cbe1bd806b61 100644 --- a/utils/math/meter/meter_test.go +++ b/utils/math/meter/meter_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package meter diff --git a/utils/math/safe_math.go b/utils/math/safe_math.go index 834547589806..8397327414a7 100644 --- a/utils/math/safe_math.go +++ b/utils/math/safe_math.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package math diff --git a/utils/math/safe_math_test.go b/utils/math/safe_math_test.go index b4ef771eb45e..fc89d2f7f639 100644 --- a/utils/math/safe_math_test.go +++ b/utils/math/safe_math_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package math diff --git a/utils/math/sync_averager.go b/utils/math/sync_averager.go index cbe8ba107f7a..92210ab4ca46 100644 --- a/utils/math/sync_averager.go +++ b/utils/math/sync_averager.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package math diff --git a/utils/maybe/maybe.go b/utils/maybe/maybe.go index b4dfc7f9a452..fd50b41534c7 100644 --- a/utils/maybe/maybe.go +++ b/utils/maybe/maybe.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package maybe diff --git a/utils/maybe/maybe_test.go b/utils/maybe/maybe_test.go index 60b599000d0a..93d5fc32e85a 100644 --- a/utils/maybe/maybe_test.go +++ b/utils/maybe/maybe_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package maybe diff --git a/utils/metric/api_interceptor.go b/utils/metric/api_interceptor.go index ab8e4fd8d70c..67ae1a936742 100644 --- a/utils/metric/api_interceptor.go +++ b/utils/metric/api_interceptor.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package metric diff --git a/utils/metric/averager.go b/utils/metric/averager.go index da7f0aa5bd48..0f461a567ee7 100644 --- a/utils/metric/averager.go +++ b/utils/metric/averager.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package metric diff --git a/utils/password/hash.go b/utils/password/hash.go index 19c6f731f414..fc304bd50118 100644 --- a/utils/password/hash.go +++ b/utils/password/hash.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package password diff --git a/utils/password/hash_test.go b/utils/password/hash_test.go index c2d87a9744c4..07f56d0304f3 100644 --- a/utils/password/hash_test.go +++ b/utils/password/hash_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package password diff --git a/utils/password/password.go b/utils/password/password.go index 1efe3ac8a4f9..fa4d240eed2e 100644 --- a/utils/password/password.go +++ b/utils/password/password.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package password diff --git a/utils/password/password_test.go b/utils/password/password_test.go index 0b445fbf8545..2c4f534c857a 100644 --- a/utils/password/password_test.go +++ b/utils/password/password_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package password diff --git a/utils/perms/chmod.go b/utils/perms/chmod.go index 5b4ff4a3b02c..a5a8710b97b8 100644 --- a/utils/perms/chmod.go +++ b/utils/perms/chmod.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package perms diff --git a/utils/perms/create.go b/utils/perms/create.go index 8d91baea0683..123637e13443 100644 --- a/utils/perms/create.go +++ b/utils/perms/create.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package perms diff --git a/utils/perms/perms.go b/utils/perms/perms.go index e89dcc949984..0bb633d900f7 100644 --- a/utils/perms/perms.go +++ b/utils/perms/perms.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package perms diff --git a/utils/perms/write_file.go b/utils/perms/write_file.go index 4671c8bc66fe..f716459ab678 100644 --- a/utils/perms/write_file.go +++ b/utils/perms/write_file.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package perms diff --git a/utils/profiler/continuous.go b/utils/profiler/continuous.go index c662f172c33d..1f698395fd25 100644 --- a/utils/profiler/continuous.go +++ b/utils/profiler/continuous.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package profiler diff --git a/utils/profiler/profiler.go b/utils/profiler/profiler.go index a792b2bbf63f..00a540cc9766 100644 --- a/utils/profiler/profiler.go +++ b/utils/profiler/profiler.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package profiler diff --git a/utils/profiler/profiler_test.go b/utils/profiler/profiler_test.go index 2d7d864aca62..17ae695e38c2 100644 --- a/utils/profiler/profiler_test.go +++ b/utils/profiler/profiler_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package profiler diff --git a/utils/resource/metrics.go b/utils/resource/metrics.go index e20458c42fb1..3ce87ade258c 100644 --- a/utils/resource/metrics.go +++ b/utils/resource/metrics.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package resource diff --git a/utils/resource/no_usage.go b/utils/resource/no_usage.go index 8a10d11ced2a..baa42437fc11 100644 --- a/utils/resource/no_usage.go +++ b/utils/resource/no_usage.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package resource diff --git a/utils/resource/usage.go b/utils/resource/usage.go index d5a06d990c85..1eedbee04c14 100644 --- a/utils/resource/usage.go +++ b/utils/resource/usage.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package resource diff --git a/utils/resource/usage_test.go b/utils/resource/usage_test.go index 5c1df7814f6a..b0ee74ec07a1 100644 --- a/utils/resource/usage_test.go +++ b/utils/resource/usage_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package resource diff --git a/utils/rpc/json.go b/utils/rpc/json.go index 72ddb3aac8a7..9b87661ea529 100644 --- a/utils/rpc/json.go +++ b/utils/rpc/json.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package rpc diff --git a/utils/rpc/options.go b/utils/rpc/options.go index ce79bc25920e..79c32c72b152 100644 --- a/utils/rpc/options.go +++ b/utils/rpc/options.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package rpc diff --git a/utils/rpc/requester.go b/utils/rpc/requester.go index 49f3ffa0ef6d..6f2e312f66da 100644 --- a/utils/rpc/requester.go +++ b/utils/rpc/requester.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package rpc diff --git a/utils/sampler/rand.go b/utils/sampler/rand.go index 0dc347dad659..ce62d4a90ffc 100644 --- a/utils/sampler/rand.go +++ b/utils/sampler/rand.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sampler diff --git a/utils/sampler/rand_test.go b/utils/sampler/rand_test.go index e822d5876cbf..febffa60a4ec 100644 --- a/utils/sampler/rand_test.go +++ b/utils/sampler/rand_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sampler diff --git a/utils/sampler/uniform.go b/utils/sampler/uniform.go index e673aefa2616..5ae9a21d8822 100644 --- a/utils/sampler/uniform.go +++ b/utils/sampler/uniform.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sampler diff --git a/utils/sampler/uniform_benchmark_test.go b/utils/sampler/uniform_benchmark_test.go index 51d180b33db9..915fe45cc749 100644 --- a/utils/sampler/uniform_benchmark_test.go +++ b/utils/sampler/uniform_benchmark_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sampler diff --git a/utils/sampler/uniform_best.go b/utils/sampler/uniform_best.go index 69f78bd24ce8..21f7870d5bdc 100644 --- a/utils/sampler/uniform_best.go +++ b/utils/sampler/uniform_best.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sampler diff --git a/utils/sampler/uniform_replacer.go b/utils/sampler/uniform_replacer.go index 2053c22e875a..98d3e5acbe0d 100644 --- a/utils/sampler/uniform_replacer.go +++ b/utils/sampler/uniform_replacer.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sampler diff --git a/utils/sampler/uniform_resample.go b/utils/sampler/uniform_resample.go index b2ddbdeb09df..1e48d51fa421 100644 --- a/utils/sampler/uniform_resample.go +++ b/utils/sampler/uniform_resample.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sampler diff --git a/utils/sampler/uniform_test.go b/utils/sampler/uniform_test.go index 96aabb73be57..451a26625424 100644 --- a/utils/sampler/uniform_test.go +++ b/utils/sampler/uniform_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sampler diff --git a/utils/sampler/weighted.go b/utils/sampler/weighted.go index 69212d4351c2..2296da08e97a 100644 --- a/utils/sampler/weighted.go +++ b/utils/sampler/weighted.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sampler diff --git a/utils/sampler/weighted_array.go b/utils/sampler/weighted_array.go index b2dcb593b79b..e13788422b85 100644 --- a/utils/sampler/weighted_array.go +++ b/utils/sampler/weighted_array.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sampler diff --git a/utils/sampler/weighted_array_test.go b/utils/sampler/weighted_array_test.go index 0f44869b7dee..866a0c7d2f2c 100644 --- a/utils/sampler/weighted_array_test.go +++ b/utils/sampler/weighted_array_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sampler diff --git a/utils/sampler/weighted_benchmark_test.go b/utils/sampler/weighted_benchmark_test.go index 22c1a5f7def7..897e001935a1 100644 --- a/utils/sampler/weighted_benchmark_test.go +++ b/utils/sampler/weighted_benchmark_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sampler diff --git a/utils/sampler/weighted_best.go b/utils/sampler/weighted_best.go index 276a9b475a9d..59bf60019144 100644 --- a/utils/sampler/weighted_best.go +++ b/utils/sampler/weighted_best.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sampler diff --git a/utils/sampler/weighted_heap.go b/utils/sampler/weighted_heap.go index ef5a8feb6e9f..866c23893fc2 100644 --- a/utils/sampler/weighted_heap.go +++ b/utils/sampler/weighted_heap.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sampler diff --git a/utils/sampler/weighted_heap_test.go b/utils/sampler/weighted_heap_test.go index eb9ff46ab276..03aa94dfa2f9 100644 --- a/utils/sampler/weighted_heap_test.go +++ b/utils/sampler/weighted_heap_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sampler diff --git a/utils/sampler/weighted_linear.go b/utils/sampler/weighted_linear.go index 268ba9ea2652..496613aea6dc 100644 --- a/utils/sampler/weighted_linear.go +++ b/utils/sampler/weighted_linear.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sampler diff --git a/utils/sampler/weighted_linear_test.go b/utils/sampler/weighted_linear_test.go index 6757158ed8e6..dd86679de627 100644 --- a/utils/sampler/weighted_linear_test.go +++ b/utils/sampler/weighted_linear_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sampler diff --git a/utils/sampler/weighted_test.go b/utils/sampler/weighted_test.go index d67d86251c69..ea08230d175a 100644 --- a/utils/sampler/weighted_test.go +++ b/utils/sampler/weighted_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sampler diff --git a/utils/sampler/weighted_uniform.go b/utils/sampler/weighted_uniform.go index bff76ead34e4..22dbb6b5ebd5 100644 --- a/utils/sampler/weighted_uniform.go +++ b/utils/sampler/weighted_uniform.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sampler diff --git a/utils/sampler/weighted_without_replacement.go b/utils/sampler/weighted_without_replacement.go index 2f592a783bc0..a6b619928742 100644 --- a/utils/sampler/weighted_without_replacement.go +++ b/utils/sampler/weighted_without_replacement.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sampler diff --git a/utils/sampler/weighted_without_replacement_benchmark_test.go b/utils/sampler/weighted_without_replacement_benchmark_test.go index 03459a5e757b..58becf9d2311 100644 --- a/utils/sampler/weighted_without_replacement_benchmark_test.go +++ b/utils/sampler/weighted_without_replacement_benchmark_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sampler diff --git a/utils/sampler/weighted_without_replacement_generic.go b/utils/sampler/weighted_without_replacement_generic.go index a62185146f4c..c45d64d0b2b0 100644 --- a/utils/sampler/weighted_without_replacement_generic.go +++ b/utils/sampler/weighted_without_replacement_generic.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sampler diff --git a/utils/sampler/weighted_without_replacement_test.go b/utils/sampler/weighted_without_replacement_test.go index 79a26075605d..48952d5cac14 100644 --- a/utils/sampler/weighted_without_replacement_test.go +++ b/utils/sampler/weighted_without_replacement_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sampler diff --git a/utils/set/bits.go b/utils/set/bits.go index 344c8dff6781..a6e74fb6c18e 100644 --- a/utils/set/bits.go +++ b/utils/set/bits.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package set diff --git a/utils/set/bits_64.go b/utils/set/bits_64.go index eed00afdedc6..d67c405ac922 100644 --- a/utils/set/bits_64.go +++ b/utils/set/bits_64.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package set diff --git a/utils/set/bits_64_test.go b/utils/set/bits_64_test.go index 87374b4f297a..b31bf9979730 100644 --- a/utils/set/bits_64_test.go +++ b/utils/set/bits_64_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package set diff --git a/utils/set/bits_test.go b/utils/set/bits_test.go index 5541395a5aa4..12efb343acd6 100644 --- a/utils/set/bits_test.go +++ b/utils/set/bits_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package set diff --git a/utils/set/sampleable_set.go b/utils/set/sampleable_set.go index 8c4c02461bd9..becd228fac43 100644 --- a/utils/set/sampleable_set.go +++ b/utils/set/sampleable_set.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package set diff --git a/utils/set/sampleable_set_test.go b/utils/set/sampleable_set_test.go index 5f19c13db9fe..31bd07712db5 100644 --- a/utils/set/sampleable_set_test.go +++ b/utils/set/sampleable_set_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package set diff --git a/utils/set/set.go b/utils/set/set.go index 41d8bb712f10..84cb5d46cd95 100644 --- a/utils/set/set.go +++ b/utils/set/set.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package set diff --git a/utils/set/set_benchmark_test.go b/utils/set/set_benchmark_test.go index c762b72cba01..300b8c8c0a71 100644 --- a/utils/set/set_benchmark_test.go +++ b/utils/set/set_benchmark_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package set diff --git a/utils/set/set_test.go b/utils/set/set_test.go index 4e0a3d1fa3ed..3b0a7e1822f8 100644 --- a/utils/set/set_test.go +++ b/utils/set/set_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package set diff --git a/utils/setmap/setmap.go b/utils/setmap/setmap.go index b5d694a967c6..a2924894dac5 100644 --- a/utils/setmap/setmap.go +++ b/utils/setmap/setmap.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package setmap diff --git a/utils/setmap/setmap_test.go b/utils/setmap/setmap_test.go index 7d140f5c69e2..f3e70985451f 100644 --- a/utils/setmap/setmap_test.go +++ b/utils/setmap/setmap_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package setmap diff --git a/utils/sorting.go b/utils/sorting.go index cbb982a7f63b..070375811ee3 100644 --- a/utils/sorting.go +++ b/utils/sorting.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package utils diff --git a/utils/sorting_test.go b/utils/sorting_test.go index 019834907686..632629368518 100644 --- a/utils/sorting_test.go +++ b/utils/sorting_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package utils diff --git a/utils/stacktrace.go b/utils/stacktrace.go index d68ee4ea69cf..d0e0de56dc9d 100644 --- a/utils/stacktrace.go +++ b/utils/stacktrace.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package utils diff --git a/utils/storage/storage_common.go b/utils/storage/storage_common.go index cf1fbd3b895f..6fa5692cb86a 100644 --- a/utils/storage/storage_common.go +++ b/utils/storage/storage_common.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package storage diff --git a/utils/storage/storage_unix.go b/utils/storage/storage_unix.go index ae75ed4e833f..247bc2448f36 100644 --- a/utils/storage/storage_unix.go +++ b/utils/storage/storage_unix.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. //go:build !windows diff --git a/utils/storage/storage_windows.go b/utils/storage/storage_windows.go index e9242e2d2f1e..2514717c8bea 100644 --- a/utils/storage/storage_windows.go +++ b/utils/storage/storage_windows.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. //go:build windows diff --git a/utils/timer/adaptive_timeout_manager.go b/utils/timer/adaptive_timeout_manager.go index a6d00654c064..493769018ba2 100644 --- a/utils/timer/adaptive_timeout_manager.go +++ b/utils/timer/adaptive_timeout_manager.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package timer diff --git a/utils/timer/adaptive_timeout_manager_test.go b/utils/timer/adaptive_timeout_manager_test.go index ec9964bd5a7f..40b4186011f4 100644 --- a/utils/timer/adaptive_timeout_manager_test.go +++ b/utils/timer/adaptive_timeout_manager_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package timer diff --git a/utils/timer/eta.go b/utils/timer/eta.go index 490574864087..6af353fd1883 100644 --- a/utils/timer/eta.go +++ b/utils/timer/eta.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package timer diff --git a/utils/timer/meter.go b/utils/timer/meter.go index c78376e1c62f..e0459e92ee2f 100644 --- a/utils/timer/meter.go +++ b/utils/timer/meter.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package timer diff --git a/utils/timer/mockable/clock.go b/utils/timer/mockable/clock.go index 23857a22efac..753da957ec97 100644 --- a/utils/timer/mockable/clock.go +++ b/utils/timer/mockable/clock.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package mockable diff --git a/utils/timer/mockable/clock_test.go b/utils/timer/mockable/clock_test.go index eee8922e9e58..a15e71efdcfb 100644 --- a/utils/timer/mockable/clock_test.go +++ b/utils/timer/mockable/clock_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package mockable diff --git a/utils/timer/timer.go b/utils/timer/timer.go index 1b5914fefc76..b4d3453477d9 100644 --- a/utils/timer/timer.go +++ b/utils/timer/timer.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package timer diff --git a/utils/timer/timer_test.go b/utils/timer/timer_test.go index 228b19f28d32..83994f963bf3 100644 --- a/utils/timer/timer_test.go +++ b/utils/timer/timer_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package timer diff --git a/utils/ulimit/ulimit_bsd.go b/utils/ulimit/ulimit_bsd.go index 58204fd62a19..bb4c5e150e6c 100644 --- a/utils/ulimit/ulimit_bsd.go +++ b/utils/ulimit/ulimit_bsd.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. //go:build freebsd diff --git a/utils/ulimit/ulimit_darwin.go b/utils/ulimit/ulimit_darwin.go index 9eaab72bd0f6..224d8faf056e 100644 --- a/utils/ulimit/ulimit_darwin.go +++ b/utils/ulimit/ulimit_darwin.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. //go:build darwin diff --git a/utils/ulimit/ulimit_unix.go b/utils/ulimit/ulimit_unix.go index 898b361cef92..8b23ab701b53 100644 --- a/utils/ulimit/ulimit_unix.go +++ b/utils/ulimit/ulimit_unix.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. //go:build linux || netbsd || openbsd diff --git a/utils/ulimit/ulimit_windows.go b/utils/ulimit/ulimit_windows.go index 7646d6f10d1f..82a88273735b 100644 --- a/utils/ulimit/ulimit_windows.go +++ b/utils/ulimit/ulimit_windows.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. //go:build windows diff --git a/utils/units/avax.go b/utils/units/avax.go index 341fd8bea8ad..bbd664928b33 100644 --- a/utils/units/avax.go +++ b/utils/units/avax.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package units diff --git a/utils/units/bytes.go b/utils/units/bytes.go index 93678e957a46..42d2526ae257 100644 --- a/utils/units/bytes.go +++ b/utils/units/bytes.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package units diff --git a/utils/window/window.go b/utils/window/window.go index 245941467983..86dba5b717df 100644 --- a/utils/window/window.go +++ b/utils/window/window.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package window diff --git a/utils/window/window_test.go b/utils/window/window_test.go index d8cf20f870bb..332d20b3b329 100644 --- a/utils/window/window_test.go +++ b/utils/window/window_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package window diff --git a/utils/wrappers/closers.go b/utils/wrappers/closers.go index d366e928cba0..b16e4baa2831 100644 --- a/utils/wrappers/closers.go +++ b/utils/wrappers/closers.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package wrappers diff --git a/utils/wrappers/errors.go b/utils/wrappers/errors.go index 641734da16c0..d887ffb4d20a 100644 --- a/utils/wrappers/errors.go +++ b/utils/wrappers/errors.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package wrappers diff --git a/utils/wrappers/packing.go b/utils/wrappers/packing.go index 891f80e49ab2..96d6b9999c0c 100644 --- a/utils/wrappers/packing.go +++ b/utils/wrappers/packing.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package wrappers diff --git a/utils/wrappers/packing_test.go b/utils/wrappers/packing_test.go index 2372e1ed3cfb..bb3e7fe61d38 100644 --- a/utils/wrappers/packing_test.go +++ b/utils/wrappers/packing_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package wrappers diff --git a/utils/zero.go b/utils/zero.go index 9a9173cf3403..c691ed2e653c 100644 --- a/utils/zero.go +++ b/utils/zero.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package utils diff --git a/version/application.go b/version/application.go index a4956dfd78d6..2be9d838a89e 100644 --- a/version/application.go +++ b/version/application.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package version diff --git a/version/application_test.go b/version/application_test.go index 09d049edcb77..deade1816e22 100644 --- a/version/application_test.go +++ b/version/application_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package version diff --git a/version/compatibility.go b/version/compatibility.go index 6c3cae20778e..1cde189954a8 100644 --- a/version/compatibility.go +++ b/version/compatibility.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package version diff --git a/version/compatibility_test.go b/version/compatibility_test.go index 1e4cbd03315f..09d3cdcb3336 100644 --- a/version/compatibility_test.go +++ b/version/compatibility_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package version diff --git a/version/constants.go b/version/constants.go index 069868162094..053a57a4585b 100644 --- a/version/constants.go +++ b/version/constants.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package version diff --git a/version/constants_test.go b/version/constants_test.go index 5e409dd91767..aea7ef493510 100644 --- a/version/constants_test.go +++ b/version/constants_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package version diff --git a/version/parser.go b/version/parser.go index be4bd1a54930..abc150450099 100644 --- a/version/parser.go +++ b/version/parser.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package version diff --git a/version/parser_test.go b/version/parser_test.go index 9a1175ea11b8..42adb764c9c2 100644 --- a/version/parser_test.go +++ b/version/parser_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package version diff --git a/version/string.go b/version/string.go index 8d83a51d4d05..9abe555bcebb 100644 --- a/version/string.go +++ b/version/string.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package version diff --git a/version/version.go b/version/version.go index 59fb9b937883..b8fe119b370c 100644 --- a/version/version.go +++ b/version/version.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package version diff --git a/version/version_test.go b/version/version_test.go index d66c1212958c..69c494c88650 100644 --- a/version/version_test.go +++ b/version/version_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package version diff --git a/vms/avm/block/block.go b/vms/avm/block/block.go index 331c310274e1..376062c0387e 100644 --- a/vms/avm/block/block.go +++ b/vms/avm/block/block.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/vms/avm/block/block_test.go b/vms/avm/block/block_test.go index 568eef5f5851..db2e3b074b59 100644 --- a/vms/avm/block/block_test.go +++ b/vms/avm/block/block_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/vms/avm/block/builder/builder.go b/vms/avm/block/builder/builder.go index 29131f3251e7..80e734812a6c 100644 --- a/vms/avm/block/builder/builder.go +++ b/vms/avm/block/builder/builder.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package builder diff --git a/vms/avm/block/builder/builder_test.go b/vms/avm/block/builder/builder_test.go index e034db41cf91..5ff59b8d66f8 100644 --- a/vms/avm/block/builder/builder_test.go +++ b/vms/avm/block/builder/builder_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package builder diff --git a/vms/avm/block/executor/block.go b/vms/avm/block/executor/block.go index ebad27c2b67f..8663f27ba123 100644 --- a/vms/avm/block/executor/block.go +++ b/vms/avm/block/executor/block.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/avm/block/executor/block_test.go b/vms/avm/block/executor/block_test.go index d014b3ef499d..0b6738822c6e 100644 --- a/vms/avm/block/executor/block_test.go +++ b/vms/avm/block/executor/block_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/avm/block/executor/manager.go b/vms/avm/block/executor/manager.go index 9ffcb36c9a61..9822743b7fd3 100644 --- a/vms/avm/block/executor/manager.go +++ b/vms/avm/block/executor/manager.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/avm/block/executor/manager_test.go b/vms/avm/block/executor/manager_test.go index 542cf386afee..012428d582e4 100644 --- a/vms/avm/block/executor/manager_test.go +++ b/vms/avm/block/executor/manager_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/avm/block/parser.go b/vms/avm/block/parser.go index 2394ea8dec0a..bfae841093d1 100644 --- a/vms/avm/block/parser.go +++ b/vms/avm/block/parser.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/vms/avm/block/standard_block.go b/vms/avm/block/standard_block.go index 98c676c7ea52..614c7bdc332c 100644 --- a/vms/avm/block/standard_block.go +++ b/vms/avm/block/standard_block.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/vms/avm/client.go b/vms/avm/client.go index 8f9ea084c237..63df6543446e 100644 --- a/vms/avm/client.go +++ b/vms/avm/client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avm diff --git a/vms/avm/client_test.go b/vms/avm/client_test.go index e8013b15d115..28a2d874128a 100644 --- a/vms/avm/client_test.go +++ b/vms/avm/client_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avm diff --git a/vms/avm/config.go b/vms/avm/config.go index 75f0194b15a2..f7661bbefd18 100644 --- a/vms/avm/config.go +++ b/vms/avm/config.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avm diff --git a/vms/avm/config/config.go b/vms/avm/config/config.go index 045b4474ca67..08f6ab04240a 100644 --- a/vms/avm/config/config.go +++ b/vms/avm/config/config.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package config diff --git a/vms/avm/config_test.go b/vms/avm/config_test.go index e11115028fd6..27481d78b901 100644 --- a/vms/avm/config_test.go +++ b/vms/avm/config_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avm diff --git a/vms/avm/environment_test.go b/vms/avm/environment_test.go index 7811807521e0..d572298dc5e5 100644 --- a/vms/avm/environment_test.go +++ b/vms/avm/environment_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avm diff --git a/vms/avm/factory.go b/vms/avm/factory.go index 1e2c6f68a10f..ee71cac0346f 100644 --- a/vms/avm/factory.go +++ b/vms/avm/factory.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avm diff --git a/vms/avm/fx_test.go b/vms/avm/fx_test.go index ee0cdbfd8157..7cea92cf3194 100644 --- a/vms/avm/fx_test.go +++ b/vms/avm/fx_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avm diff --git a/vms/avm/fxs/fx.go b/vms/avm/fxs/fx.go index 512a3bf0da31..2749ee4500a3 100644 --- a/vms/avm/fxs/fx.go +++ b/vms/avm/fxs/fx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package fxs diff --git a/vms/avm/genesis.go b/vms/avm/genesis.go index 20ed5c6ba474..b2d6e7409152 100644 --- a/vms/avm/genesis.go +++ b/vms/avm/genesis.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avm diff --git a/vms/avm/genesis_test.go b/vms/avm/genesis_test.go index 8c26e2a13dae..2e5da96fc63e 100644 --- a/vms/avm/genesis_test.go +++ b/vms/avm/genesis_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avm diff --git a/vms/avm/health.go b/vms/avm/health.go index 725418b1ec8f..6cb2e14b0776 100644 --- a/vms/avm/health.go +++ b/vms/avm/health.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avm diff --git a/vms/avm/index_test.go b/vms/avm/index_test.go index 3a70b4a62948..03a2fd863c6a 100644 --- a/vms/avm/index_test.go +++ b/vms/avm/index_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avm diff --git a/vms/avm/metrics/metrics.go b/vms/avm/metrics/metrics.go index 59c4e159a901..9e4053e1fcc6 100644 --- a/vms/avm/metrics/metrics.go +++ b/vms/avm/metrics/metrics.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package metrics diff --git a/vms/avm/metrics/tx_metrics.go b/vms/avm/metrics/tx_metrics.go index 217eeb18a346..3ae3e8cdea85 100644 --- a/vms/avm/metrics/tx_metrics.go +++ b/vms/avm/metrics/tx_metrics.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package metrics diff --git a/vms/avm/network/atomic.go b/vms/avm/network/atomic.go index aaa1c5822235..0774ed36603e 100644 --- a/vms/avm/network/atomic.go +++ b/vms/avm/network/atomic.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package network diff --git a/vms/avm/network/config.go b/vms/avm/network/config.go index 2ff7828df2e4..8f54a20baf8a 100644 --- a/vms/avm/network/config.go +++ b/vms/avm/network/config.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package network diff --git a/vms/avm/network/gossip.go b/vms/avm/network/gossip.go index ad5d1589d25d..ef3b53d039ec 100644 --- a/vms/avm/network/gossip.go +++ b/vms/avm/network/gossip.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package network diff --git a/vms/avm/network/gossip_test.go b/vms/avm/network/gossip_test.go index a3922a23d812..725851e54606 100644 --- a/vms/avm/network/gossip_test.go +++ b/vms/avm/network/gossip_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package network diff --git a/vms/avm/network/network.go b/vms/avm/network/network.go index 9057ba1df346..d2920bc51af4 100644 --- a/vms/avm/network/network.go +++ b/vms/avm/network/network.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package network diff --git a/vms/avm/network/network_test.go b/vms/avm/network/network_test.go index 4250a82b8bcb..b2df09eec1b2 100644 --- a/vms/avm/network/network_test.go +++ b/vms/avm/network/network_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package network diff --git a/vms/avm/network/tx_verifier.go b/vms/avm/network/tx_verifier.go index fe76f0c45366..09f869283448 100644 --- a/vms/avm/network/tx_verifier.go +++ b/vms/avm/network/tx_verifier.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package network diff --git a/vms/avm/pubsub_filterer.go b/vms/avm/pubsub_filterer.go index 242970347901..caf0ba348393 100644 --- a/vms/avm/pubsub_filterer.go +++ b/vms/avm/pubsub_filterer.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avm diff --git a/vms/avm/pubsub_filterer_test.go b/vms/avm/pubsub_filterer_test.go index 95f4fc3cd229..0059b2218e39 100644 --- a/vms/avm/pubsub_filterer_test.go +++ b/vms/avm/pubsub_filterer_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avm diff --git a/vms/avm/service.go b/vms/avm/service.go index 7ccc26c278ed..85545546b014 100644 --- a/vms/avm/service.go +++ b/vms/avm/service.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avm diff --git a/vms/avm/service_test.go b/vms/avm/service_test.go index 6984d1640a53..c659b8e9de9e 100644 --- a/vms/avm/service_test.go +++ b/vms/avm/service_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avm diff --git a/vms/avm/state/diff.go b/vms/avm/state/diff.go index 1f1a98d38a96..83e9c5e0d590 100644 --- a/vms/avm/state/diff.go +++ b/vms/avm/state/diff.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/avm/state/state.go b/vms/avm/state/state.go index e290f093aa22..e85907d77a50 100644 --- a/vms/avm/state/state.go +++ b/vms/avm/state/state.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/avm/state/state_test.go b/vms/avm/state/state_test.go index a9d468d436bb..e0b3c8e1794b 100644 --- a/vms/avm/state/state_test.go +++ b/vms/avm/state/state_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/avm/state/versions.go b/vms/avm/state/versions.go index da84182bb683..6afb0fe8e5f2 100644 --- a/vms/avm/state/versions.go +++ b/vms/avm/state/versions.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/avm/state_test.go b/vms/avm/state_test.go index 2c0d61559925..b17604b2ba62 100644 --- a/vms/avm/state_test.go +++ b/vms/avm/state_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avm diff --git a/vms/avm/static_client.go b/vms/avm/static_client.go index 78014785cba9..f31634313aac 100644 --- a/vms/avm/static_client.go +++ b/vms/avm/static_client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avm diff --git a/vms/avm/static_service.go b/vms/avm/static_service.go index 275546061354..3599a3faa2de 100644 --- a/vms/avm/static_service.go +++ b/vms/avm/static_service.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avm diff --git a/vms/avm/static_service_test.go b/vms/avm/static_service_test.go index a18220e5de37..d5bd645190a2 100644 --- a/vms/avm/static_service_test.go +++ b/vms/avm/static_service_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avm diff --git a/vms/avm/tx.go b/vms/avm/tx.go index 57afe6864d8e..13064a59a18f 100644 --- a/vms/avm/tx.go +++ b/vms/avm/tx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avm diff --git a/vms/avm/tx_init.go b/vms/avm/tx_init.go index 1a7d29ebeb40..00112bf6dd45 100644 --- a/vms/avm/tx_init.go +++ b/vms/avm/tx_init.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avm diff --git a/vms/avm/txs/base_tx.go b/vms/avm/txs/base_tx.go index 617769d343d8..5cc0d222dce3 100644 --- a/vms/avm/txs/base_tx.go +++ b/vms/avm/txs/base_tx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/avm/txs/base_tx_test.go b/vms/avm/txs/base_tx_test.go index ed1665c707fb..4dcb82e38ce7 100644 --- a/vms/avm/txs/base_tx_test.go +++ b/vms/avm/txs/base_tx_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/avm/txs/codec.go b/vms/avm/txs/codec.go index 777e4562a509..2a83f7497ae0 100644 --- a/vms/avm/txs/codec.go +++ b/vms/avm/txs/codec.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/avm/txs/create_asset_tx.go b/vms/avm/txs/create_asset_tx.go index 4a80d018e428..818bea5b9259 100644 --- a/vms/avm/txs/create_asset_tx.go +++ b/vms/avm/txs/create_asset_tx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/avm/txs/create_asset_tx_test.go b/vms/avm/txs/create_asset_tx_test.go index dfcfb27c1bdd..f71ca13b4de1 100644 --- a/vms/avm/txs/create_asset_tx_test.go +++ b/vms/avm/txs/create_asset_tx_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/avm/txs/executor/backend.go b/vms/avm/txs/executor/backend.go index fbf4a756faec..fdb020423bdb 100644 --- a/vms/avm/txs/executor/backend.go +++ b/vms/avm/txs/executor/backend.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/avm/txs/executor/executor.go b/vms/avm/txs/executor/executor.go index 6a5991cade04..2e7db5659dae 100644 --- a/vms/avm/txs/executor/executor.go +++ b/vms/avm/txs/executor/executor.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/avm/txs/executor/executor_test.go b/vms/avm/txs/executor/executor_test.go index 81d301ad6bae..ba5f13e836ef 100644 --- a/vms/avm/txs/executor/executor_test.go +++ b/vms/avm/txs/executor/executor_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/avm/txs/executor/semantic_verifier.go b/vms/avm/txs/executor/semantic_verifier.go index 1fd94fb0e131..946346bc0646 100644 --- a/vms/avm/txs/executor/semantic_verifier.go +++ b/vms/avm/txs/executor/semantic_verifier.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/avm/txs/executor/semantic_verifier_test.go b/vms/avm/txs/executor/semantic_verifier_test.go index bda0f9245631..4678d0548fb2 100644 --- a/vms/avm/txs/executor/semantic_verifier_test.go +++ b/vms/avm/txs/executor/semantic_verifier_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/avm/txs/executor/syntactic_verifier.go b/vms/avm/txs/executor/syntactic_verifier.go index 7419b5738215..81a2f2a715f4 100644 --- a/vms/avm/txs/executor/syntactic_verifier.go +++ b/vms/avm/txs/executor/syntactic_verifier.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/avm/txs/executor/syntactic_verifier_test.go b/vms/avm/txs/executor/syntactic_verifier_test.go index ad5e906a029e..21f2396148a0 100644 --- a/vms/avm/txs/executor/syntactic_verifier_test.go +++ b/vms/avm/txs/executor/syntactic_verifier_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/avm/txs/export_tx.go b/vms/avm/txs/export_tx.go index aec13141497d..e0be45360693 100644 --- a/vms/avm/txs/export_tx.go +++ b/vms/avm/txs/export_tx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/avm/txs/export_tx_test.go b/vms/avm/txs/export_tx_test.go index e384b8bfc327..b56ae7003e5b 100644 --- a/vms/avm/txs/export_tx_test.go +++ b/vms/avm/txs/export_tx_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/avm/txs/import_tx.go b/vms/avm/txs/import_tx.go index c3066ccc5c40..5ef8929fc641 100644 --- a/vms/avm/txs/import_tx.go +++ b/vms/avm/txs/import_tx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/avm/txs/import_tx_test.go b/vms/avm/txs/import_tx_test.go index 6b94ea1c7e11..4e4b95a16447 100644 --- a/vms/avm/txs/import_tx_test.go +++ b/vms/avm/txs/import_tx_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/avm/txs/initial_state.go b/vms/avm/txs/initial_state.go index 5df1bc3fd8b6..a093ead5c6b2 100644 --- a/vms/avm/txs/initial_state.go +++ b/vms/avm/txs/initial_state.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/avm/txs/initial_state_test.go b/vms/avm/txs/initial_state_test.go index 15cf6eb284e1..48c15ae196c4 100644 --- a/vms/avm/txs/initial_state_test.go +++ b/vms/avm/txs/initial_state_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/avm/txs/mempool/mempool.go b/vms/avm/txs/mempool/mempool.go index 3e0dd3793560..d5030cbce648 100644 --- a/vms/avm/txs/mempool/mempool.go +++ b/vms/avm/txs/mempool/mempool.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package mempool diff --git a/vms/avm/txs/mempool/mempool_test.go b/vms/avm/txs/mempool/mempool_test.go index d76caebbb2af..3a1a82484267 100644 --- a/vms/avm/txs/mempool/mempool_test.go +++ b/vms/avm/txs/mempool/mempool_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package mempool diff --git a/vms/avm/txs/operation.go b/vms/avm/txs/operation.go index ded7671e618a..d37b162955c6 100644 --- a/vms/avm/txs/operation.go +++ b/vms/avm/txs/operation.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/avm/txs/operation_test.go b/vms/avm/txs/operation_test.go index f0dc3ec3c742..ac9cf62530c6 100644 --- a/vms/avm/txs/operation_test.go +++ b/vms/avm/txs/operation_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/avm/txs/operation_tx.go b/vms/avm/txs/operation_tx.go index df143af30b36..8a1b261ca2dd 100644 --- a/vms/avm/txs/operation_tx.go +++ b/vms/avm/txs/operation_tx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/avm/txs/parser.go b/vms/avm/txs/parser.go index 55722c75b9cf..6ccd34e35bd6 100644 --- a/vms/avm/txs/parser.go +++ b/vms/avm/txs/parser.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/avm/txs/tx.go b/vms/avm/txs/tx.go index 7b900987692a..42e845b07b15 100644 --- a/vms/avm/txs/tx.go +++ b/vms/avm/txs/tx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/avm/txs/visitor.go b/vms/avm/txs/visitor.go index 8de00c1bf35c..31eccb67834d 100644 --- a/vms/avm/txs/visitor.go +++ b/vms/avm/txs/visitor.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/avm/utxo/spender.go b/vms/avm/utxo/spender.go index ed57549da306..02ade0d92eae 100644 --- a/vms/avm/utxo/spender.go +++ b/vms/avm/utxo/spender.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package utxo diff --git a/vms/avm/vm.go b/vms/avm/vm.go index 2f3e05541f96..fb42158034a7 100644 --- a/vms/avm/vm.go +++ b/vms/avm/vm.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avm diff --git a/vms/avm/vm_benchmark_test.go b/vms/avm/vm_benchmark_test.go index cec505f3c2ff..713f809f7f5c 100644 --- a/vms/avm/vm_benchmark_test.go +++ b/vms/avm/vm_benchmark_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avm diff --git a/vms/avm/vm_regression_test.go b/vms/avm/vm_regression_test.go index 0e41c55ef92a..c6ac40df845d 100644 --- a/vms/avm/vm_regression_test.go +++ b/vms/avm/vm_regression_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avm diff --git a/vms/avm/vm_test.go b/vms/avm/vm_test.go index ce7c6c43ea61..d8aeaf3b8743 100644 --- a/vms/avm/vm_test.go +++ b/vms/avm/vm_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avm diff --git a/vms/avm/wallet_client.go b/vms/avm/wallet_client.go index c74918e6e401..69bdc06f9d74 100644 --- a/vms/avm/wallet_client.go +++ b/vms/avm/wallet_client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avm diff --git a/vms/avm/wallet_service.go b/vms/avm/wallet_service.go index f73c89425ebb..f10c6eee780b 100644 --- a/vms/avm/wallet_service.go +++ b/vms/avm/wallet_service.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avm diff --git a/vms/avm/wallet_service_test.go b/vms/avm/wallet_service_test.go index 62860995d8f6..7ffdccdaaa20 100644 --- a/vms/avm/wallet_service_test.go +++ b/vms/avm/wallet_service_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avm diff --git a/vms/components/avax/addresses.go b/vms/components/avax/addresses.go index 40929e22f895..a1567f75f4d6 100644 --- a/vms/components/avax/addresses.go +++ b/vms/components/avax/addresses.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avax diff --git a/vms/components/avax/asset.go b/vms/components/avax/asset.go index 90a3eef6dff9..bc165b4d59ed 100644 --- a/vms/components/avax/asset.go +++ b/vms/components/avax/asset.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avax diff --git a/vms/components/avax/asset_test.go b/vms/components/avax/asset_test.go index 68c371ae1b06..ccb6f5549630 100644 --- a/vms/components/avax/asset_test.go +++ b/vms/components/avax/asset_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avax diff --git a/vms/components/avax/atomic_utxos.go b/vms/components/avax/atomic_utxos.go index 20b22420f8cb..3ac9c166ea3c 100644 --- a/vms/components/avax/atomic_utxos.go +++ b/vms/components/avax/atomic_utxos.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avax diff --git a/vms/components/avax/base_tx.go b/vms/components/avax/base_tx.go index 2bcafa24e497..10561ae0ad52 100644 --- a/vms/components/avax/base_tx.go +++ b/vms/components/avax/base_tx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avax diff --git a/vms/components/avax/flow_checker.go b/vms/components/avax/flow_checker.go index b0ed8c86e551..e02aee717e3b 100644 --- a/vms/components/avax/flow_checker.go +++ b/vms/components/avax/flow_checker.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avax diff --git a/vms/components/avax/metadata.go b/vms/components/avax/metadata.go index f03389c46937..1630484131a8 100644 --- a/vms/components/avax/metadata.go +++ b/vms/components/avax/metadata.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avax diff --git a/vms/components/avax/metadata_test.go b/vms/components/avax/metadata_test.go index 01dada2feda7..9569e3e3a465 100644 --- a/vms/components/avax/metadata_test.go +++ b/vms/components/avax/metadata_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avax diff --git a/vms/components/avax/state.go b/vms/components/avax/state.go index ab0d42ab080d..1a7616b2f729 100644 --- a/vms/components/avax/state.go +++ b/vms/components/avax/state.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avax diff --git a/vms/components/avax/test_verifiable.go b/vms/components/avax/test_verifiable.go index 36ea7d57f8ff..8649b01eaa97 100644 --- a/vms/components/avax/test_verifiable.go +++ b/vms/components/avax/test_verifiable.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avax diff --git a/vms/components/avax/transferables.go b/vms/components/avax/transferables.go index 44bafeef8d6c..18e3cf77542c 100644 --- a/vms/components/avax/transferables.go +++ b/vms/components/avax/transferables.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avax diff --git a/vms/components/avax/transferables_test.go b/vms/components/avax/transferables_test.go index f0bd6332f78d..f46d580e839a 100644 --- a/vms/components/avax/transferables_test.go +++ b/vms/components/avax/transferables_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avax diff --git a/vms/components/avax/utxo.go b/vms/components/avax/utxo.go index afea68914b58..a11c94af80ba 100644 --- a/vms/components/avax/utxo.go +++ b/vms/components/avax/utxo.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avax diff --git a/vms/components/avax/utxo_fetching.go b/vms/components/avax/utxo_fetching.go index 1852513165a4..c5170f1d3123 100644 --- a/vms/components/avax/utxo_fetching.go +++ b/vms/components/avax/utxo_fetching.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avax diff --git a/vms/components/avax/utxo_fetching_test.go b/vms/components/avax/utxo_fetching_test.go index ad34ee9e25b1..25fe3fd91155 100644 --- a/vms/components/avax/utxo_fetching_test.go +++ b/vms/components/avax/utxo_fetching_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avax diff --git a/vms/components/avax/utxo_handler.go b/vms/components/avax/utxo_handler.go index 782d8592e448..c6e705affa2a 100644 --- a/vms/components/avax/utxo_handler.go +++ b/vms/components/avax/utxo_handler.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avax diff --git a/vms/components/avax/utxo_id.go b/vms/components/avax/utxo_id.go index 5b81f2f091a9..fafc940444b5 100644 --- a/vms/components/avax/utxo_id.go +++ b/vms/components/avax/utxo_id.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avax diff --git a/vms/components/avax/utxo_id_test.go b/vms/components/avax/utxo_id_test.go index e21ef620428b..09887c0312e9 100644 --- a/vms/components/avax/utxo_id_test.go +++ b/vms/components/avax/utxo_id_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avax diff --git a/vms/components/avax/utxo_state.go b/vms/components/avax/utxo_state.go index 5ff20b38dddd..9bc648a6e531 100644 --- a/vms/components/avax/utxo_state.go +++ b/vms/components/avax/utxo_state.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avax diff --git a/vms/components/avax/utxo_state_test.go b/vms/components/avax/utxo_state_test.go index e5fc8c695638..09213bfa1bc6 100644 --- a/vms/components/avax/utxo_state_test.go +++ b/vms/components/avax/utxo_state_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avax diff --git a/vms/components/avax/utxo_test.go b/vms/components/avax/utxo_test.go index 7561f85da2cc..54f8360173a7 100644 --- a/vms/components/avax/utxo_test.go +++ b/vms/components/avax/utxo_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avax diff --git a/vms/components/chain/block.go b/vms/components/chain/block.go index d03659ed16da..3966dd2005bd 100644 --- a/vms/components/chain/block.go +++ b/vms/components/chain/block.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package chain diff --git a/vms/components/chain/state.go b/vms/components/chain/state.go index 6311e550ce6c..6ada30e73eee 100644 --- a/vms/components/chain/state.go +++ b/vms/components/chain/state.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package chain diff --git a/vms/components/chain/state_test.go b/vms/components/chain/state_test.go index add7723e9fcf..c0583011bd75 100644 --- a/vms/components/chain/state_test.go +++ b/vms/components/chain/state_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package chain diff --git a/vms/components/index/index.go b/vms/components/index/index.go index a1bced563979..18bdd7337b28 100644 --- a/vms/components/index/index.go +++ b/vms/components/index/index.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package index diff --git a/vms/components/index/metrics.go b/vms/components/index/metrics.go index a38006305548..8531de6982e3 100644 --- a/vms/components/index/metrics.go +++ b/vms/components/index/metrics.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package index diff --git a/vms/components/keystore/codec.go b/vms/components/keystore/codec.go index 9739dc4328a4..6cfa131ed183 100644 --- a/vms/components/keystore/codec.go +++ b/vms/components/keystore/codec.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package keystore diff --git a/vms/components/keystore/user.go b/vms/components/keystore/user.go index 561e2f52b819..20749e5b48bf 100644 --- a/vms/components/keystore/user.go +++ b/vms/components/keystore/user.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package keystore diff --git a/vms/components/keystore/user_test.go b/vms/components/keystore/user_test.go index 9f94cf03b7c6..66e331c2f655 100644 --- a/vms/components/keystore/user_test.go +++ b/vms/components/keystore/user_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package keystore diff --git a/vms/components/message/codec.go b/vms/components/message/codec.go index db47a18fc9a5..bb34ed490c4b 100644 --- a/vms/components/message/codec.go +++ b/vms/components/message/codec.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package message diff --git a/vms/components/message/handler.go b/vms/components/message/handler.go index afe123518164..2af2f55a3f0c 100644 --- a/vms/components/message/handler.go +++ b/vms/components/message/handler.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package message diff --git a/vms/components/message/handler_test.go b/vms/components/message/handler_test.go index 489c973b68e0..bc2342838efa 100644 --- a/vms/components/message/handler_test.go +++ b/vms/components/message/handler_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package message diff --git a/vms/components/message/message.go b/vms/components/message/message.go index f0e13aab3d10..a33d4104430a 100644 --- a/vms/components/message/message.go +++ b/vms/components/message/message.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package message diff --git a/vms/components/message/message_test.go b/vms/components/message/message_test.go index 38b5099e2b45..a4a12312cddb 100644 --- a/vms/components/message/message_test.go +++ b/vms/components/message/message_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package message diff --git a/vms/components/message/tx.go b/vms/components/message/tx.go index 62fdb0dd54f8..4eced1818233 100644 --- a/vms/components/message/tx.go +++ b/vms/components/message/tx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package message diff --git a/vms/components/message/tx_test.go b/vms/components/message/tx_test.go index 3634abb4c71f..8c52828b7977 100644 --- a/vms/components/message/tx_test.go +++ b/vms/components/message/tx_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package message diff --git a/vms/components/verify/subnet.go b/vms/components/verify/subnet.go index a1030164e145..ba4e65ee2bb3 100644 --- a/vms/components/verify/subnet.go +++ b/vms/components/verify/subnet.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package verify diff --git a/vms/components/verify/subnet_test.go b/vms/components/verify/subnet_test.go index 1bfc6c490350..bcffab905ed0 100644 --- a/vms/components/verify/subnet_test.go +++ b/vms/components/verify/subnet_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package verify diff --git a/vms/components/verify/verification.go b/vms/components/verify/verification.go index 566facbdf865..b712b730e8e8 100644 --- a/vms/components/verify/verification.go +++ b/vms/components/verify/verification.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package verify diff --git a/vms/components/verify/verification_test.go b/vms/components/verify/verification_test.go index 408fc2e94736..57f3b856b3a8 100644 --- a/vms/components/verify/verification_test.go +++ b/vms/components/verify/verification_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package verify diff --git a/vms/example/xsvm/api/client.go b/vms/example/xsvm/api/client.go index d8d6a94f1b4b..d9a6a711950a 100644 --- a/vms/example/xsvm/api/client.go +++ b/vms/example/xsvm/api/client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package api diff --git a/vms/example/xsvm/api/server.go b/vms/example/xsvm/api/server.go index 733cf4f2cc44..dd2545e88dcf 100644 --- a/vms/example/xsvm/api/server.go +++ b/vms/example/xsvm/api/server.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package api diff --git a/vms/example/xsvm/block/block.go b/vms/example/xsvm/block/block.go index fee3c801de2f..ab6b41d77f2b 100644 --- a/vms/example/xsvm/block/block.go +++ b/vms/example/xsvm/block/block.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/vms/example/xsvm/block/codec.go b/vms/example/xsvm/block/codec.go index 0edbcaee5302..b4e5c811e29f 100644 --- a/vms/example/xsvm/block/codec.go +++ b/vms/example/xsvm/block/codec.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/vms/example/xsvm/builder/builder.go b/vms/example/xsvm/builder/builder.go index 7135985d3707..231679f5df56 100644 --- a/vms/example/xsvm/builder/builder.go +++ b/vms/example/xsvm/builder/builder.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package builder diff --git a/vms/example/xsvm/chain/block.go b/vms/example/xsvm/chain/block.go index 8eb660e23c12..8ab761d515f8 100644 --- a/vms/example/xsvm/chain/block.go +++ b/vms/example/xsvm/chain/block.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package chain diff --git a/vms/example/xsvm/chain/chain.go b/vms/example/xsvm/chain/chain.go index 954cd3729291..7fc60261d159 100644 --- a/vms/example/xsvm/chain/chain.go +++ b/vms/example/xsvm/chain/chain.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package chain diff --git a/vms/example/xsvm/cmd/account/cmd.go b/vms/example/xsvm/cmd/account/cmd.go index 3436c3fea1b5..cea0b7b6a227 100644 --- a/vms/example/xsvm/cmd/account/cmd.go +++ b/vms/example/xsvm/cmd/account/cmd.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package account diff --git a/vms/example/xsvm/cmd/account/flags.go b/vms/example/xsvm/cmd/account/flags.go index 17092bbe1a21..3a9588ab2c63 100644 --- a/vms/example/xsvm/cmd/account/flags.go +++ b/vms/example/xsvm/cmd/account/flags.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package account diff --git a/vms/example/xsvm/cmd/chain/cmd.go b/vms/example/xsvm/cmd/chain/cmd.go index a87e6911b8a8..679bdea0b9f0 100644 --- a/vms/example/xsvm/cmd/chain/cmd.go +++ b/vms/example/xsvm/cmd/chain/cmd.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package chain diff --git a/vms/example/xsvm/cmd/chain/create/cmd.go b/vms/example/xsvm/cmd/chain/create/cmd.go index e562c8567b06..984ff45df8b0 100644 --- a/vms/example/xsvm/cmd/chain/create/cmd.go +++ b/vms/example/xsvm/cmd/chain/create/cmd.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package create diff --git a/vms/example/xsvm/cmd/chain/create/flags.go b/vms/example/xsvm/cmd/chain/create/flags.go index 80b1eefd67cf..d3e554659e49 100644 --- a/vms/example/xsvm/cmd/chain/create/flags.go +++ b/vms/example/xsvm/cmd/chain/create/flags.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package create diff --git a/vms/example/xsvm/cmd/chain/genesis/cmd.go b/vms/example/xsvm/cmd/chain/genesis/cmd.go index 8ef49baa77ab..be839fced200 100644 --- a/vms/example/xsvm/cmd/chain/genesis/cmd.go +++ b/vms/example/xsvm/cmd/chain/genesis/cmd.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package genesis diff --git a/vms/example/xsvm/cmd/chain/genesis/flags.go b/vms/example/xsvm/cmd/chain/genesis/flags.go index 5291327197d5..0bacf0edd29b 100644 --- a/vms/example/xsvm/cmd/chain/genesis/flags.go +++ b/vms/example/xsvm/cmd/chain/genesis/flags.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package genesis diff --git a/vms/example/xsvm/cmd/issue/cmd.go b/vms/example/xsvm/cmd/issue/cmd.go index e973efc31d5b..12c156d06628 100644 --- a/vms/example/xsvm/cmd/issue/cmd.go +++ b/vms/example/xsvm/cmd/issue/cmd.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package issue diff --git a/vms/example/xsvm/cmd/issue/export/cmd.go b/vms/example/xsvm/cmd/issue/export/cmd.go index c0a8cd11008c..efde479971cc 100644 --- a/vms/example/xsvm/cmd/issue/export/cmd.go +++ b/vms/example/xsvm/cmd/issue/export/cmd.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package export diff --git a/vms/example/xsvm/cmd/issue/export/flags.go b/vms/example/xsvm/cmd/issue/export/flags.go index f14c21ef8f6f..6d7f4e49a233 100644 --- a/vms/example/xsvm/cmd/issue/export/flags.go +++ b/vms/example/xsvm/cmd/issue/export/flags.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package export diff --git a/vms/example/xsvm/cmd/issue/importtx/cmd.go b/vms/example/xsvm/cmd/issue/importtx/cmd.go index 2c8fbb7edb27..5bf104212ef6 100644 --- a/vms/example/xsvm/cmd/issue/importtx/cmd.go +++ b/vms/example/xsvm/cmd/issue/importtx/cmd.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package importtx diff --git a/vms/example/xsvm/cmd/issue/importtx/flags.go b/vms/example/xsvm/cmd/issue/importtx/flags.go index 486dfa1a05ea..15b968775fcc 100644 --- a/vms/example/xsvm/cmd/issue/importtx/flags.go +++ b/vms/example/xsvm/cmd/issue/importtx/flags.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package importtx diff --git a/vms/example/xsvm/cmd/issue/transfer/cmd.go b/vms/example/xsvm/cmd/issue/transfer/cmd.go index 5dd15bc4ea26..86c47032a6c0 100644 --- a/vms/example/xsvm/cmd/issue/transfer/cmd.go +++ b/vms/example/xsvm/cmd/issue/transfer/cmd.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package transfer diff --git a/vms/example/xsvm/cmd/issue/transfer/flags.go b/vms/example/xsvm/cmd/issue/transfer/flags.go index 5d4667b47458..043c07243e54 100644 --- a/vms/example/xsvm/cmd/issue/transfer/flags.go +++ b/vms/example/xsvm/cmd/issue/transfer/flags.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package transfer diff --git a/vms/example/xsvm/cmd/run/cmd.go b/vms/example/xsvm/cmd/run/cmd.go index 9776b15eb3a7..eace7e85d7ed 100644 --- a/vms/example/xsvm/cmd/run/cmd.go +++ b/vms/example/xsvm/cmd/run/cmd.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package run diff --git a/vms/example/xsvm/cmd/version/cmd.go b/vms/example/xsvm/cmd/version/cmd.go index 0827a9e800b7..1c956c6a9b00 100644 --- a/vms/example/xsvm/cmd/version/cmd.go +++ b/vms/example/xsvm/cmd/version/cmd.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package version diff --git a/vms/example/xsvm/cmd/xsvm/main.go b/vms/example/xsvm/cmd/xsvm/main.go index ac370a4a9df2..c6961a8c1741 100644 --- a/vms/example/xsvm/cmd/xsvm/main.go +++ b/vms/example/xsvm/cmd/xsvm/main.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package main diff --git a/vms/example/xsvm/constants.go b/vms/example/xsvm/constants.go index e4b22b742450..eb2199211ef7 100644 --- a/vms/example/xsvm/constants.go +++ b/vms/example/xsvm/constants.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package xsvm diff --git a/vms/example/xsvm/execute/block.go b/vms/example/xsvm/execute/block.go index 3d51c64abaa2..b2938a58f5e8 100644 --- a/vms/example/xsvm/execute/block.go +++ b/vms/example/xsvm/execute/block.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package execute diff --git a/vms/example/xsvm/execute/expects_context.go b/vms/example/xsvm/execute/expects_context.go index 0109cadc3731..da21b520f314 100644 --- a/vms/example/xsvm/execute/expects_context.go +++ b/vms/example/xsvm/execute/expects_context.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package execute diff --git a/vms/example/xsvm/execute/genesis.go b/vms/example/xsvm/execute/genesis.go index c0a44e2ef6bb..889432d38256 100644 --- a/vms/example/xsvm/execute/genesis.go +++ b/vms/example/xsvm/execute/genesis.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package execute diff --git a/vms/example/xsvm/execute/tx.go b/vms/example/xsvm/execute/tx.go index 01bfc1fb7d6d..f3f6ad504de4 100644 --- a/vms/example/xsvm/execute/tx.go +++ b/vms/example/xsvm/execute/tx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package execute diff --git a/vms/example/xsvm/factory.go b/vms/example/xsvm/factory.go index 0531a1bcc7d0..99d33b8290d1 100644 --- a/vms/example/xsvm/factory.go +++ b/vms/example/xsvm/factory.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package xsvm diff --git a/vms/example/xsvm/genesis/codec.go b/vms/example/xsvm/genesis/codec.go index 3533e29a0188..c0851cccf146 100644 --- a/vms/example/xsvm/genesis/codec.go +++ b/vms/example/xsvm/genesis/codec.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package genesis diff --git a/vms/example/xsvm/genesis/genesis.go b/vms/example/xsvm/genesis/genesis.go index fddc96716bd6..0fb420f3a4da 100644 --- a/vms/example/xsvm/genesis/genesis.go +++ b/vms/example/xsvm/genesis/genesis.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package genesis diff --git a/vms/example/xsvm/genesis/genesis_test.go b/vms/example/xsvm/genesis/genesis_test.go index f15e72ecc743..ba050d12f801 100644 --- a/vms/example/xsvm/genesis/genesis_test.go +++ b/vms/example/xsvm/genesis/genesis_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package genesis diff --git a/vms/example/xsvm/state/keys.go b/vms/example/xsvm/state/keys.go index 5e78f1b95a0e..e0df1e36cdc0 100644 --- a/vms/example/xsvm/state/keys.go +++ b/vms/example/xsvm/state/keys.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/example/xsvm/state/storage.go b/vms/example/xsvm/state/storage.go index c9b6bf1ae65d..48234e9678de 100644 --- a/vms/example/xsvm/state/storage.go +++ b/vms/example/xsvm/state/storage.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/example/xsvm/tx/codec.go b/vms/example/xsvm/tx/codec.go index 1f8b8fc9dd0e..c15150c4b37f 100644 --- a/vms/example/xsvm/tx/codec.go +++ b/vms/example/xsvm/tx/codec.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tx diff --git a/vms/example/xsvm/tx/export.go b/vms/example/xsvm/tx/export.go index 1192952c4dca..d8de16a69e7e 100644 --- a/vms/example/xsvm/tx/export.go +++ b/vms/example/xsvm/tx/export.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tx diff --git a/vms/example/xsvm/tx/import.go b/vms/example/xsvm/tx/import.go index 8449c79c55b2..ff98b0a01aa2 100644 --- a/vms/example/xsvm/tx/import.go +++ b/vms/example/xsvm/tx/import.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tx diff --git a/vms/example/xsvm/tx/payload.go b/vms/example/xsvm/tx/payload.go index 0d1671535c9d..eecc2f082d11 100644 --- a/vms/example/xsvm/tx/payload.go +++ b/vms/example/xsvm/tx/payload.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tx diff --git a/vms/example/xsvm/tx/transfer.go b/vms/example/xsvm/tx/transfer.go index c895b5e5cc51..a3d29c1432c9 100644 --- a/vms/example/xsvm/tx/transfer.go +++ b/vms/example/xsvm/tx/transfer.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tx diff --git a/vms/example/xsvm/tx/tx.go b/vms/example/xsvm/tx/tx.go index 05beec274cb4..8b05d5375b27 100644 --- a/vms/example/xsvm/tx/tx.go +++ b/vms/example/xsvm/tx/tx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tx diff --git a/vms/example/xsvm/tx/unsigned.go b/vms/example/xsvm/tx/unsigned.go index 2c57f91e26fb..110611412b59 100644 --- a/vms/example/xsvm/tx/unsigned.go +++ b/vms/example/xsvm/tx/unsigned.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tx diff --git a/vms/example/xsvm/tx/visitor.go b/vms/example/xsvm/tx/visitor.go index b411e06f15b0..045b03247479 100644 --- a/vms/example/xsvm/tx/visitor.go +++ b/vms/example/xsvm/tx/visitor.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tx diff --git a/vms/example/xsvm/vm.go b/vms/example/xsvm/vm.go index 3150fc59b481..b69360f838d7 100644 --- a/vms/example/xsvm/vm.go +++ b/vms/example/xsvm/vm.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package xsvm diff --git a/vms/manager.go b/vms/manager.go index d1041d3a4693..f4ae49e39cd0 100644 --- a/vms/manager.go +++ b/vms/manager.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package vms diff --git a/vms/metervm/batched_vm.go b/vms/metervm/batched_vm.go index dad17637a918..7b06f0989b89 100644 --- a/vms/metervm/batched_vm.go +++ b/vms/metervm/batched_vm.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package metervm diff --git a/vms/metervm/block.go b/vms/metervm/block.go index 17ffffd5f549..10d44d2c41b6 100644 --- a/vms/metervm/block.go +++ b/vms/metervm/block.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package metervm diff --git a/vms/metervm/block_metrics.go b/vms/metervm/block_metrics.go index 094e41875aac..160d0eee50ad 100644 --- a/vms/metervm/block_metrics.go +++ b/vms/metervm/block_metrics.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package metervm diff --git a/vms/metervm/block_vm.go b/vms/metervm/block_vm.go index 8f9fee1e247d..73e949180a96 100644 --- a/vms/metervm/block_vm.go +++ b/vms/metervm/block_vm.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package metervm diff --git a/vms/metervm/build_block_with_context_vm.go b/vms/metervm/build_block_with_context_vm.go index 141d68e0ceac..012237ee3178 100644 --- a/vms/metervm/build_block_with_context_vm.go +++ b/vms/metervm/build_block_with_context_vm.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package metervm diff --git a/vms/metervm/metrics.go b/vms/metervm/metrics.go index eb2c2b40736b..f79c5e38e029 100644 --- a/vms/metervm/metrics.go +++ b/vms/metervm/metrics.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package metervm diff --git a/vms/metervm/state_syncable_vm.go b/vms/metervm/state_syncable_vm.go index bcb27d682b08..42b5efa8a79e 100644 --- a/vms/metervm/state_syncable_vm.go +++ b/vms/metervm/state_syncable_vm.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package metervm diff --git a/vms/metervm/vertex_metrics.go b/vms/metervm/vertex_metrics.go index 2a4b0a506151..67caa50b610e 100644 --- a/vms/metervm/vertex_metrics.go +++ b/vms/metervm/vertex_metrics.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package metervm diff --git a/vms/metervm/vertex_vm.go b/vms/metervm/vertex_vm.go index 827bb535fcbd..8992b4863283 100644 --- a/vms/metervm/vertex_vm.go +++ b/vms/metervm/vertex_vm.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package metervm diff --git a/vms/nftfx/credential.go b/vms/nftfx/credential.go index 64af78587282..a8970b854b1a 100644 --- a/vms/nftfx/credential.go +++ b/vms/nftfx/credential.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package nftfx diff --git a/vms/nftfx/credential_test.go b/vms/nftfx/credential_test.go index c1e83ccab00e..0f05af26a738 100644 --- a/vms/nftfx/credential_test.go +++ b/vms/nftfx/credential_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package nftfx diff --git a/vms/nftfx/factory.go b/vms/nftfx/factory.go index e52d629fe670..a111bc0ed7e2 100644 --- a/vms/nftfx/factory.go +++ b/vms/nftfx/factory.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package nftfx diff --git a/vms/nftfx/factory_test.go b/vms/nftfx/factory_test.go index 10581c8db922..6b4fba9861ac 100644 --- a/vms/nftfx/factory_test.go +++ b/vms/nftfx/factory_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package nftfx diff --git a/vms/nftfx/fx.go b/vms/nftfx/fx.go index f56ffcc10e5d..66ea9460b56b 100644 --- a/vms/nftfx/fx.go +++ b/vms/nftfx/fx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package nftfx diff --git a/vms/nftfx/fx_test.go b/vms/nftfx/fx_test.go index d054d680c305..99a047b11328 100644 --- a/vms/nftfx/fx_test.go +++ b/vms/nftfx/fx_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package nftfx diff --git a/vms/nftfx/mint_operation.go b/vms/nftfx/mint_operation.go index 2d1c5bbb5d98..bb01ee52ed23 100644 --- a/vms/nftfx/mint_operation.go +++ b/vms/nftfx/mint_operation.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package nftfx diff --git a/vms/nftfx/mint_operation_test.go b/vms/nftfx/mint_operation_test.go index 4dc1ce2a3eb6..ff397e9a07a3 100644 --- a/vms/nftfx/mint_operation_test.go +++ b/vms/nftfx/mint_operation_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package nftfx diff --git a/vms/nftfx/mint_output.go b/vms/nftfx/mint_output.go index 4c2f53698307..e3a974379a16 100644 --- a/vms/nftfx/mint_output.go +++ b/vms/nftfx/mint_output.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package nftfx diff --git a/vms/nftfx/mint_output_test.go b/vms/nftfx/mint_output_test.go index 583f211f972f..9589fc17f75b 100644 --- a/vms/nftfx/mint_output_test.go +++ b/vms/nftfx/mint_output_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package nftfx diff --git a/vms/nftfx/transfer_operation.go b/vms/nftfx/transfer_operation.go index 010d43890f62..014cd900eca7 100644 --- a/vms/nftfx/transfer_operation.go +++ b/vms/nftfx/transfer_operation.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package nftfx diff --git a/vms/nftfx/transfer_operation_test.go b/vms/nftfx/transfer_operation_test.go index ad896b14ee7d..b8892aec63bd 100644 --- a/vms/nftfx/transfer_operation_test.go +++ b/vms/nftfx/transfer_operation_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package nftfx diff --git a/vms/nftfx/transfer_output.go b/vms/nftfx/transfer_output.go index c87d47984e39..e849e1c462e5 100644 --- a/vms/nftfx/transfer_output.go +++ b/vms/nftfx/transfer_output.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package nftfx diff --git a/vms/nftfx/transfer_output_test.go b/vms/nftfx/transfer_output_test.go index 330723144106..0effa6c393a7 100644 --- a/vms/nftfx/transfer_output_test.go +++ b/vms/nftfx/transfer_output_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package nftfx diff --git a/vms/platformvm/api/static_client.go b/vms/platformvm/api/static_client.go index 9dea36664592..c10943fe19d9 100644 --- a/vms/platformvm/api/static_client.go +++ b/vms/platformvm/api/static_client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package api diff --git a/vms/platformvm/api/static_service.go b/vms/platformvm/api/static_service.go index dea7ce656aa9..bd6e32d250a1 100644 --- a/vms/platformvm/api/static_service.go +++ b/vms/platformvm/api/static_service.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package api diff --git a/vms/platformvm/api/static_service_test.go b/vms/platformvm/api/static_service_test.go index 402a5fc7c766..a0e62fa9a31f 100644 --- a/vms/platformvm/api/static_service_test.go +++ b/vms/platformvm/api/static_service_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package api diff --git a/vms/platformvm/block/abort_block.go b/vms/platformvm/block/abort_block.go index 27f2ad25a356..ace8087fd385 100644 --- a/vms/platformvm/block/abort_block.go +++ b/vms/platformvm/block/abort_block.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/vms/platformvm/block/abort_block_test.go b/vms/platformvm/block/abort_block_test.go index 149067aab8e4..a6517cef0137 100644 --- a/vms/platformvm/block/abort_block_test.go +++ b/vms/platformvm/block/abort_block_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/vms/platformvm/block/atomic_block.go b/vms/platformvm/block/atomic_block.go index 470abcbe4674..35deda80c0b5 100644 --- a/vms/platformvm/block/atomic_block.go +++ b/vms/platformvm/block/atomic_block.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/vms/platformvm/block/atomic_block_test.go b/vms/platformvm/block/atomic_block_test.go index 7436a0c24153..d81310184f23 100644 --- a/vms/platformvm/block/atomic_block_test.go +++ b/vms/platformvm/block/atomic_block_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/vms/platformvm/block/block.go b/vms/platformvm/block/block.go index dd9c61e4ce9c..30be125b8b43 100644 --- a/vms/platformvm/block/block.go +++ b/vms/platformvm/block/block.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/vms/platformvm/block/builder/builder.go b/vms/platformvm/block/builder/builder.go index 34f9a74e7f37..09e99ba9ac3e 100644 --- a/vms/platformvm/block/builder/builder.go +++ b/vms/platformvm/block/builder/builder.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package builder diff --git a/vms/platformvm/block/builder/builder_test.go b/vms/platformvm/block/builder/builder_test.go index bba4acbd8832..0dc804ff810d 100644 --- a/vms/platformvm/block/builder/builder_test.go +++ b/vms/platformvm/block/builder/builder_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package builder diff --git a/vms/platformvm/block/builder/helpers_test.go b/vms/platformvm/block/builder/helpers_test.go index 6c0c5d6fe16d..7918411b3944 100644 --- a/vms/platformvm/block/builder/helpers_test.go +++ b/vms/platformvm/block/builder/helpers_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package builder diff --git a/vms/platformvm/block/builder/main_test.go b/vms/platformvm/block/builder/main_test.go index 01135c523738..31149bfbcca8 100644 --- a/vms/platformvm/block/builder/main_test.go +++ b/vms/platformvm/block/builder/main_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package builder diff --git a/vms/platformvm/block/builder/standard_block_test.go b/vms/platformvm/block/builder/standard_block_test.go index 8e94a0791fbd..61dd0d5e2ca1 100644 --- a/vms/platformvm/block/builder/standard_block_test.go +++ b/vms/platformvm/block/builder/standard_block_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package builder diff --git a/vms/platformvm/block/codec.go b/vms/platformvm/block/codec.go index 7a730e2720de..b7338ea98a03 100644 --- a/vms/platformvm/block/codec.go +++ b/vms/platformvm/block/codec.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/vms/platformvm/block/commit_block.go b/vms/platformvm/block/commit_block.go index 52b260f0f167..ac6dbb1ed88f 100644 --- a/vms/platformvm/block/commit_block.go +++ b/vms/platformvm/block/commit_block.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/vms/platformvm/block/commit_block_test.go b/vms/platformvm/block/commit_block_test.go index 256af6539c96..f89489d521a1 100644 --- a/vms/platformvm/block/commit_block_test.go +++ b/vms/platformvm/block/commit_block_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/vms/platformvm/block/common_block.go b/vms/platformvm/block/common_block.go index 899fd57b7fcb..f4b46b816b87 100644 --- a/vms/platformvm/block/common_block.go +++ b/vms/platformvm/block/common_block.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/vms/platformvm/block/executor/acceptor.go b/vms/platformvm/block/executor/acceptor.go index af26c931d088..8ee4f6e4a04f 100644 --- a/vms/platformvm/block/executor/acceptor.go +++ b/vms/platformvm/block/executor/acceptor.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/platformvm/block/executor/acceptor_test.go b/vms/platformvm/block/executor/acceptor_test.go index 210d5d810577..fb5fcd5f88af 100644 --- a/vms/platformvm/block/executor/acceptor_test.go +++ b/vms/platformvm/block/executor/acceptor_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/platformvm/block/executor/backend.go b/vms/platformvm/block/executor/backend.go index 4d915047f560..c4e56545634d 100644 --- a/vms/platformvm/block/executor/backend.go +++ b/vms/platformvm/block/executor/backend.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/platformvm/block/executor/backend_test.go b/vms/platformvm/block/executor/backend_test.go index ce6744369593..19ad55c36d81 100644 --- a/vms/platformvm/block/executor/backend_test.go +++ b/vms/platformvm/block/executor/backend_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/platformvm/block/executor/block.go b/vms/platformvm/block/executor/block.go index 733825412008..ef05f38442c5 100644 --- a/vms/platformvm/block/executor/block.go +++ b/vms/platformvm/block/executor/block.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/platformvm/block/executor/block_state.go b/vms/platformvm/block/executor/block_state.go index abec214ae244..ffc6f679b8f6 100644 --- a/vms/platformvm/block/executor/block_state.go +++ b/vms/platformvm/block/executor/block_state.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/platformvm/block/executor/block_test.go b/vms/platformvm/block/executor/block_test.go index 7153ff52d3cf..b1d73cefb7f1 100644 --- a/vms/platformvm/block/executor/block_test.go +++ b/vms/platformvm/block/executor/block_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/platformvm/block/executor/helpers_test.go b/vms/platformvm/block/executor/helpers_test.go index 1d7d58217b15..67ace707bd5a 100644 --- a/vms/platformvm/block/executor/helpers_test.go +++ b/vms/platformvm/block/executor/helpers_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/platformvm/block/executor/manager.go b/vms/platformvm/block/executor/manager.go index 0f8309020f6d..ed82197a3568 100644 --- a/vms/platformvm/block/executor/manager.go +++ b/vms/platformvm/block/executor/manager.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/platformvm/block/executor/manager_test.go b/vms/platformvm/block/executor/manager_test.go index ce887d987992..55cf01d7c8ab 100644 --- a/vms/platformvm/block/executor/manager_test.go +++ b/vms/platformvm/block/executor/manager_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/platformvm/block/executor/options.go b/vms/platformvm/block/executor/options.go index 29a1d02922bd..a8ccea315b0f 100644 --- a/vms/platformvm/block/executor/options.go +++ b/vms/platformvm/block/executor/options.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/platformvm/block/executor/options_test.go b/vms/platformvm/block/executor/options_test.go index bf8e6e3e67b6..54bef77919b7 100644 --- a/vms/platformvm/block/executor/options_test.go +++ b/vms/platformvm/block/executor/options_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/platformvm/block/executor/proposal_block_test.go b/vms/platformvm/block/executor/proposal_block_test.go index 45f4afe7c9e6..549a3fbe25df 100644 --- a/vms/platformvm/block/executor/proposal_block_test.go +++ b/vms/platformvm/block/executor/proposal_block_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/platformvm/block/executor/rejector.go b/vms/platformvm/block/executor/rejector.go index 6b2565288fca..b5dde1f6e84c 100644 --- a/vms/platformvm/block/executor/rejector.go +++ b/vms/platformvm/block/executor/rejector.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/platformvm/block/executor/rejector_test.go b/vms/platformvm/block/executor/rejector_test.go index 5e06a885fd5e..4391ed3d494c 100644 --- a/vms/platformvm/block/executor/rejector_test.go +++ b/vms/platformvm/block/executor/rejector_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/platformvm/block/executor/standard_block_test.go b/vms/platformvm/block/executor/standard_block_test.go index 7731d450a533..435ee6618af0 100644 --- a/vms/platformvm/block/executor/standard_block_test.go +++ b/vms/platformvm/block/executor/standard_block_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/platformvm/block/executor/verifier.go b/vms/platformvm/block/executor/verifier.go index f16816d81db7..2af7cb20912a 100644 --- a/vms/platformvm/block/executor/verifier.go +++ b/vms/platformvm/block/executor/verifier.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/platformvm/block/executor/verifier_test.go b/vms/platformvm/block/executor/verifier_test.go index 6d4e32e0bee5..ccac3da3b7e3 100644 --- a/vms/platformvm/block/executor/verifier_test.go +++ b/vms/platformvm/block/executor/verifier_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/platformvm/block/parse.go b/vms/platformvm/block/parse.go index 1a97dca2e4fd..e667907947e4 100644 --- a/vms/platformvm/block/parse.go +++ b/vms/platformvm/block/parse.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/vms/platformvm/block/parse_test.go b/vms/platformvm/block/parse_test.go index 799310aa2f51..d21ae9da9409 100644 --- a/vms/platformvm/block/parse_test.go +++ b/vms/platformvm/block/parse_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/vms/platformvm/block/proposal_block.go b/vms/platformvm/block/proposal_block.go index 719bc3a1825a..4160db57c4a9 100644 --- a/vms/platformvm/block/proposal_block.go +++ b/vms/platformvm/block/proposal_block.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/vms/platformvm/block/proposal_block_test.go b/vms/platformvm/block/proposal_block_test.go index bdb65e4a2404..7fbc44191f41 100644 --- a/vms/platformvm/block/proposal_block_test.go +++ b/vms/platformvm/block/proposal_block_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/vms/platformvm/block/serialization_test.go b/vms/platformvm/block/serialization_test.go index 2d936d35e00e..8e2002c3636c 100644 --- a/vms/platformvm/block/serialization_test.go +++ b/vms/platformvm/block/serialization_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/vms/platformvm/block/standard_block.go b/vms/platformvm/block/standard_block.go index cff20c92369b..c7d35b12f70d 100644 --- a/vms/platformvm/block/standard_block.go +++ b/vms/platformvm/block/standard_block.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/vms/platformvm/block/standard_block_test.go b/vms/platformvm/block/standard_block_test.go index d417a37fb96a..4162aadb05e1 100644 --- a/vms/platformvm/block/standard_block_test.go +++ b/vms/platformvm/block/standard_block_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/vms/platformvm/block/visitor.go b/vms/platformvm/block/visitor.go index f05dc5d05129..6c27b5386c1a 100644 --- a/vms/platformvm/block/visitor.go +++ b/vms/platformvm/block/visitor.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/vms/platformvm/client.go b/vms/platformvm/client.go index 3796ad7ff86a..9311fd290a7e 100644 --- a/vms/platformvm/client.go +++ b/vms/platformvm/client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package platformvm diff --git a/vms/platformvm/client_permissionless_validator.go b/vms/platformvm/client_permissionless_validator.go index c9baac856073..3974f770658d 100644 --- a/vms/platformvm/client_permissionless_validator.go +++ b/vms/platformvm/client_permissionless_validator.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package platformvm diff --git a/vms/platformvm/config/config.go b/vms/platformvm/config/config.go index f9504708f78a..50628c422afd 100644 --- a/vms/platformvm/config/config.go +++ b/vms/platformvm/config/config.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package config diff --git a/vms/platformvm/config/execution_config.go b/vms/platformvm/config/execution_config.go index b21aae48e8e4..e182758e0c50 100644 --- a/vms/platformvm/config/execution_config.go +++ b/vms/platformvm/config/execution_config.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package config diff --git a/vms/platformvm/config/execution_config_test.go b/vms/platformvm/config/execution_config_test.go index 1680058819ae..89fd5cd55b05 100644 --- a/vms/platformvm/config/execution_config_test.go +++ b/vms/platformvm/config/execution_config_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package config diff --git a/vms/platformvm/factory.go b/vms/platformvm/factory.go index 5673bebefd97..834c9c8f2450 100644 --- a/vms/platformvm/factory.go +++ b/vms/platformvm/factory.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package platformvm diff --git a/vms/platformvm/fx/fx.go b/vms/platformvm/fx/fx.go index 706d86debfcd..4f6eceea5f7a 100644 --- a/vms/platformvm/fx/fx.go +++ b/vms/platformvm/fx/fx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package fx diff --git a/vms/platformvm/genesis/codec.go b/vms/platformvm/genesis/codec.go index f8cbe110bf07..b18c40d60cca 100644 --- a/vms/platformvm/genesis/codec.go +++ b/vms/platformvm/genesis/codec.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package genesis diff --git a/vms/platformvm/genesis/genesis.go b/vms/platformvm/genesis/genesis.go index 4b573b723e3f..795e73cbefa6 100644 --- a/vms/platformvm/genesis/genesis.go +++ b/vms/platformvm/genesis/genesis.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package genesis diff --git a/vms/platformvm/health.go b/vms/platformvm/health.go index 4ceed8f84adc..86c80b807b70 100644 --- a/vms/platformvm/health.go +++ b/vms/platformvm/health.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package platformvm diff --git a/vms/platformvm/main_test.go b/vms/platformvm/main_test.go index 88a571cfa5cb..d353d31664fe 100644 --- a/vms/platformvm/main_test.go +++ b/vms/platformvm/main_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package platformvm diff --git a/vms/platformvm/metrics/block_metrics.go b/vms/platformvm/metrics/block_metrics.go index 7b3a9b2abf6c..193369cbf901 100644 --- a/vms/platformvm/metrics/block_metrics.go +++ b/vms/platformvm/metrics/block_metrics.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package metrics diff --git a/vms/platformvm/metrics/metrics.go b/vms/platformvm/metrics/metrics.go index 7c0e616dd9b2..5357721d9bd6 100644 --- a/vms/platformvm/metrics/metrics.go +++ b/vms/platformvm/metrics/metrics.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package metrics diff --git a/vms/platformvm/metrics/no_op.go b/vms/platformvm/metrics/no_op.go index 45100b49bbf5..770e30c961a1 100644 --- a/vms/platformvm/metrics/no_op.go +++ b/vms/platformvm/metrics/no_op.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package metrics diff --git a/vms/platformvm/metrics/tx_metrics.go b/vms/platformvm/metrics/tx_metrics.go index 9ed07bce7ec9..f56c84aac176 100644 --- a/vms/platformvm/metrics/tx_metrics.go +++ b/vms/platformvm/metrics/tx_metrics.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package metrics diff --git a/vms/platformvm/network/config.go b/vms/platformvm/network/config.go index 2ff7828df2e4..8f54a20baf8a 100644 --- a/vms/platformvm/network/config.go +++ b/vms/platformvm/network/config.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package network diff --git a/vms/platformvm/network/gossip.go b/vms/platformvm/network/gossip.go index 5c12ee7a83bc..b2f409c75626 100644 --- a/vms/platformvm/network/gossip.go +++ b/vms/platformvm/network/gossip.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package network diff --git a/vms/platformvm/network/gossip_test.go b/vms/platformvm/network/gossip_test.go index 9c3fff9b5ff9..a51c86872297 100644 --- a/vms/platformvm/network/gossip_test.go +++ b/vms/platformvm/network/gossip_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package network diff --git a/vms/platformvm/network/main_test.go b/vms/platformvm/network/main_test.go index be0fab18f587..ed2cfd9ecee7 100644 --- a/vms/platformvm/network/main_test.go +++ b/vms/platformvm/network/main_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package network diff --git a/vms/platformvm/network/network.go b/vms/platformvm/network/network.go index 58fb0ec156eb..6844654a41c1 100644 --- a/vms/platformvm/network/network.go +++ b/vms/platformvm/network/network.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package network diff --git a/vms/platformvm/network/network_test.go b/vms/platformvm/network/network_test.go index 32e224d971e1..5bb735395767 100644 --- a/vms/platformvm/network/network_test.go +++ b/vms/platformvm/network/network_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package network diff --git a/vms/platformvm/network/tx_verifier.go b/vms/platformvm/network/tx_verifier.go index 262171d06848..ee76c8b0056b 100644 --- a/vms/platformvm/network/tx_verifier.go +++ b/vms/platformvm/network/tx_verifier.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package network diff --git a/vms/platformvm/reward/calculator.go b/vms/platformvm/reward/calculator.go index 30ba7c3270d7..79a845ef8980 100644 --- a/vms/platformvm/reward/calculator.go +++ b/vms/platformvm/reward/calculator.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package reward diff --git a/vms/platformvm/reward/calculator_test.go b/vms/platformvm/reward/calculator_test.go index 1462bd2e3664..d2fd17ff9e2b 100644 --- a/vms/platformvm/reward/calculator_test.go +++ b/vms/platformvm/reward/calculator_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package reward diff --git a/vms/platformvm/reward/config.go b/vms/platformvm/reward/config.go index 17a0a0d0e83b..ccabc398f83a 100644 --- a/vms/platformvm/reward/config.go +++ b/vms/platformvm/reward/config.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package reward diff --git a/vms/platformvm/service.go b/vms/platformvm/service.go index 8326f0fbff8b..16e5b16844c6 100644 --- a/vms/platformvm/service.go +++ b/vms/platformvm/service.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package platformvm diff --git a/vms/platformvm/service_test.go b/vms/platformvm/service_test.go index d80aeb5726b2..2c6b72255c3f 100644 --- a/vms/platformvm/service_test.go +++ b/vms/platformvm/service_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package platformvm diff --git a/vms/platformvm/signer/empty.go b/vms/platformvm/signer/empty.go index 7b5dec06cbcf..21412ae6d0b1 100644 --- a/vms/platformvm/signer/empty.go +++ b/vms/platformvm/signer/empty.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package signer diff --git a/vms/platformvm/signer/empty_test.go b/vms/platformvm/signer/empty_test.go index e6a6307b9842..9fe949f4677d 100644 --- a/vms/platformvm/signer/empty_test.go +++ b/vms/platformvm/signer/empty_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package signer diff --git a/vms/platformvm/signer/proof_of_possession.go b/vms/platformvm/signer/proof_of_possession.go index 35ddcb320745..8b32975b4969 100644 --- a/vms/platformvm/signer/proof_of_possession.go +++ b/vms/platformvm/signer/proof_of_possession.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package signer diff --git a/vms/platformvm/signer/proof_of_possession_test.go b/vms/platformvm/signer/proof_of_possession_test.go index 8214554cebfe..9f4f3feefa3c 100644 --- a/vms/platformvm/signer/proof_of_possession_test.go +++ b/vms/platformvm/signer/proof_of_possession_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package signer diff --git a/vms/platformvm/signer/signer.go b/vms/platformvm/signer/signer.go index 7269ad199534..31bf212ddca6 100644 --- a/vms/platformvm/signer/signer.go +++ b/vms/platformvm/signer/signer.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package signer diff --git a/vms/platformvm/stakeable/stakeable_lock.go b/vms/platformvm/stakeable/stakeable_lock.go index 5c09cbfdda8a..58149266175e 100644 --- a/vms/platformvm/stakeable/stakeable_lock.go +++ b/vms/platformvm/stakeable/stakeable_lock.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package stakeable diff --git a/vms/platformvm/stakeable/stakeable_lock_test.go b/vms/platformvm/stakeable/stakeable_lock_test.go index b733aa0244c5..0ea53e9cc426 100644 --- a/vms/platformvm/stakeable/stakeable_lock_test.go +++ b/vms/platformvm/stakeable/stakeable_lock_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package stakeable diff --git a/vms/platformvm/state/diff.go b/vms/platformvm/state/diff.go index bb308c9c28e2..907c3c56ef7d 100644 --- a/vms/platformvm/state/diff.go +++ b/vms/platformvm/state/diff.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/platformvm/state/diff_test.go b/vms/platformvm/state/diff_test.go index e9eecdb182cb..c4698603855e 100644 --- a/vms/platformvm/state/diff_test.go +++ b/vms/platformvm/state/diff_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/platformvm/state/disk_staker_diff_iterator.go b/vms/platformvm/state/disk_staker_diff_iterator.go index efac5ec7b6d7..1c6e88338724 100644 --- a/vms/platformvm/state/disk_staker_diff_iterator.go +++ b/vms/platformvm/state/disk_staker_diff_iterator.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/platformvm/state/disk_staker_diff_iterator_test.go b/vms/platformvm/state/disk_staker_diff_iterator_test.go index 543f42a4b9c3..af719e7a0beb 100644 --- a/vms/platformvm/state/disk_staker_diff_iterator_test.go +++ b/vms/platformvm/state/disk_staker_diff_iterator_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/platformvm/state/empty_iterator.go b/vms/platformvm/state/empty_iterator.go index 69766c194fce..3ec5f04f82a9 100644 --- a/vms/platformvm/state/empty_iterator.go +++ b/vms/platformvm/state/empty_iterator.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/platformvm/state/empty_iterator_test.go b/vms/platformvm/state/empty_iterator_test.go index b5bb43d1f640..19cd4f06dc06 100644 --- a/vms/platformvm/state/empty_iterator_test.go +++ b/vms/platformvm/state/empty_iterator_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/platformvm/state/masked_iterator.go b/vms/platformvm/state/masked_iterator.go index 8551a05889f6..9ceee9712b40 100644 --- a/vms/platformvm/state/masked_iterator.go +++ b/vms/platformvm/state/masked_iterator.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/platformvm/state/masked_iterator_test.go b/vms/platformvm/state/masked_iterator_test.go index 8ba719d3e732..ccc37d6ffb3d 100644 --- a/vms/platformvm/state/masked_iterator_test.go +++ b/vms/platformvm/state/masked_iterator_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/platformvm/state/merged_iterator.go b/vms/platformvm/state/merged_iterator.go index 6c5bdafe801e..059001b3144f 100644 --- a/vms/platformvm/state/merged_iterator.go +++ b/vms/platformvm/state/merged_iterator.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/platformvm/state/merged_iterator_test.go b/vms/platformvm/state/merged_iterator_test.go index c85b35941b0f..e6cd52451f73 100644 --- a/vms/platformvm/state/merged_iterator_test.go +++ b/vms/platformvm/state/merged_iterator_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/platformvm/state/metadata_codec.go b/vms/platformvm/state/metadata_codec.go index 291d425c67bb..400d23e29af2 100644 --- a/vms/platformvm/state/metadata_codec.go +++ b/vms/platformvm/state/metadata_codec.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/platformvm/state/metadata_delegator.go b/vms/platformvm/state/metadata_delegator.go index 9e9ed42d2108..06099d813cde 100644 --- a/vms/platformvm/state/metadata_delegator.go +++ b/vms/platformvm/state/metadata_delegator.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/platformvm/state/metadata_delegator_test.go b/vms/platformvm/state/metadata_delegator_test.go index 67eceb62ad10..9c9d6c1c0044 100644 --- a/vms/platformvm/state/metadata_delegator_test.go +++ b/vms/platformvm/state/metadata_delegator_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/platformvm/state/metadata_validator.go b/vms/platformvm/state/metadata_validator.go index 84704cb7a5b7..0c725368505b 100644 --- a/vms/platformvm/state/metadata_validator.go +++ b/vms/platformvm/state/metadata_validator.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/platformvm/state/metadata_validator_test.go b/vms/platformvm/state/metadata_validator_test.go index bb5cf6a5bd08..3a041a26b2eb 100644 --- a/vms/platformvm/state/metadata_validator_test.go +++ b/vms/platformvm/state/metadata_validator_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/platformvm/state/slice_iterator_test.go b/vms/platformvm/state/slice_iterator_test.go index 96a686cddf92..408ffe837a27 100644 --- a/vms/platformvm/state/slice_iterator_test.go +++ b/vms/platformvm/state/slice_iterator_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/platformvm/state/staker.go b/vms/platformvm/state/staker.go index ae070f3c91d2..a9ba52595062 100644 --- a/vms/platformvm/state/staker.go +++ b/vms/platformvm/state/staker.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/platformvm/state/staker_diff_iterator.go b/vms/platformvm/state/staker_diff_iterator.go index d9c194cd2702..d47ab49ac572 100644 --- a/vms/platformvm/state/staker_diff_iterator.go +++ b/vms/platformvm/state/staker_diff_iterator.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/platformvm/state/staker_diff_iterator_test.go b/vms/platformvm/state/staker_diff_iterator_test.go index c008b06fb716..468b8800a23d 100644 --- a/vms/platformvm/state/staker_diff_iterator_test.go +++ b/vms/platformvm/state/staker_diff_iterator_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/platformvm/state/staker_status.go b/vms/platformvm/state/staker_status.go index b74064c4dc0b..0adc46244f92 100644 --- a/vms/platformvm/state/staker_status.go +++ b/vms/platformvm/state/staker_status.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/platformvm/state/staker_test.go b/vms/platformvm/state/staker_test.go index f4a7b8657997..1b72385dbd13 100644 --- a/vms/platformvm/state/staker_test.go +++ b/vms/platformvm/state/staker_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/platformvm/state/stakers.go b/vms/platformvm/state/stakers.go index 5276ff4f8204..f787749f72df 100644 --- a/vms/platformvm/state/stakers.go +++ b/vms/platformvm/state/stakers.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/platformvm/state/stakers_test.go b/vms/platformvm/state/stakers_test.go index 9894d9479653..5c6d9a8b28f8 100644 --- a/vms/platformvm/state/stakers_test.go +++ b/vms/platformvm/state/stakers_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/platformvm/state/state.go b/vms/platformvm/state/state.go index 2c7785e8d5c7..92e646ed6975 100644 --- a/vms/platformvm/state/state.go +++ b/vms/platformvm/state/state.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/platformvm/state/state_test.go b/vms/platformvm/state/state_test.go index 8adcbba07a4b..6986f15a0aa0 100644 --- a/vms/platformvm/state/state_test.go +++ b/vms/platformvm/state/state_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/platformvm/state/tree_iterator.go b/vms/platformvm/state/tree_iterator.go index a71b35e21346..920bc1377902 100644 --- a/vms/platformvm/state/tree_iterator.go +++ b/vms/platformvm/state/tree_iterator.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/platformvm/state/tree_iterator_test.go b/vms/platformvm/state/tree_iterator_test.go index 57fa5727a4f4..7047d350bae1 100644 --- a/vms/platformvm/state/tree_iterator_test.go +++ b/vms/platformvm/state/tree_iterator_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/platformvm/state/versions.go b/vms/platformvm/state/versions.go index da84182bb683..6afb0fe8e5f2 100644 --- a/vms/platformvm/state/versions.go +++ b/vms/platformvm/state/versions.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/platformvm/status/blockchain_status.go b/vms/platformvm/status/blockchain_status.go index 1ab25e588b3d..5d427e5a9383 100644 --- a/vms/platformvm/status/blockchain_status.go +++ b/vms/platformvm/status/blockchain_status.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package status diff --git a/vms/platformvm/status/blockchain_status_test.go b/vms/platformvm/status/blockchain_status_test.go index 97b96badcb93..d0710d2f2cb1 100644 --- a/vms/platformvm/status/blockchain_status_test.go +++ b/vms/platformvm/status/blockchain_status_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package status diff --git a/vms/platformvm/status/status.go b/vms/platformvm/status/status.go index a67fb6c38e81..2a674250d20e 100644 --- a/vms/platformvm/status/status.go +++ b/vms/platformvm/status/status.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package status diff --git a/vms/platformvm/status/status_test.go b/vms/platformvm/status/status_test.go index 59316f983722..cd6ed5f814f7 100644 --- a/vms/platformvm/status/status_test.go +++ b/vms/platformvm/status/status_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package status diff --git a/vms/platformvm/txs/add_delegator_test.go b/vms/platformvm/txs/add_delegator_test.go index 1989690bb173..ac3290fb2431 100644 --- a/vms/platformvm/txs/add_delegator_test.go +++ b/vms/platformvm/txs/add_delegator_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/platformvm/txs/add_delegator_tx.go b/vms/platformvm/txs/add_delegator_tx.go index af328cc693bf..3df97cf0af74 100644 --- a/vms/platformvm/txs/add_delegator_tx.go +++ b/vms/platformvm/txs/add_delegator_tx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/platformvm/txs/add_permissionless_delegator_tx.go b/vms/platformvm/txs/add_permissionless_delegator_tx.go index 346a80dd61f7..9c29b97339d0 100644 --- a/vms/platformvm/txs/add_permissionless_delegator_tx.go +++ b/vms/platformvm/txs/add_permissionless_delegator_tx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/platformvm/txs/add_permissionless_delegator_tx_test.go b/vms/platformvm/txs/add_permissionless_delegator_tx_test.go index 79a91c16e485..1099e910f09b 100644 --- a/vms/platformvm/txs/add_permissionless_delegator_tx_test.go +++ b/vms/platformvm/txs/add_permissionless_delegator_tx_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/platformvm/txs/add_permissionless_validator_tx.go b/vms/platformvm/txs/add_permissionless_validator_tx.go index 34b13129ade8..0f655c8daea4 100644 --- a/vms/platformvm/txs/add_permissionless_validator_tx.go +++ b/vms/platformvm/txs/add_permissionless_validator_tx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/platformvm/txs/add_permissionless_validator_tx_test.go b/vms/platformvm/txs/add_permissionless_validator_tx_test.go index aed095b16af9..58dd373010b7 100644 --- a/vms/platformvm/txs/add_permissionless_validator_tx_test.go +++ b/vms/platformvm/txs/add_permissionless_validator_tx_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/platformvm/txs/add_subnet_validator_test.go b/vms/platformvm/txs/add_subnet_validator_test.go index c1f68cb664c1..8dc8d76782ac 100644 --- a/vms/platformvm/txs/add_subnet_validator_test.go +++ b/vms/platformvm/txs/add_subnet_validator_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/platformvm/txs/add_subnet_validator_tx.go b/vms/platformvm/txs/add_subnet_validator_tx.go index 53fd43562c02..b6ce0d0fe4da 100644 --- a/vms/platformvm/txs/add_subnet_validator_tx.go +++ b/vms/platformvm/txs/add_subnet_validator_tx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/platformvm/txs/add_validator_test.go b/vms/platformvm/txs/add_validator_test.go index 4046d7c0d984..daf32f66746d 100644 --- a/vms/platformvm/txs/add_validator_test.go +++ b/vms/platformvm/txs/add_validator_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/platformvm/txs/add_validator_tx.go b/vms/platformvm/txs/add_validator_tx.go index a0e82dba7c77..b6ab65b56e8f 100644 --- a/vms/platformvm/txs/add_validator_tx.go +++ b/vms/platformvm/txs/add_validator_tx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/platformvm/txs/advance_time_tx.go b/vms/platformvm/txs/advance_time_tx.go index fc889da9ef0b..80b277fcb7e5 100644 --- a/vms/platformvm/txs/advance_time_tx.go +++ b/vms/platformvm/txs/advance_time_tx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/platformvm/txs/base_tx.go b/vms/platformvm/txs/base_tx.go index 5ffb308fe425..8a0be1edd76c 100644 --- a/vms/platformvm/txs/base_tx.go +++ b/vms/platformvm/txs/base_tx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/platformvm/txs/base_tx_test.go b/vms/platformvm/txs/base_tx_test.go index 7c2dc3ad5208..14bfc7b2f236 100644 --- a/vms/platformvm/txs/base_tx_test.go +++ b/vms/platformvm/txs/base_tx_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/platformvm/txs/builder/builder.go b/vms/platformvm/txs/builder/builder.go index 6c796d085abb..3427bf2b1015 100644 --- a/vms/platformvm/txs/builder/builder.go +++ b/vms/platformvm/txs/builder/builder.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package builder diff --git a/vms/platformvm/txs/codec.go b/vms/platformvm/txs/codec.go index 0d011f246546..c0c300c4d79b 100644 --- a/vms/platformvm/txs/codec.go +++ b/vms/platformvm/txs/codec.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/platformvm/txs/create_chain_test.go b/vms/platformvm/txs/create_chain_test.go index ae2217c5b605..787aaa2a7ccb 100644 --- a/vms/platformvm/txs/create_chain_test.go +++ b/vms/platformvm/txs/create_chain_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/platformvm/txs/create_chain_tx.go b/vms/platformvm/txs/create_chain_tx.go index 37166e91ff98..84a9c72f43b3 100644 --- a/vms/platformvm/txs/create_chain_tx.go +++ b/vms/platformvm/txs/create_chain_tx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/platformvm/txs/create_subnet_tx.go b/vms/platformvm/txs/create_subnet_tx.go index 02f41faefe4c..e560c9dd5f94 100644 --- a/vms/platformvm/txs/create_subnet_tx.go +++ b/vms/platformvm/txs/create_subnet_tx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/platformvm/txs/executor/advance_time_test.go b/vms/platformvm/txs/executor/advance_time_test.go index 9db644f4c1be..bb66c7ef7f82 100644 --- a/vms/platformvm/txs/executor/advance_time_test.go +++ b/vms/platformvm/txs/executor/advance_time_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/platformvm/txs/executor/atomic_tx_executor.go b/vms/platformvm/txs/executor/atomic_tx_executor.go index 3b7dc60ec173..2a35cb45eeab 100644 --- a/vms/platformvm/txs/executor/atomic_tx_executor.go +++ b/vms/platformvm/txs/executor/atomic_tx_executor.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/platformvm/txs/executor/backend.go b/vms/platformvm/txs/executor/backend.go index f043521a56bc..a5e017090701 100644 --- a/vms/platformvm/txs/executor/backend.go +++ b/vms/platformvm/txs/executor/backend.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/platformvm/txs/executor/create_chain_test.go b/vms/platformvm/txs/executor/create_chain_test.go index ab733337bf63..3b0502616473 100644 --- a/vms/platformvm/txs/executor/create_chain_test.go +++ b/vms/platformvm/txs/executor/create_chain_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/platformvm/txs/executor/create_subnet_test.go b/vms/platformvm/txs/executor/create_subnet_test.go index 8b33f2a7734a..158eded74867 100644 --- a/vms/platformvm/txs/executor/create_subnet_test.go +++ b/vms/platformvm/txs/executor/create_subnet_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/platformvm/txs/executor/export_test.go b/vms/platformvm/txs/executor/export_test.go index 1369a5f8bbf3..1272d2815142 100644 --- a/vms/platformvm/txs/executor/export_test.go +++ b/vms/platformvm/txs/executor/export_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/platformvm/txs/executor/helpers_test.go b/vms/platformvm/txs/executor/helpers_test.go index b72c136b5e54..b18498fac1e1 100644 --- a/vms/platformvm/txs/executor/helpers_test.go +++ b/vms/platformvm/txs/executor/helpers_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/platformvm/txs/executor/import_test.go b/vms/platformvm/txs/executor/import_test.go index 9144a92873b1..5d281da57185 100644 --- a/vms/platformvm/txs/executor/import_test.go +++ b/vms/platformvm/txs/executor/import_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/platformvm/txs/executor/proposal_tx_executor.go b/vms/platformvm/txs/executor/proposal_tx_executor.go index bd329b3f2576..c3893be429d3 100644 --- a/vms/platformvm/txs/executor/proposal_tx_executor.go +++ b/vms/platformvm/txs/executor/proposal_tx_executor.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/platformvm/txs/executor/proposal_tx_executor_test.go b/vms/platformvm/txs/executor/proposal_tx_executor_test.go index 13ed27e7c5b2..930c0d9c253c 100644 --- a/vms/platformvm/txs/executor/proposal_tx_executor_test.go +++ b/vms/platformvm/txs/executor/proposal_tx_executor_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/platformvm/txs/executor/reward_validator_test.go b/vms/platformvm/txs/executor/reward_validator_test.go index 71c3e93f330e..973dea4de9be 100644 --- a/vms/platformvm/txs/executor/reward_validator_test.go +++ b/vms/platformvm/txs/executor/reward_validator_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/platformvm/txs/executor/staker_tx_verification.go b/vms/platformvm/txs/executor/staker_tx_verification.go index 5a260fd72cfc..a17bbbffc14d 100644 --- a/vms/platformvm/txs/executor/staker_tx_verification.go +++ b/vms/platformvm/txs/executor/staker_tx_verification.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/platformvm/txs/executor/staker_tx_verification_helpers.go b/vms/platformvm/txs/executor/staker_tx_verification_helpers.go index 24f5e1cba8d2..2fb875552b86 100644 --- a/vms/platformvm/txs/executor/staker_tx_verification_helpers.go +++ b/vms/platformvm/txs/executor/staker_tx_verification_helpers.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/platformvm/txs/executor/staker_tx_verification_test.go b/vms/platformvm/txs/executor/staker_tx_verification_test.go index 065e2cb54707..b59daf0da2b0 100644 --- a/vms/platformvm/txs/executor/staker_tx_verification_test.go +++ b/vms/platformvm/txs/executor/staker_tx_verification_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/platformvm/txs/executor/standard_tx_executor.go b/vms/platformvm/txs/executor/standard_tx_executor.go index 9bd5b140b314..e780673e6431 100644 --- a/vms/platformvm/txs/executor/standard_tx_executor.go +++ b/vms/platformvm/txs/executor/standard_tx_executor.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/platformvm/txs/executor/standard_tx_executor_test.go b/vms/platformvm/txs/executor/standard_tx_executor_test.go index a5617d13b69c..a86c579fee79 100644 --- a/vms/platformvm/txs/executor/standard_tx_executor_test.go +++ b/vms/platformvm/txs/executor/standard_tx_executor_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/platformvm/txs/executor/state_changes.go b/vms/platformvm/txs/executor/state_changes.go index 7b0c9355e195..2b327c4f8b96 100644 --- a/vms/platformvm/txs/executor/state_changes.go +++ b/vms/platformvm/txs/executor/state_changes.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/platformvm/txs/executor/subnet_tx_verification.go b/vms/platformvm/txs/executor/subnet_tx_verification.go index bf384be9fa89..f1a75f6f2f3f 100644 --- a/vms/platformvm/txs/executor/subnet_tx_verification.go +++ b/vms/platformvm/txs/executor/subnet_tx_verification.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/platformvm/txs/executor/tx_mempool_verifier.go b/vms/platformvm/txs/executor/tx_mempool_verifier.go index 378b742ae484..f2e7d09673e6 100644 --- a/vms/platformvm/txs/executor/tx_mempool_verifier.go +++ b/vms/platformvm/txs/executor/tx_mempool_verifier.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package executor diff --git a/vms/platformvm/txs/export_tx.go b/vms/platformvm/txs/export_tx.go index b124263aae12..19dc3a076f7a 100644 --- a/vms/platformvm/txs/export_tx.go +++ b/vms/platformvm/txs/export_tx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/platformvm/txs/import_tx.go b/vms/platformvm/txs/import_tx.go index 121986991012..563242dad34a 100644 --- a/vms/platformvm/txs/import_tx.go +++ b/vms/platformvm/txs/import_tx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/platformvm/txs/mempool/mempool.go b/vms/platformvm/txs/mempool/mempool.go index 63315d99c5fc..3f202cc3940d 100644 --- a/vms/platformvm/txs/mempool/mempool.go +++ b/vms/platformvm/txs/mempool/mempool.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package mempool diff --git a/vms/platformvm/txs/mempool/mempool_test.go b/vms/platformvm/txs/mempool/mempool_test.go index c4af0fc1c6db..6d569b50c6b2 100644 --- a/vms/platformvm/txs/mempool/mempool_test.go +++ b/vms/platformvm/txs/mempool/mempool_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package mempool diff --git a/vms/platformvm/txs/priorities.go b/vms/platformvm/txs/priorities.go index 6a4fb4dc10a9..a324bdae8e1c 100644 --- a/vms/platformvm/txs/priorities.go +++ b/vms/platformvm/txs/priorities.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/platformvm/txs/priorities_test.go b/vms/platformvm/txs/priorities_test.go index ce266d5d7adb..5e629a853ca1 100644 --- a/vms/platformvm/txs/priorities_test.go +++ b/vms/platformvm/txs/priorities_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/platformvm/txs/remove_subnet_validator_tx.go b/vms/platformvm/txs/remove_subnet_validator_tx.go index 2221c2f345ca..ef55cccea290 100644 --- a/vms/platformvm/txs/remove_subnet_validator_tx.go +++ b/vms/platformvm/txs/remove_subnet_validator_tx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/platformvm/txs/remove_subnet_validator_tx_test.go b/vms/platformvm/txs/remove_subnet_validator_tx_test.go index 45bf7483cf47..2890b6d8d103 100644 --- a/vms/platformvm/txs/remove_subnet_validator_tx_test.go +++ b/vms/platformvm/txs/remove_subnet_validator_tx_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/platformvm/txs/reward_validator_tx.go b/vms/platformvm/txs/reward_validator_tx.go index d4b579f1b95b..01b1e34bde46 100644 --- a/vms/platformvm/txs/reward_validator_tx.go +++ b/vms/platformvm/txs/reward_validator_tx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/platformvm/txs/staker_tx.go b/vms/platformvm/txs/staker_tx.go index 1cdcdcc337a8..8adb1ac23f7d 100644 --- a/vms/platformvm/txs/staker_tx.go +++ b/vms/platformvm/txs/staker_tx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/platformvm/txs/subnet_validator.go b/vms/platformvm/txs/subnet_validator.go index d9da9d31b739..a7c683f35a8f 100644 --- a/vms/platformvm/txs/subnet_validator.go +++ b/vms/platformvm/txs/subnet_validator.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/platformvm/txs/subnet_validator_test.go b/vms/platformvm/txs/subnet_validator_test.go index 7fcbf3e44e4e..cdfbeaf159a5 100644 --- a/vms/platformvm/txs/subnet_validator_test.go +++ b/vms/platformvm/txs/subnet_validator_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/platformvm/txs/transfer_subnet_ownership_tx.go b/vms/platformvm/txs/transfer_subnet_ownership_tx.go index 78dbf28b48b4..4fa2807809ce 100644 --- a/vms/platformvm/txs/transfer_subnet_ownership_tx.go +++ b/vms/platformvm/txs/transfer_subnet_ownership_tx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/platformvm/txs/transfer_subnet_ownership_tx_test.go b/vms/platformvm/txs/transfer_subnet_ownership_tx_test.go index e1b57a589461..39866c138e2b 100644 --- a/vms/platformvm/txs/transfer_subnet_ownership_tx_test.go +++ b/vms/platformvm/txs/transfer_subnet_ownership_tx_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/platformvm/txs/transform_subnet_tx.go b/vms/platformvm/txs/transform_subnet_tx.go index f540ea674f4c..1ba543e1aa05 100644 --- a/vms/platformvm/txs/transform_subnet_tx.go +++ b/vms/platformvm/txs/transform_subnet_tx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/platformvm/txs/transform_subnet_tx_test.go b/vms/platformvm/txs/transform_subnet_tx_test.go index 7a9b0b6981be..d5a237667ded 100644 --- a/vms/platformvm/txs/transform_subnet_tx_test.go +++ b/vms/platformvm/txs/transform_subnet_tx_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/platformvm/txs/tx.go b/vms/platformvm/txs/tx.go index 52ee3f80b29c..9874f66e0468 100644 --- a/vms/platformvm/txs/tx.go +++ b/vms/platformvm/txs/tx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/platformvm/txs/txheap/by_end_time.go b/vms/platformvm/txs/txheap/by_end_time.go index 2499ce971bc9..9cbba82cef07 100644 --- a/vms/platformvm/txs/txheap/by_end_time.go +++ b/vms/platformvm/txs/txheap/by_end_time.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txheap diff --git a/vms/platformvm/txs/txheap/by_end_time_test.go b/vms/platformvm/txs/txheap/by_end_time_test.go index 5d95a2c66ad7..a629b7b1c3bd 100644 --- a/vms/platformvm/txs/txheap/by_end_time_test.go +++ b/vms/platformvm/txs/txheap/by_end_time_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txheap diff --git a/vms/platformvm/txs/txheap/heap.go b/vms/platformvm/txs/txheap/heap.go index 3727bb891d92..7c9e33d3f989 100644 --- a/vms/platformvm/txs/txheap/heap.go +++ b/vms/platformvm/txs/txheap/heap.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txheap diff --git a/vms/platformvm/txs/unsigned_tx.go b/vms/platformvm/txs/unsigned_tx.go index 7fe1702b0197..5b3e62dd1c33 100644 --- a/vms/platformvm/txs/unsigned_tx.go +++ b/vms/platformvm/txs/unsigned_tx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/platformvm/txs/validator.go b/vms/platformvm/txs/validator.go index e8f4a6150806..726ba23b1c5d 100644 --- a/vms/platformvm/txs/validator.go +++ b/vms/platformvm/txs/validator.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/platformvm/txs/validator_test.go b/vms/platformvm/txs/validator_test.go index b51873ad4ee4..0b9e749ca009 100644 --- a/vms/platformvm/txs/validator_test.go +++ b/vms/platformvm/txs/validator_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/platformvm/txs/visitor.go b/vms/platformvm/txs/visitor.go index 05a21c355801..b3fc55af4cf3 100644 --- a/vms/platformvm/txs/visitor.go +++ b/vms/platformvm/txs/visitor.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package txs diff --git a/vms/platformvm/utxo/handler.go b/vms/platformvm/utxo/handler.go index 37f53238e4cb..f22a76fd0b8f 100644 --- a/vms/platformvm/utxo/handler.go +++ b/vms/platformvm/utxo/handler.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package utxo diff --git a/vms/platformvm/utxo/handler_test.go b/vms/platformvm/utxo/handler_test.go index 4f1e2e00e8d7..d0224ed4666a 100644 --- a/vms/platformvm/utxo/handler_test.go +++ b/vms/platformvm/utxo/handler_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package utxo diff --git a/vms/platformvm/validator_set_property_test.go b/vms/platformvm/validator_set_property_test.go index 630124f99009..5ca5bfd6c241 100644 --- a/vms/platformvm/validator_set_property_test.go +++ b/vms/platformvm/validator_set_property_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package platformvm diff --git a/vms/platformvm/validators/manager.go b/vms/platformvm/validators/manager.go index a4c5c87a3040..2c8b025a128b 100644 --- a/vms/platformvm/validators/manager.go +++ b/vms/platformvm/validators/manager.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package validators diff --git a/vms/platformvm/validators/manager_benchmark_test.go b/vms/platformvm/validators/manager_benchmark_test.go index 0664c085c942..7c84589574df 100644 --- a/vms/platformvm/validators/manager_benchmark_test.go +++ b/vms/platformvm/validators/manager_benchmark_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package validators diff --git a/vms/platformvm/validators/test_manager.go b/vms/platformvm/validators/test_manager.go index d7ffe993248e..e04742f265c7 100644 --- a/vms/platformvm/validators/test_manager.go +++ b/vms/platformvm/validators/test_manager.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package validators diff --git a/vms/platformvm/vm.go b/vms/platformvm/vm.go index 10dc515a5a62..341e5329666c 100644 --- a/vms/platformvm/vm.go +++ b/vms/platformvm/vm.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package platformvm diff --git a/vms/platformvm/vm_regression_test.go b/vms/platformvm/vm_regression_test.go index 8dbf16cab605..36186ec32ae0 100644 --- a/vms/platformvm/vm_regression_test.go +++ b/vms/platformvm/vm_regression_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package platformvm diff --git a/vms/platformvm/vm_test.go b/vms/platformvm/vm_test.go index 7ac1638f8b84..23e88a646368 100644 --- a/vms/platformvm/vm_test.go +++ b/vms/platformvm/vm_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package platformvm diff --git a/vms/platformvm/warp/codec.go b/vms/platformvm/warp/codec.go index 937cca628ad9..78b194eb6291 100644 --- a/vms/platformvm/warp/codec.go +++ b/vms/platformvm/warp/codec.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package warp diff --git a/vms/platformvm/warp/constants.go b/vms/platformvm/warp/constants.go index a91f5f39394f..723cdf50bc82 100644 --- a/vms/platformvm/warp/constants.go +++ b/vms/platformvm/warp/constants.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package warp diff --git a/vms/platformvm/warp/gwarp/client.go b/vms/platformvm/warp/gwarp/client.go index 6619b4ff6ab7..0b51a54971f7 100644 --- a/vms/platformvm/warp/gwarp/client.go +++ b/vms/platformvm/warp/gwarp/client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package gwarp diff --git a/vms/platformvm/warp/gwarp/server.go b/vms/platformvm/warp/gwarp/server.go index 4fbee3a3e736..7857f4e0ee70 100644 --- a/vms/platformvm/warp/gwarp/server.go +++ b/vms/platformvm/warp/gwarp/server.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package gwarp diff --git a/vms/platformvm/warp/gwarp/signer_test.go b/vms/platformvm/warp/gwarp/signer_test.go index d1d6e8f7147d..306067dc883d 100644 --- a/vms/platformvm/warp/gwarp/signer_test.go +++ b/vms/platformvm/warp/gwarp/signer_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package gwarp diff --git a/vms/platformvm/warp/message.go b/vms/platformvm/warp/message.go index 454ab9482d17..76383bdafa11 100644 --- a/vms/platformvm/warp/message.go +++ b/vms/platformvm/warp/message.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package warp diff --git a/vms/platformvm/warp/message_test.go b/vms/platformvm/warp/message_test.go index 910abd3403c9..99a50b366d95 100644 --- a/vms/platformvm/warp/message_test.go +++ b/vms/platformvm/warp/message_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package warp diff --git a/vms/platformvm/warp/payload/addressed_call.go b/vms/platformvm/warp/payload/addressed_call.go index afdecd9e9f01..b3617ce487da 100644 --- a/vms/platformvm/warp/payload/addressed_call.go +++ b/vms/platformvm/warp/payload/addressed_call.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package payload diff --git a/vms/platformvm/warp/payload/addressed_call_test.go b/vms/platformvm/warp/payload/addressed_call_test.go index 0e60ef294c4b..77a885d836d5 100644 --- a/vms/platformvm/warp/payload/addressed_call_test.go +++ b/vms/platformvm/warp/payload/addressed_call_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package payload diff --git a/vms/platformvm/warp/payload/codec.go b/vms/platformvm/warp/payload/codec.go index 57642968e9e5..906b86bc09ed 100644 --- a/vms/platformvm/warp/payload/codec.go +++ b/vms/platformvm/warp/payload/codec.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package payload diff --git a/vms/platformvm/warp/payload/hash.go b/vms/platformvm/warp/payload/hash.go index f3a0eb0c09d3..330f74fd869d 100644 --- a/vms/platformvm/warp/payload/hash.go +++ b/vms/platformvm/warp/payload/hash.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package payload diff --git a/vms/platformvm/warp/payload/hash_test.go b/vms/platformvm/warp/payload/hash_test.go index 1d890a8bd551..d58fe5e6a0c0 100644 --- a/vms/platformvm/warp/payload/hash_test.go +++ b/vms/platformvm/warp/payload/hash_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package payload diff --git a/vms/platformvm/warp/payload/payload.go b/vms/platformvm/warp/payload/payload.go index dbed48ae9c29..c5c09464803e 100644 --- a/vms/platformvm/warp/payload/payload.go +++ b/vms/platformvm/warp/payload/payload.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package payload diff --git a/vms/platformvm/warp/payload/payload_test.go b/vms/platformvm/warp/payload/payload_test.go index da14b8de0dbb..86b584ae33db 100644 --- a/vms/platformvm/warp/payload/payload_test.go +++ b/vms/platformvm/warp/payload/payload_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package payload diff --git a/vms/platformvm/warp/signature.go b/vms/platformvm/warp/signature.go index 2f2b0cae985b..667383376501 100644 --- a/vms/platformvm/warp/signature.go +++ b/vms/platformvm/warp/signature.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package warp diff --git a/vms/platformvm/warp/signature_test.go b/vms/platformvm/warp/signature_test.go index c721eb62938d..b50891ede5d4 100644 --- a/vms/platformvm/warp/signature_test.go +++ b/vms/platformvm/warp/signature_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package warp diff --git a/vms/platformvm/warp/signer.go b/vms/platformvm/warp/signer.go index 76f8ec02b4cd..8372aef0a728 100644 --- a/vms/platformvm/warp/signer.go +++ b/vms/platformvm/warp/signer.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package warp diff --git a/vms/platformvm/warp/signer_test.go b/vms/platformvm/warp/signer_test.go index d4e83c24a850..1bc177872d87 100644 --- a/vms/platformvm/warp/signer_test.go +++ b/vms/platformvm/warp/signer_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package warp diff --git a/vms/platformvm/warp/test_signer.go b/vms/platformvm/warp/test_signer.go index aef578f78ae2..c17b15b215e2 100644 --- a/vms/platformvm/warp/test_signer.go +++ b/vms/platformvm/warp/test_signer.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package warp diff --git a/vms/platformvm/warp/unsigned_message.go b/vms/platformvm/warp/unsigned_message.go index 873f6995357d..1e66f552c9fa 100644 --- a/vms/platformvm/warp/unsigned_message.go +++ b/vms/platformvm/warp/unsigned_message.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package warp diff --git a/vms/platformvm/warp/unsigned_message_test.go b/vms/platformvm/warp/unsigned_message_test.go index f3be73ef6c77..03a140d14c27 100644 --- a/vms/platformvm/warp/unsigned_message_test.go +++ b/vms/platformvm/warp/unsigned_message_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package warp diff --git a/vms/platformvm/warp/validator.go b/vms/platformvm/warp/validator.go index 5e193ae1815e..2ada068adc76 100644 --- a/vms/platformvm/warp/validator.go +++ b/vms/platformvm/warp/validator.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package warp diff --git a/vms/platformvm/warp/validator_test.go b/vms/platformvm/warp/validator_test.go index 9af37aed81f6..3fbaf8860dbe 100644 --- a/vms/platformvm/warp/validator_test.go +++ b/vms/platformvm/warp/validator_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package warp diff --git a/vms/propertyfx/burn_operation.go b/vms/propertyfx/burn_operation.go index 4217420b3b62..1dedb4c2f448 100644 --- a/vms/propertyfx/burn_operation.go +++ b/vms/propertyfx/burn_operation.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package propertyfx diff --git a/vms/propertyfx/burn_operation_test.go b/vms/propertyfx/burn_operation_test.go index e9e9735efd3c..b6a995b0307c 100644 --- a/vms/propertyfx/burn_operation_test.go +++ b/vms/propertyfx/burn_operation_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package propertyfx diff --git a/vms/propertyfx/credential.go b/vms/propertyfx/credential.go index 0a67c182a995..3a464cc29dfe 100644 --- a/vms/propertyfx/credential.go +++ b/vms/propertyfx/credential.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package propertyfx diff --git a/vms/propertyfx/credential_test.go b/vms/propertyfx/credential_test.go index 4be34acd3247..3ce9bc97f3c3 100644 --- a/vms/propertyfx/credential_test.go +++ b/vms/propertyfx/credential_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package propertyfx diff --git a/vms/propertyfx/factory.go b/vms/propertyfx/factory.go index 21c69c97cd98..c42b92c84c5f 100644 --- a/vms/propertyfx/factory.go +++ b/vms/propertyfx/factory.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package propertyfx diff --git a/vms/propertyfx/factory_test.go b/vms/propertyfx/factory_test.go index ec921aef3f69..f40cb2610a80 100644 --- a/vms/propertyfx/factory_test.go +++ b/vms/propertyfx/factory_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package propertyfx diff --git a/vms/propertyfx/fx.go b/vms/propertyfx/fx.go index 28d211a9b5ad..24a3dff171cb 100644 --- a/vms/propertyfx/fx.go +++ b/vms/propertyfx/fx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package propertyfx diff --git a/vms/propertyfx/fx_test.go b/vms/propertyfx/fx_test.go index fdab69bb5bf4..10a96e6e5b0b 100644 --- a/vms/propertyfx/fx_test.go +++ b/vms/propertyfx/fx_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package propertyfx diff --git a/vms/propertyfx/mint_operation.go b/vms/propertyfx/mint_operation.go index 535ea1359010..7eecf5de27ad 100644 --- a/vms/propertyfx/mint_operation.go +++ b/vms/propertyfx/mint_operation.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package propertyfx diff --git a/vms/propertyfx/mint_operation_test.go b/vms/propertyfx/mint_operation_test.go index 138d989d3296..abcc552ace4c 100644 --- a/vms/propertyfx/mint_operation_test.go +++ b/vms/propertyfx/mint_operation_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package propertyfx diff --git a/vms/propertyfx/mint_output.go b/vms/propertyfx/mint_output.go index 3aebd115a404..7ff60375721c 100644 --- a/vms/propertyfx/mint_output.go +++ b/vms/propertyfx/mint_output.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package propertyfx diff --git a/vms/propertyfx/mint_output_test.go b/vms/propertyfx/mint_output_test.go index 0b4b76c55f88..4cfa1da038d8 100644 --- a/vms/propertyfx/mint_output_test.go +++ b/vms/propertyfx/mint_output_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package propertyfx diff --git a/vms/propertyfx/owned_output.go b/vms/propertyfx/owned_output.go index 30e32ca3ddf2..cbe2f4376753 100644 --- a/vms/propertyfx/owned_output.go +++ b/vms/propertyfx/owned_output.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package propertyfx diff --git a/vms/propertyfx/owned_output_test.go b/vms/propertyfx/owned_output_test.go index dbc7bea63698..a9c9adc57643 100644 --- a/vms/propertyfx/owned_output_test.go +++ b/vms/propertyfx/owned_output_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package propertyfx diff --git a/vms/proposervm/batched_vm.go b/vms/proposervm/batched_vm.go index fd104318cea7..ff1ce6a597a0 100644 --- a/vms/proposervm/batched_vm.go +++ b/vms/proposervm/batched_vm.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package proposervm diff --git a/vms/proposervm/batched_vm_test.go b/vms/proposervm/batched_vm_test.go index 476b12e32bc3..27cdaba0493f 100644 --- a/vms/proposervm/batched_vm_test.go +++ b/vms/proposervm/batched_vm_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package proposervm diff --git a/vms/proposervm/block.go b/vms/proposervm/block.go index fa53d2727968..10a151952a10 100644 --- a/vms/proposervm/block.go +++ b/vms/proposervm/block.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package proposervm diff --git a/vms/proposervm/block/block.go b/vms/proposervm/block/block.go index c4abe5a9f96d..fccbbe2e3718 100644 --- a/vms/proposervm/block/block.go +++ b/vms/proposervm/block/block.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/vms/proposervm/block/block_test.go b/vms/proposervm/block/block_test.go index d0b1a817b941..8a8a57ae3b9d 100644 --- a/vms/proposervm/block/block_test.go +++ b/vms/proposervm/block/block_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/vms/proposervm/block/build.go b/vms/proposervm/block/build.go index c6f18020507f..7baa89205342 100644 --- a/vms/proposervm/block/build.go +++ b/vms/proposervm/block/build.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/vms/proposervm/block/build_test.go b/vms/proposervm/block/build_test.go index 30bdd79460f8..8388e8a434f8 100644 --- a/vms/proposervm/block/build_test.go +++ b/vms/proposervm/block/build_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/vms/proposervm/block/codec.go b/vms/proposervm/block/codec.go index fc6910377d47..d3ccce4f1d43 100644 --- a/vms/proposervm/block/codec.go +++ b/vms/proposervm/block/codec.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/vms/proposervm/block/header.go b/vms/proposervm/block/header.go index 0098ab7e1932..83c4e813c806 100644 --- a/vms/proposervm/block/header.go +++ b/vms/proposervm/block/header.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/vms/proposervm/block/header_test.go b/vms/proposervm/block/header_test.go index bdbfaf3be0fd..a4db59385f01 100644 --- a/vms/proposervm/block/header_test.go +++ b/vms/proposervm/block/header_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/vms/proposervm/block/option.go b/vms/proposervm/block/option.go index 180b90e31fd6..c80651b621fc 100644 --- a/vms/proposervm/block/option.go +++ b/vms/proposervm/block/option.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/vms/proposervm/block/option_test.go b/vms/proposervm/block/option_test.go index f6d4f409650d..d5af9c100079 100644 --- a/vms/proposervm/block/option_test.go +++ b/vms/proposervm/block/option_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/vms/proposervm/block/parse.go b/vms/proposervm/block/parse.go index 1a55e5045981..cf275134d888 100644 --- a/vms/proposervm/block/parse.go +++ b/vms/proposervm/block/parse.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/vms/proposervm/block/parse_test.go b/vms/proposervm/block/parse_test.go index 43a10671e7f5..1d04271c9fec 100644 --- a/vms/proposervm/block/parse_test.go +++ b/vms/proposervm/block/parse_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package block diff --git a/vms/proposervm/block_server.go b/vms/proposervm/block_server.go index e9e2e192a4e5..6a056c8bc827 100644 --- a/vms/proposervm/block_server.go +++ b/vms/proposervm/block_server.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package proposervm diff --git a/vms/proposervm/block_test.go b/vms/proposervm/block_test.go index 35e3da7deee4..fea216120811 100644 --- a/vms/proposervm/block_test.go +++ b/vms/proposervm/block_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package proposervm diff --git a/vms/proposervm/config.go b/vms/proposervm/config.go index 6e4ed9576925..a7eb4ff0db9b 100644 --- a/vms/proposervm/config.go +++ b/vms/proposervm/config.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package proposervm diff --git a/vms/proposervm/height_indexed_vm.go b/vms/proposervm/height_indexed_vm.go index 6c8d6967ee14..a29334f6d8dd 100644 --- a/vms/proposervm/height_indexed_vm.go +++ b/vms/proposervm/height_indexed_vm.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package proposervm diff --git a/vms/proposervm/indexer/block_server.go b/vms/proposervm/indexer/block_server.go index e817b9bad830..fcecaf9e9fcf 100644 --- a/vms/proposervm/indexer/block_server.go +++ b/vms/proposervm/indexer/block_server.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package indexer diff --git a/vms/proposervm/indexer/block_server_test.go b/vms/proposervm/indexer/block_server_test.go index e132926c811c..a973d66a05a9 100644 --- a/vms/proposervm/indexer/block_server_test.go +++ b/vms/proposervm/indexer/block_server_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package indexer diff --git a/vms/proposervm/indexer/height_indexer.go b/vms/proposervm/indexer/height_indexer.go index 697570306f6b..c0a1e4155b3b 100644 --- a/vms/proposervm/indexer/height_indexer.go +++ b/vms/proposervm/indexer/height_indexer.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package indexer diff --git a/vms/proposervm/indexer/height_indexer_test.go b/vms/proposervm/indexer/height_indexer_test.go index 0ff9ebcdbb59..2a093530048a 100644 --- a/vms/proposervm/indexer/height_indexer_test.go +++ b/vms/proposervm/indexer/height_indexer_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package indexer diff --git a/vms/proposervm/main_test.go b/vms/proposervm/main_test.go index 913e29613f1c..72165ddb6e78 100644 --- a/vms/proposervm/main_test.go +++ b/vms/proposervm/main_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package proposervm diff --git a/vms/proposervm/post_fork_block.go b/vms/proposervm/post_fork_block.go index 28d127d33f70..707b6dc327c7 100644 --- a/vms/proposervm/post_fork_block.go +++ b/vms/proposervm/post_fork_block.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package proposervm diff --git a/vms/proposervm/post_fork_block_test.go b/vms/proposervm/post_fork_block_test.go index 4e4a35bf0761..a16d4a7d6219 100644 --- a/vms/proposervm/post_fork_block_test.go +++ b/vms/proposervm/post_fork_block_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package proposervm diff --git a/vms/proposervm/post_fork_option.go b/vms/proposervm/post_fork_option.go index 047a01c477fd..93cfd2550ca6 100644 --- a/vms/proposervm/post_fork_option.go +++ b/vms/proposervm/post_fork_option.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package proposervm diff --git a/vms/proposervm/post_fork_option_test.go b/vms/proposervm/post_fork_option_test.go index 26000f59ba33..dd16f8cdb518 100644 --- a/vms/proposervm/post_fork_option_test.go +++ b/vms/proposervm/post_fork_option_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package proposervm diff --git a/vms/proposervm/pre_fork_block.go b/vms/proposervm/pre_fork_block.go index 8e952d9d7758..199c1c98db7d 100644 --- a/vms/proposervm/pre_fork_block.go +++ b/vms/proposervm/pre_fork_block.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package proposervm diff --git a/vms/proposervm/pre_fork_block_test.go b/vms/proposervm/pre_fork_block_test.go index 6215a5c8465d..e6ff5346ea73 100644 --- a/vms/proposervm/pre_fork_block_test.go +++ b/vms/proposervm/pre_fork_block_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package proposervm diff --git a/vms/proposervm/proposer/validators.go b/vms/proposervm/proposer/validators.go index 89ed964d5983..6af996187b69 100644 --- a/vms/proposervm/proposer/validators.go +++ b/vms/proposervm/proposer/validators.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package proposer diff --git a/vms/proposervm/proposer/validators_test.go b/vms/proposervm/proposer/validators_test.go index 8be1f4c23d99..e86f2c806a14 100644 --- a/vms/proposervm/proposer/validators_test.go +++ b/vms/proposervm/proposer/validators_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package proposer diff --git a/vms/proposervm/proposer/windower.go b/vms/proposervm/proposer/windower.go index beb4a8253f68..6d1d958dd04a 100644 --- a/vms/proposervm/proposer/windower.go +++ b/vms/proposervm/proposer/windower.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package proposer diff --git a/vms/proposervm/proposer/windower_test.go b/vms/proposervm/proposer/windower_test.go index 5e3434bb9e38..d3e2ac68817a 100644 --- a/vms/proposervm/proposer/windower_test.go +++ b/vms/proposervm/proposer/windower_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package proposer diff --git a/vms/proposervm/scheduler/scheduler.go b/vms/proposervm/scheduler/scheduler.go index 5946a67b9b77..8395596a55a8 100644 --- a/vms/proposervm/scheduler/scheduler.go +++ b/vms/proposervm/scheduler/scheduler.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package scheduler diff --git a/vms/proposervm/scheduler/scheduler_test.go b/vms/proposervm/scheduler/scheduler_test.go index 821a36883e90..77ed39a67330 100644 --- a/vms/proposervm/scheduler/scheduler_test.go +++ b/vms/proposervm/scheduler/scheduler_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package scheduler diff --git a/vms/proposervm/state/block_height_index.go b/vms/proposervm/state/block_height_index.go index e16100bddd89..b60fca0c363d 100644 --- a/vms/proposervm/state/block_height_index.go +++ b/vms/proposervm/state/block_height_index.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/proposervm/state/block_state.go b/vms/proposervm/state/block_state.go index b0d6d6547c9a..88382f0abc67 100644 --- a/vms/proposervm/state/block_state.go +++ b/vms/proposervm/state/block_state.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/proposervm/state/block_state_test.go b/vms/proposervm/state/block_state_test.go index 0b50698e2d45..193f3854b4a9 100644 --- a/vms/proposervm/state/block_state_test.go +++ b/vms/proposervm/state/block_state_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/proposervm/state/chain_state.go b/vms/proposervm/state/chain_state.go index 0f1a1bfba4e8..e4ed34ddcb78 100644 --- a/vms/proposervm/state/chain_state.go +++ b/vms/proposervm/state/chain_state.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/proposervm/state/chain_state_test.go b/vms/proposervm/state/chain_state_test.go index ab14f4228281..6b45585f6041 100644 --- a/vms/proposervm/state/chain_state_test.go +++ b/vms/proposervm/state/chain_state_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/proposervm/state/codec.go b/vms/proposervm/state/codec.go index 6c1ecabd919c..21d30d24da86 100644 --- a/vms/proposervm/state/codec.go +++ b/vms/proposervm/state/codec.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/proposervm/state/state.go b/vms/proposervm/state/state.go index c8b80b947920..487e64f71f08 100644 --- a/vms/proposervm/state/state.go +++ b/vms/proposervm/state/state.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/proposervm/state/state_test.go b/vms/proposervm/state/state_test.go index 97980fc36b9b..9ef1e291e539 100644 --- a/vms/proposervm/state/state_test.go +++ b/vms/proposervm/state/state_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package state diff --git a/vms/proposervm/state_summary.go b/vms/proposervm/state_summary.go index 629d2c6491d1..f61c29d6f426 100644 --- a/vms/proposervm/state_summary.go +++ b/vms/proposervm/state_summary.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package proposervm diff --git a/vms/proposervm/state_syncable_vm.go b/vms/proposervm/state_syncable_vm.go index da86d8c36e5c..08a321cab7bb 100644 --- a/vms/proposervm/state_syncable_vm.go +++ b/vms/proposervm/state_syncable_vm.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package proposervm diff --git a/vms/proposervm/state_syncable_vm_test.go b/vms/proposervm/state_syncable_vm_test.go index 2e80c5973e86..c9b6d8b1a0dd 100644 --- a/vms/proposervm/state_syncable_vm_test.go +++ b/vms/proposervm/state_syncable_vm_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package proposervm diff --git a/vms/proposervm/summary/build.go b/vms/proposervm/summary/build.go index a166d3c6c33c..516f9d1a9e72 100644 --- a/vms/proposervm/summary/build.go +++ b/vms/proposervm/summary/build.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package summary diff --git a/vms/proposervm/summary/build_test.go b/vms/proposervm/summary/build_test.go index 0e15ac3cd1d7..ad7e5df52748 100644 --- a/vms/proposervm/summary/build_test.go +++ b/vms/proposervm/summary/build_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package summary diff --git a/vms/proposervm/summary/codec.go b/vms/proposervm/summary/codec.go index 188e6470f80f..3eaa15e88683 100644 --- a/vms/proposervm/summary/codec.go +++ b/vms/proposervm/summary/codec.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package summary diff --git a/vms/proposervm/summary/parse.go b/vms/proposervm/summary/parse.go index e4dd8733c091..670bd43a8d77 100644 --- a/vms/proposervm/summary/parse.go +++ b/vms/proposervm/summary/parse.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package summary diff --git a/vms/proposervm/summary/parse_test.go b/vms/proposervm/summary/parse_test.go index b22be83582e2..16fb2aec9f6b 100644 --- a/vms/proposervm/summary/parse_test.go +++ b/vms/proposervm/summary/parse_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package summary diff --git a/vms/proposervm/summary/state_summary.go b/vms/proposervm/summary/state_summary.go index 59269beb112c..14213a665fa6 100644 --- a/vms/proposervm/summary/state_summary.go +++ b/vms/proposervm/summary/state_summary.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package summary diff --git a/vms/proposervm/tree/tree.go b/vms/proposervm/tree/tree.go index 8d1e7333d32e..38125ba9d0e2 100644 --- a/vms/proposervm/tree/tree.go +++ b/vms/proposervm/tree/tree.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tree diff --git a/vms/proposervm/tree/tree_test.go b/vms/proposervm/tree/tree_test.go index 55b6e129341f..1e826e418c21 100644 --- a/vms/proposervm/tree/tree_test.go +++ b/vms/proposervm/tree/tree_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tree diff --git a/vms/proposervm/vm.go b/vms/proposervm/vm.go index 290846abe763..99dc045be66d 100644 --- a/vms/proposervm/vm.go +++ b/vms/proposervm/vm.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package proposervm diff --git a/vms/proposervm/vm_byzantine_test.go b/vms/proposervm/vm_byzantine_test.go index fcb230156c96..c9ad1b98c79b 100644 --- a/vms/proposervm/vm_byzantine_test.go +++ b/vms/proposervm/vm_byzantine_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package proposervm diff --git a/vms/proposervm/vm_regression_test.go b/vms/proposervm/vm_regression_test.go index cebc07b3ef43..168dd913d22a 100644 --- a/vms/proposervm/vm_regression_test.go +++ b/vms/proposervm/vm_regression_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package proposervm diff --git a/vms/proposervm/vm_test.go b/vms/proposervm/vm_test.go index 04d1e1c35810..2e4c6c3aea16 100644 --- a/vms/proposervm/vm_test.go +++ b/vms/proposervm/vm_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package proposervm diff --git a/vms/registry/vm_getter.go b/vms/registry/vm_getter.go index 5115af9e635f..826624744e38 100644 --- a/vms/registry/vm_getter.go +++ b/vms/registry/vm_getter.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package registry diff --git a/vms/registry/vm_getter_test.go b/vms/registry/vm_getter_test.go index 9cea55b2c82f..30bab4232be9 100644 --- a/vms/registry/vm_getter_test.go +++ b/vms/registry/vm_getter_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package registry diff --git a/vms/registry/vm_registerer.go b/vms/registry/vm_registerer.go index 785b2b8cf828..fec5fba78f57 100644 --- a/vms/registry/vm_registerer.go +++ b/vms/registry/vm_registerer.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package registry diff --git a/vms/registry/vm_registerer_test.go b/vms/registry/vm_registerer_test.go index a8910d4c33ad..666a9174525a 100644 --- a/vms/registry/vm_registerer_test.go +++ b/vms/registry/vm_registerer_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package registry diff --git a/vms/registry/vm_registry.go b/vms/registry/vm_registry.go index dd6f96d4e719..3c8f5b942e25 100644 --- a/vms/registry/vm_registry.go +++ b/vms/registry/vm_registry.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package registry diff --git a/vms/registry/vm_registry_test.go b/vms/registry/vm_registry_test.go index ecda1c4f5546..5f5eccc1c204 100644 --- a/vms/registry/vm_registry_test.go +++ b/vms/registry/vm_registry_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package registry diff --git a/vms/rpcchainvm/batched_vm_test.go b/vms/rpcchainvm/batched_vm_test.go index ebe5d68bc2a1..f74785ebc5bc 100644 --- a/vms/rpcchainvm/batched_vm_test.go +++ b/vms/rpcchainvm/batched_vm_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package rpcchainvm diff --git a/vms/rpcchainvm/errors.go b/vms/rpcchainvm/errors.go index 3795024378c4..4b434b51d425 100644 --- a/vms/rpcchainvm/errors.go +++ b/vms/rpcchainvm/errors.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package rpcchainvm diff --git a/vms/rpcchainvm/factory.go b/vms/rpcchainvm/factory.go index f7ef19749ad1..d61c41d11af8 100644 --- a/vms/rpcchainvm/factory.go +++ b/vms/rpcchainvm/factory.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package rpcchainvm diff --git a/vms/rpcchainvm/ghttp/gconn/conn_client.go b/vms/rpcchainvm/ghttp/gconn/conn_client.go index b4bc5a5a4de0..cfa3094bfefe 100644 --- a/vms/rpcchainvm/ghttp/gconn/conn_client.go +++ b/vms/rpcchainvm/ghttp/gconn/conn_client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package gconn diff --git a/vms/rpcchainvm/ghttp/gconn/conn_server.go b/vms/rpcchainvm/ghttp/gconn/conn_server.go index 07ca0f5a2b3a..57f1cfdb064b 100644 --- a/vms/rpcchainvm/ghttp/gconn/conn_server.go +++ b/vms/rpcchainvm/ghttp/gconn/conn_server.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package gconn diff --git a/vms/rpcchainvm/ghttp/greader/reader_client.go b/vms/rpcchainvm/ghttp/greader/reader_client.go index c06bdce9ba01..be0f2a1a7ee6 100644 --- a/vms/rpcchainvm/ghttp/greader/reader_client.go +++ b/vms/rpcchainvm/ghttp/greader/reader_client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package greader diff --git a/vms/rpcchainvm/ghttp/greader/reader_server.go b/vms/rpcchainvm/ghttp/greader/reader_server.go index a5f8f5d76f30..4d85f674ffc6 100644 --- a/vms/rpcchainvm/ghttp/greader/reader_server.go +++ b/vms/rpcchainvm/ghttp/greader/reader_server.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package greader diff --git a/vms/rpcchainvm/ghttp/gresponsewriter/locked_writer.go b/vms/rpcchainvm/ghttp/gresponsewriter/locked_writer.go index c89eb5099cc6..40528dc79d2c 100644 --- a/vms/rpcchainvm/ghttp/gresponsewriter/locked_writer.go +++ b/vms/rpcchainvm/ghttp/gresponsewriter/locked_writer.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package gresponsewriter diff --git a/vms/rpcchainvm/ghttp/gresponsewriter/writer_client.go b/vms/rpcchainvm/ghttp/gresponsewriter/writer_client.go index 769d8edce555..1c45567097cf 100644 --- a/vms/rpcchainvm/ghttp/gresponsewriter/writer_client.go +++ b/vms/rpcchainvm/ghttp/gresponsewriter/writer_client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package gresponsewriter diff --git a/vms/rpcchainvm/ghttp/gresponsewriter/writer_server.go b/vms/rpcchainvm/ghttp/gresponsewriter/writer_server.go index a78e6b002913..b73d24f21024 100644 --- a/vms/rpcchainvm/ghttp/gresponsewriter/writer_server.go +++ b/vms/rpcchainvm/ghttp/gresponsewriter/writer_server.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package gresponsewriter diff --git a/vms/rpcchainvm/ghttp/gwriter/writer_client.go b/vms/rpcchainvm/ghttp/gwriter/writer_client.go index d9a561f2dd4e..f68cefa7c2a6 100644 --- a/vms/rpcchainvm/ghttp/gwriter/writer_client.go +++ b/vms/rpcchainvm/ghttp/gwriter/writer_client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package gwriter diff --git a/vms/rpcchainvm/ghttp/gwriter/writer_server.go b/vms/rpcchainvm/ghttp/gwriter/writer_server.go index ce85aaced16e..1b216dc2a4ee 100644 --- a/vms/rpcchainvm/ghttp/gwriter/writer_server.go +++ b/vms/rpcchainvm/ghttp/gwriter/writer_server.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package gwriter diff --git a/vms/rpcchainvm/ghttp/http_client.go b/vms/rpcchainvm/ghttp/http_client.go index 62a6b705a338..cd06c46ca156 100644 --- a/vms/rpcchainvm/ghttp/http_client.go +++ b/vms/rpcchainvm/ghttp/http_client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package ghttp diff --git a/vms/rpcchainvm/ghttp/http_server.go b/vms/rpcchainvm/ghttp/http_server.go index adece6f93679..c602965323fd 100644 --- a/vms/rpcchainvm/ghttp/http_server.go +++ b/vms/rpcchainvm/ghttp/http_server.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package ghttp diff --git a/vms/rpcchainvm/ghttp/http_test.go b/vms/rpcchainvm/ghttp/http_test.go index 2bcf5f3150d8..22d5095d6c6d 100644 --- a/vms/rpcchainvm/ghttp/http_test.go +++ b/vms/rpcchainvm/ghttp/http_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package ghttp diff --git a/vms/rpcchainvm/grpcutils/client.go b/vms/rpcchainvm/grpcutils/client.go index 0a9dfcffef6c..eb9501019768 100644 --- a/vms/rpcchainvm/grpcutils/client.go +++ b/vms/rpcchainvm/grpcutils/client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package grpcutils diff --git a/vms/rpcchainvm/grpcutils/client_test.go b/vms/rpcchainvm/grpcutils/client_test.go index 9ef2fa1d6731..e02552995295 100644 --- a/vms/rpcchainvm/grpcutils/client_test.go +++ b/vms/rpcchainvm/grpcutils/client_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package grpcutils diff --git a/vms/rpcchainvm/grpcutils/server.go b/vms/rpcchainvm/grpcutils/server.go index a6746207e427..dbcc439c9ef1 100644 --- a/vms/rpcchainvm/grpcutils/server.go +++ b/vms/rpcchainvm/grpcutils/server.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package grpcutils diff --git a/vms/rpcchainvm/grpcutils/server_closer.go b/vms/rpcchainvm/grpcutils/server_closer.go index 35ca2b735a86..67a4141ddfc3 100644 --- a/vms/rpcchainvm/grpcutils/server_closer.go +++ b/vms/rpcchainvm/grpcutils/server_closer.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package grpcutils diff --git a/vms/rpcchainvm/grpcutils/util.go b/vms/rpcchainvm/grpcutils/util.go index 8ad042ea55a9..880faf4d2a63 100644 --- a/vms/rpcchainvm/grpcutils/util.go +++ b/vms/rpcchainvm/grpcutils/util.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package grpcutils diff --git a/vms/rpcchainvm/gruntime/runtime_client.go b/vms/rpcchainvm/gruntime/runtime_client.go index 67a1e9864908..8db4adbeb204 100644 --- a/vms/rpcchainvm/gruntime/runtime_client.go +++ b/vms/rpcchainvm/gruntime/runtime_client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package gruntime diff --git a/vms/rpcchainvm/gruntime/runtime_server.go b/vms/rpcchainvm/gruntime/runtime_server.go index 882c62f5ca02..09be6c121eef 100644 --- a/vms/rpcchainvm/gruntime/runtime_server.go +++ b/vms/rpcchainvm/gruntime/runtime_server.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package gruntime diff --git a/vms/rpcchainvm/messenger/messenger_client.go b/vms/rpcchainvm/messenger/messenger_client.go index e7910eb05d2e..d392b9af79c6 100644 --- a/vms/rpcchainvm/messenger/messenger_client.go +++ b/vms/rpcchainvm/messenger/messenger_client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package messenger diff --git a/vms/rpcchainvm/messenger/messenger_server.go b/vms/rpcchainvm/messenger/messenger_server.go index 273ffdfd25b0..fc28a0757bb2 100644 --- a/vms/rpcchainvm/messenger/messenger_server.go +++ b/vms/rpcchainvm/messenger/messenger_server.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package messenger diff --git a/vms/rpcchainvm/runtime/manager.go b/vms/rpcchainvm/runtime/manager.go index 3e1a9eaac903..425faa731850 100644 --- a/vms/rpcchainvm/runtime/manager.go +++ b/vms/rpcchainvm/runtime/manager.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package runtime diff --git a/vms/rpcchainvm/runtime/runtime.go b/vms/rpcchainvm/runtime/runtime.go index d5be95d96471..1a1a198acbda 100644 --- a/vms/rpcchainvm/runtime/runtime.go +++ b/vms/rpcchainvm/runtime/runtime.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package runtime diff --git a/vms/rpcchainvm/runtime/subprocess/initializer.go b/vms/rpcchainvm/runtime/subprocess/initializer.go index 5ade5f619bd1..bc8d4e41c63a 100644 --- a/vms/rpcchainvm/runtime/subprocess/initializer.go +++ b/vms/rpcchainvm/runtime/subprocess/initializer.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package subprocess diff --git a/vms/rpcchainvm/runtime/subprocess/linux_stopper.go b/vms/rpcchainvm/runtime/subprocess/linux_stopper.go index 80a47fa7da3c..5205ea40596f 100644 --- a/vms/rpcchainvm/runtime/subprocess/linux_stopper.go +++ b/vms/rpcchainvm/runtime/subprocess/linux_stopper.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. //go:build linux diff --git a/vms/rpcchainvm/runtime/subprocess/non_linux_stopper.go b/vms/rpcchainvm/runtime/subprocess/non_linux_stopper.go index 8c3ce6a138e9..c1a590e31fe7 100644 --- a/vms/rpcchainvm/runtime/subprocess/non_linux_stopper.go +++ b/vms/rpcchainvm/runtime/subprocess/non_linux_stopper.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. //go:build !linux diff --git a/vms/rpcchainvm/runtime/subprocess/runtime.go b/vms/rpcchainvm/runtime/subprocess/runtime.go index 7711d377127c..2cd92a00b04e 100644 --- a/vms/rpcchainvm/runtime/subprocess/runtime.go +++ b/vms/rpcchainvm/runtime/subprocess/runtime.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package subprocess diff --git a/vms/rpcchainvm/runtime/subprocess/stopper.go b/vms/rpcchainvm/runtime/subprocess/stopper.go index b4d026590421..4dfd33c24caa 100644 --- a/vms/rpcchainvm/runtime/subprocess/stopper.go +++ b/vms/rpcchainvm/runtime/subprocess/stopper.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package subprocess diff --git a/vms/rpcchainvm/state_syncable_vm_test.go b/vms/rpcchainvm/state_syncable_vm_test.go index d0df51c71779..45512bbec04d 100644 --- a/vms/rpcchainvm/state_syncable_vm_test.go +++ b/vms/rpcchainvm/state_syncable_vm_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package rpcchainvm diff --git a/vms/rpcchainvm/vm.go b/vms/rpcchainvm/vm.go index e2e57f0284d3..ee2869989575 100644 --- a/vms/rpcchainvm/vm.go +++ b/vms/rpcchainvm/vm.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package rpcchainvm diff --git a/vms/rpcchainvm/vm_client.go b/vms/rpcchainvm/vm_client.go index 2441792ac703..0ee7882b96d9 100644 --- a/vms/rpcchainvm/vm_client.go +++ b/vms/rpcchainvm/vm_client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package rpcchainvm diff --git a/vms/rpcchainvm/vm_server.go b/vms/rpcchainvm/vm_server.go index e3253043fbad..4338d87f1ed2 100644 --- a/vms/rpcchainvm/vm_server.go +++ b/vms/rpcchainvm/vm_server.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package rpcchainvm diff --git a/vms/rpcchainvm/vm_test.go b/vms/rpcchainvm/vm_test.go index fa8cb3d22fdf..b21cd503a74a 100644 --- a/vms/rpcchainvm/vm_test.go +++ b/vms/rpcchainvm/vm_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package rpcchainvm diff --git a/vms/rpcchainvm/with_context_vm_test.go b/vms/rpcchainvm/with_context_vm_test.go index 5c2c242b94a9..8796ff60941b 100644 --- a/vms/rpcchainvm/with_context_vm_test.go +++ b/vms/rpcchainvm/with_context_vm_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package rpcchainvm diff --git a/vms/secp256k1fx/credential.go b/vms/secp256k1fx/credential.go index 707a6b3f43d8..0367c9af96af 100644 --- a/vms/secp256k1fx/credential.go +++ b/vms/secp256k1fx/credential.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package secp256k1fx diff --git a/vms/secp256k1fx/credential_test.go b/vms/secp256k1fx/credential_test.go index 15496e1d7fac..c08548e0bcc7 100644 --- a/vms/secp256k1fx/credential_test.go +++ b/vms/secp256k1fx/credential_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package secp256k1fx diff --git a/vms/secp256k1fx/factory.go b/vms/secp256k1fx/factory.go index ae2463a19deb..fd52fe79a6fe 100644 --- a/vms/secp256k1fx/factory.go +++ b/vms/secp256k1fx/factory.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package secp256k1fx diff --git a/vms/secp256k1fx/factory_test.go b/vms/secp256k1fx/factory_test.go index 435164998581..2b1fa184474d 100644 --- a/vms/secp256k1fx/factory_test.go +++ b/vms/secp256k1fx/factory_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package secp256k1fx diff --git a/vms/secp256k1fx/fx.go b/vms/secp256k1fx/fx.go index c969c9593976..8c1cfa53bf9a 100644 --- a/vms/secp256k1fx/fx.go +++ b/vms/secp256k1fx/fx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package secp256k1fx diff --git a/vms/secp256k1fx/fx_test.go b/vms/secp256k1fx/fx_test.go index c0e2663e6a23..388d7bc14d84 100644 --- a/vms/secp256k1fx/fx_test.go +++ b/vms/secp256k1fx/fx_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package secp256k1fx diff --git a/vms/secp256k1fx/input.go b/vms/secp256k1fx/input.go index d5943a6b686e..7e11556be582 100644 --- a/vms/secp256k1fx/input.go +++ b/vms/secp256k1fx/input.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package secp256k1fx diff --git a/vms/secp256k1fx/input_test.go b/vms/secp256k1fx/input_test.go index 632004799e91..f80b824d7711 100644 --- a/vms/secp256k1fx/input_test.go +++ b/vms/secp256k1fx/input_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package secp256k1fx diff --git a/vms/secp256k1fx/keychain.go b/vms/secp256k1fx/keychain.go index 3246ef95722d..ecb42f209970 100644 --- a/vms/secp256k1fx/keychain.go +++ b/vms/secp256k1fx/keychain.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package secp256k1fx diff --git a/vms/secp256k1fx/keychain_test.go b/vms/secp256k1fx/keychain_test.go index 46fdb1a0695c..65dd984b703f 100644 --- a/vms/secp256k1fx/keychain_test.go +++ b/vms/secp256k1fx/keychain_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package secp256k1fx diff --git a/vms/secp256k1fx/mint_operation.go b/vms/secp256k1fx/mint_operation.go index a21f3061290b..80728ca7588e 100644 --- a/vms/secp256k1fx/mint_operation.go +++ b/vms/secp256k1fx/mint_operation.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package secp256k1fx diff --git a/vms/secp256k1fx/mint_operation_test.go b/vms/secp256k1fx/mint_operation_test.go index 60b60b25f10a..3b751c8dcb33 100644 --- a/vms/secp256k1fx/mint_operation_test.go +++ b/vms/secp256k1fx/mint_operation_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package secp256k1fx diff --git a/vms/secp256k1fx/mint_output.go b/vms/secp256k1fx/mint_output.go index 996f05171bbe..e52ba47025ae 100644 --- a/vms/secp256k1fx/mint_output.go +++ b/vms/secp256k1fx/mint_output.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package secp256k1fx diff --git a/vms/secp256k1fx/mint_output_test.go b/vms/secp256k1fx/mint_output_test.go index 7d092a6772ea..60a72dfc95c4 100644 --- a/vms/secp256k1fx/mint_output_test.go +++ b/vms/secp256k1fx/mint_output_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package secp256k1fx diff --git a/vms/secp256k1fx/output_owners.go b/vms/secp256k1fx/output_owners.go index c0bb243f4b6e..0f838c69800e 100644 --- a/vms/secp256k1fx/output_owners.go +++ b/vms/secp256k1fx/output_owners.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package secp256k1fx diff --git a/vms/secp256k1fx/output_owners_test.go b/vms/secp256k1fx/output_owners_test.go index 97741e6b6f3d..e042726bce64 100644 --- a/vms/secp256k1fx/output_owners_test.go +++ b/vms/secp256k1fx/output_owners_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package secp256k1fx diff --git a/vms/secp256k1fx/transfer_input.go b/vms/secp256k1fx/transfer_input.go index 6dadd558fc49..1659820c26f7 100644 --- a/vms/secp256k1fx/transfer_input.go +++ b/vms/secp256k1fx/transfer_input.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package secp256k1fx diff --git a/vms/secp256k1fx/transfer_input_test.go b/vms/secp256k1fx/transfer_input_test.go index c3019a25a12f..4434584e1a9d 100644 --- a/vms/secp256k1fx/transfer_input_test.go +++ b/vms/secp256k1fx/transfer_input_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package secp256k1fx diff --git a/vms/secp256k1fx/transfer_output.go b/vms/secp256k1fx/transfer_output.go index 234cc1f68dab..ee4c5796c413 100644 --- a/vms/secp256k1fx/transfer_output.go +++ b/vms/secp256k1fx/transfer_output.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package secp256k1fx diff --git a/vms/secp256k1fx/transfer_output_test.go b/vms/secp256k1fx/transfer_output_test.go index 767f93925b7c..b1d8a2170b5a 100644 --- a/vms/secp256k1fx/transfer_output_test.go +++ b/vms/secp256k1fx/transfer_output_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package secp256k1fx diff --git a/vms/secp256k1fx/tx.go b/vms/secp256k1fx/tx.go index 81f4ee4d11e0..5cc483c7c3fc 100644 --- a/vms/secp256k1fx/tx.go +++ b/vms/secp256k1fx/tx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package secp256k1fx diff --git a/vms/secp256k1fx/vm.go b/vms/secp256k1fx/vm.go index ba8a9f1d6c0a..07da2d394236 100644 --- a/vms/secp256k1fx/vm.go +++ b/vms/secp256k1fx/vm.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package secp256k1fx diff --git a/vms/tracedvm/batched_vm.go b/vms/tracedvm/batched_vm.go index 47f81c9fa114..22dfb212ec6d 100644 --- a/vms/tracedvm/batched_vm.go +++ b/vms/tracedvm/batched_vm.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tracedvm diff --git a/vms/tracedvm/block.go b/vms/tracedvm/block.go index a90a110302fe..81949d777225 100644 --- a/vms/tracedvm/block.go +++ b/vms/tracedvm/block.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tracedvm diff --git a/vms/tracedvm/block_vm.go b/vms/tracedvm/block_vm.go index 969a6bc09637..10931bf8c287 100644 --- a/vms/tracedvm/block_vm.go +++ b/vms/tracedvm/block_vm.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tracedvm diff --git a/vms/tracedvm/build_block_with_context_vm.go b/vms/tracedvm/build_block_with_context_vm.go index 1d9e9319605e..b069b471f26b 100644 --- a/vms/tracedvm/build_block_with_context_vm.go +++ b/vms/tracedvm/build_block_with_context_vm.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tracedvm diff --git a/vms/tracedvm/state_syncable_vm.go b/vms/tracedvm/state_syncable_vm.go index 75738462368b..e31507d55735 100644 --- a/vms/tracedvm/state_syncable_vm.go +++ b/vms/tracedvm/state_syncable_vm.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tracedvm diff --git a/vms/tracedvm/tx.go b/vms/tracedvm/tx.go index 7e18efcb23b4..638ecd8f5914 100644 --- a/vms/tracedvm/tx.go +++ b/vms/tracedvm/tx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tracedvm diff --git a/vms/tracedvm/vertex_vm.go b/vms/tracedvm/vertex_vm.go index 53189f5cee70..4bc162c6c6ae 100644 --- a/vms/tracedvm/vertex_vm.go +++ b/vms/tracedvm/vertex_vm.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tracedvm diff --git a/vms/types/blob_data.go b/vms/types/blob_data.go index cf5855ad7c7d..cee4fe7ba4d8 100644 --- a/vms/types/blob_data.go +++ b/vms/types/blob_data.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package types diff --git a/wallet/chain/c/backend.go b/wallet/chain/c/backend.go index 0a735116b646..cefe6befcf6a 100644 --- a/wallet/chain/c/backend.go +++ b/wallet/chain/c/backend.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package c diff --git a/wallet/chain/c/builder.go b/wallet/chain/c/builder.go index 81fcf3aa896a..3e387ba3c27b 100644 --- a/wallet/chain/c/builder.go +++ b/wallet/chain/c/builder.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package c diff --git a/wallet/chain/c/builder_with_options.go b/wallet/chain/c/builder_with_options.go index 8416dddf9928..fa98725450a6 100644 --- a/wallet/chain/c/builder_with_options.go +++ b/wallet/chain/c/builder_with_options.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package c diff --git a/wallet/chain/c/context.go b/wallet/chain/c/context.go index b9cd41cb5667..9e4712b8f7c9 100644 --- a/wallet/chain/c/context.go +++ b/wallet/chain/c/context.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package c diff --git a/wallet/chain/c/signer.go b/wallet/chain/c/signer.go index 4fd85ed3b532..7be1a149fb36 100644 --- a/wallet/chain/c/signer.go +++ b/wallet/chain/c/signer.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package c diff --git a/wallet/chain/c/wallet.go b/wallet/chain/c/wallet.go index fb1a83d53dad..304fbe4cf7c8 100644 --- a/wallet/chain/c/wallet.go +++ b/wallet/chain/c/wallet.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package c diff --git a/wallet/chain/c/wallet_with_options.go b/wallet/chain/c/wallet_with_options.go index 7d6193683d49..a0a1a60d85a8 100644 --- a/wallet/chain/c/wallet_with_options.go +++ b/wallet/chain/c/wallet_with_options.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package c diff --git a/wallet/chain/p/backend.go b/wallet/chain/p/backend.go index bb75692f3908..d06c7a1f9cf9 100644 --- a/wallet/chain/p/backend.go +++ b/wallet/chain/p/backend.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package p diff --git a/wallet/chain/p/backend_visitor.go b/wallet/chain/p/backend_visitor.go index 57d602354428..1a0c8e39e8da 100644 --- a/wallet/chain/p/backend_visitor.go +++ b/wallet/chain/p/backend_visitor.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package p diff --git a/wallet/chain/p/builder.go b/wallet/chain/p/builder.go index 6b3b11254cd7..9a8189c4db6b 100644 --- a/wallet/chain/p/builder.go +++ b/wallet/chain/p/builder.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package p diff --git a/wallet/chain/p/builder_with_options.go b/wallet/chain/p/builder_with_options.go index 9060d7639410..46deab976577 100644 --- a/wallet/chain/p/builder_with_options.go +++ b/wallet/chain/p/builder_with_options.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package p diff --git a/wallet/chain/p/context.go b/wallet/chain/p/context.go index 9c3ba67d0dc7..d861dae1dccc 100644 --- a/wallet/chain/p/context.go +++ b/wallet/chain/p/context.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package p diff --git a/wallet/chain/p/signer.go b/wallet/chain/p/signer.go index a795dd63c539..be2db8ddd2c0 100644 --- a/wallet/chain/p/signer.go +++ b/wallet/chain/p/signer.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package p diff --git a/wallet/chain/p/signer_visitor.go b/wallet/chain/p/signer_visitor.go index 25429b47e50f..c5c444a97f13 100644 --- a/wallet/chain/p/signer_visitor.go +++ b/wallet/chain/p/signer_visitor.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package p diff --git a/wallet/chain/p/wallet.go b/wallet/chain/p/wallet.go index c4d5545818ae..e982a204a9f8 100644 --- a/wallet/chain/p/wallet.go +++ b/wallet/chain/p/wallet.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package p diff --git a/wallet/chain/p/wallet_with_options.go b/wallet/chain/p/wallet_with_options.go index 8135db0ecfbc..33faa1a86bb0 100644 --- a/wallet/chain/p/wallet_with_options.go +++ b/wallet/chain/p/wallet_with_options.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package p diff --git a/wallet/chain/x/backend.go b/wallet/chain/x/backend.go index 56ade31be1b7..6c2f81365daf 100644 --- a/wallet/chain/x/backend.go +++ b/wallet/chain/x/backend.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package x diff --git a/wallet/chain/x/backend_visitor.go b/wallet/chain/x/backend_visitor.go index d617638434c6..7ce9aa2acd00 100644 --- a/wallet/chain/x/backend_visitor.go +++ b/wallet/chain/x/backend_visitor.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package x diff --git a/wallet/chain/x/builder.go b/wallet/chain/x/builder.go index d7af2b62aa25..27932019e1f4 100644 --- a/wallet/chain/x/builder.go +++ b/wallet/chain/x/builder.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package x diff --git a/wallet/chain/x/builder_with_options.go b/wallet/chain/x/builder_with_options.go index 63d554009fff..c2b65b05a630 100644 --- a/wallet/chain/x/builder_with_options.go +++ b/wallet/chain/x/builder_with_options.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package x diff --git a/wallet/chain/x/constants.go b/wallet/chain/x/constants.go index ed43fc07a84d..44ff38393acc 100644 --- a/wallet/chain/x/constants.go +++ b/wallet/chain/x/constants.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package x diff --git a/wallet/chain/x/context.go b/wallet/chain/x/context.go index 064080253eb6..de42f01e857b 100644 --- a/wallet/chain/x/context.go +++ b/wallet/chain/x/context.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package x diff --git a/wallet/chain/x/signer.go b/wallet/chain/x/signer.go index 98d52d83218d..2c8268199a44 100644 --- a/wallet/chain/x/signer.go +++ b/wallet/chain/x/signer.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package x diff --git a/wallet/chain/x/signer_visitor.go b/wallet/chain/x/signer_visitor.go index 35b0bd668224..961463ec0256 100644 --- a/wallet/chain/x/signer_visitor.go +++ b/wallet/chain/x/signer_visitor.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package x diff --git a/wallet/chain/x/wallet.go b/wallet/chain/x/wallet.go index 4e187d58220f..75b3914e199f 100644 --- a/wallet/chain/x/wallet.go +++ b/wallet/chain/x/wallet.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package x diff --git a/wallet/chain/x/wallet_with_options.go b/wallet/chain/x/wallet_with_options.go index 810f4e94b32a..d62d02efdd40 100644 --- a/wallet/chain/x/wallet_with_options.go +++ b/wallet/chain/x/wallet_with_options.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package x diff --git a/wallet/subnet/primary/api.go b/wallet/subnet/primary/api.go index 3ac72c217884..445c518aba25 100644 --- a/wallet/subnet/primary/api.go +++ b/wallet/subnet/primary/api.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package primary diff --git a/wallet/subnet/primary/common/options.go b/wallet/subnet/primary/common/options.go index 0c15be3c8b6b..03cc1c7b5f0a 100644 --- a/wallet/subnet/primary/common/options.go +++ b/wallet/subnet/primary/common/options.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package common diff --git a/wallet/subnet/primary/common/spend.go b/wallet/subnet/primary/common/spend.go index d7511317c4bd..42c7fc02fc34 100644 --- a/wallet/subnet/primary/common/spend.go +++ b/wallet/subnet/primary/common/spend.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package common diff --git a/wallet/subnet/primary/common/utxos.go b/wallet/subnet/primary/common/utxos.go index 36a86bc1f126..23762a0dd5d7 100644 --- a/wallet/subnet/primary/common/utxos.go +++ b/wallet/subnet/primary/common/utxos.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package common diff --git a/wallet/subnet/primary/example_test.go b/wallet/subnet/primary/example_test.go index 483c049d4ac0..2b8d8b8eeec8 100644 --- a/wallet/subnet/primary/example_test.go +++ b/wallet/subnet/primary/example_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package primary diff --git a/wallet/subnet/primary/examples/add-permissioned-subnet-validator/main.go b/wallet/subnet/primary/examples/add-permissioned-subnet-validator/main.go index d5e8ce422307..33695b35f649 100644 --- a/wallet/subnet/primary/examples/add-permissioned-subnet-validator/main.go +++ b/wallet/subnet/primary/examples/add-permissioned-subnet-validator/main.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package main diff --git a/wallet/subnet/primary/examples/add-primary-validator/main.go b/wallet/subnet/primary/examples/add-primary-validator/main.go index a56dae23db3a..987229d1ec22 100644 --- a/wallet/subnet/primary/examples/add-primary-validator/main.go +++ b/wallet/subnet/primary/examples/add-primary-validator/main.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package main diff --git a/wallet/subnet/primary/examples/c-chain-export/main.go b/wallet/subnet/primary/examples/c-chain-export/main.go index fec55c899feb..41ecb5ca814e 100644 --- a/wallet/subnet/primary/examples/c-chain-export/main.go +++ b/wallet/subnet/primary/examples/c-chain-export/main.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package main diff --git a/wallet/subnet/primary/examples/c-chain-import/main.go b/wallet/subnet/primary/examples/c-chain-import/main.go index b4dc4e603eb3..387d435db4df 100644 --- a/wallet/subnet/primary/examples/c-chain-import/main.go +++ b/wallet/subnet/primary/examples/c-chain-import/main.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package main diff --git a/wallet/subnet/primary/examples/create-asset/main.go b/wallet/subnet/primary/examples/create-asset/main.go index 30804f083df6..54015dda239d 100644 --- a/wallet/subnet/primary/examples/create-asset/main.go +++ b/wallet/subnet/primary/examples/create-asset/main.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package main diff --git a/wallet/subnet/primary/examples/create-chain/main.go b/wallet/subnet/primary/examples/create-chain/main.go index 5e6898a1b649..ea98579f6f21 100644 --- a/wallet/subnet/primary/examples/create-chain/main.go +++ b/wallet/subnet/primary/examples/create-chain/main.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package main diff --git a/wallet/subnet/primary/examples/create-locked-stakeable/main.go b/wallet/subnet/primary/examples/create-locked-stakeable/main.go index e688968e9e8a..32cdcf983ba0 100644 --- a/wallet/subnet/primary/examples/create-locked-stakeable/main.go +++ b/wallet/subnet/primary/examples/create-locked-stakeable/main.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package main diff --git a/wallet/subnet/primary/examples/create-subnet/main.go b/wallet/subnet/primary/examples/create-subnet/main.go index add98ea7931c..e471e68f5be9 100644 --- a/wallet/subnet/primary/examples/create-subnet/main.go +++ b/wallet/subnet/primary/examples/create-subnet/main.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package main diff --git a/wallet/subnet/primary/examples/get-p-chain-balance/main.go b/wallet/subnet/primary/examples/get-p-chain-balance/main.go index a19b3d6eae76..fd14eb4ea588 100644 --- a/wallet/subnet/primary/examples/get-p-chain-balance/main.go +++ b/wallet/subnet/primary/examples/get-p-chain-balance/main.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package main diff --git a/wallet/subnet/primary/examples/get-x-chain-balance/main.go b/wallet/subnet/primary/examples/get-x-chain-balance/main.go index a5474f7e1095..c43d4c9dd229 100644 --- a/wallet/subnet/primary/examples/get-x-chain-balance/main.go +++ b/wallet/subnet/primary/examples/get-x-chain-balance/main.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package main diff --git a/wallet/subnet/primary/examples/remove-subnet-validator/main.go b/wallet/subnet/primary/examples/remove-subnet-validator/main.go index 2842c7c0a790..50639943b630 100644 --- a/wallet/subnet/primary/examples/remove-subnet-validator/main.go +++ b/wallet/subnet/primary/examples/remove-subnet-validator/main.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package main diff --git a/wallet/subnet/primary/utxos.go b/wallet/subnet/primary/utxos.go index f8c9ce20a694..71f7629856e1 100644 --- a/wallet/subnet/primary/utxos.go +++ b/wallet/subnet/primary/utxos.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package primary diff --git a/wallet/subnet/primary/wallet.go b/wallet/subnet/primary/wallet.go index 54de390d029c..3bb3e9965684 100644 --- a/wallet/subnet/primary/wallet.go +++ b/wallet/subnet/primary/wallet.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package primary diff --git a/x/archivedb/batch.go b/x/archivedb/batch.go index dc7502fafd2e..720ed6f9d5d3 100644 --- a/x/archivedb/batch.go +++ b/x/archivedb/batch.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package archivedb diff --git a/x/archivedb/db.go b/x/archivedb/db.go index ca638b982cf4..74b658a31736 100644 --- a/x/archivedb/db.go +++ b/x/archivedb/db.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package archivedb diff --git a/x/archivedb/db_test.go b/x/archivedb/db_test.go index a22b7768c812..2b1fbea2a46f 100644 --- a/x/archivedb/db_test.go +++ b/x/archivedb/db_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package archivedb diff --git a/x/archivedb/key.go b/x/archivedb/key.go index c90b02761402..86a884cb6c0f 100644 --- a/x/archivedb/key.go +++ b/x/archivedb/key.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package archivedb diff --git a/x/archivedb/key_test.go b/x/archivedb/key_test.go index 18343e725bc0..e5ea0ff3ced3 100644 --- a/x/archivedb/key_test.go +++ b/x/archivedb/key_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package archivedb diff --git a/x/archivedb/prefix_test.go b/x/archivedb/prefix_test.go index 8c6362d745f4..8558b592bf99 100644 --- a/x/archivedb/prefix_test.go +++ b/x/archivedb/prefix_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package archivedb diff --git a/x/archivedb/reader.go b/x/archivedb/reader.go index 0186cbc12712..abac3d854741 100644 --- a/x/archivedb/reader.go +++ b/x/archivedb/reader.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package archivedb diff --git a/x/archivedb/value.go b/x/archivedb/value.go index 2f7ff3e1f0f3..5f5861e23f43 100644 --- a/x/archivedb/value.go +++ b/x/archivedb/value.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package archivedb diff --git a/x/merkledb/batch.go b/x/merkledb/batch.go index 82ff3533aaaf..033200409b79 100644 --- a/x/merkledb/batch.go +++ b/x/merkledb/batch.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package merkledb diff --git a/x/merkledb/cache.go b/x/merkledb/cache.go index c4cebd27f8a2..ee2e7f0b2713 100644 --- a/x/merkledb/cache.go +++ b/x/merkledb/cache.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package merkledb diff --git a/x/merkledb/cache_test.go b/x/merkledb/cache_test.go index e0939df9451d..9883c23af38c 100644 --- a/x/merkledb/cache_test.go +++ b/x/merkledb/cache_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package merkledb diff --git a/x/merkledb/codec.go b/x/merkledb/codec.go index ea6bc10363f4..02eb5fc3ad5a 100644 --- a/x/merkledb/codec.go +++ b/x/merkledb/codec.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package merkledb diff --git a/x/merkledb/codec_test.go b/x/merkledb/codec_test.go index 991368a823f4..5972cbb43b9d 100644 --- a/x/merkledb/codec_test.go +++ b/x/merkledb/codec_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package merkledb diff --git a/x/merkledb/db.go b/x/merkledb/db.go index e3319aee972b..1f96c2a89d0c 100644 --- a/x/merkledb/db.go +++ b/x/merkledb/db.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package merkledb diff --git a/x/merkledb/db_test.go b/x/merkledb/db_test.go index 06f42105e4f6..12bda7c03626 100644 --- a/x/merkledb/db_test.go +++ b/x/merkledb/db_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package merkledb diff --git a/x/merkledb/helpers_test.go b/x/merkledb/helpers_test.go index b7a2908ff377..acb620aba5f1 100644 --- a/x/merkledb/helpers_test.go +++ b/x/merkledb/helpers_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package merkledb diff --git a/x/merkledb/history.go b/x/merkledb/history.go index 1f55b93c5d58..22d87cd1cb48 100644 --- a/x/merkledb/history.go +++ b/x/merkledb/history.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package merkledb diff --git a/x/merkledb/history_test.go b/x/merkledb/history_test.go index 6af39e0e08e3..09c84321f50c 100644 --- a/x/merkledb/history_test.go +++ b/x/merkledb/history_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package merkledb diff --git a/x/merkledb/intermediate_node_db.go b/x/merkledb/intermediate_node_db.go index 91cef6242410..5039c618e7cb 100644 --- a/x/merkledb/intermediate_node_db.go +++ b/x/merkledb/intermediate_node_db.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package merkledb diff --git a/x/merkledb/intermediate_node_db_test.go b/x/merkledb/intermediate_node_db_test.go index 0c27beebfd38..6b6012bccf7b 100644 --- a/x/merkledb/intermediate_node_db_test.go +++ b/x/merkledb/intermediate_node_db_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package merkledb diff --git a/x/merkledb/key.go b/x/merkledb/key.go index 78e35f59924c..dd9938f6aaf0 100644 --- a/x/merkledb/key.go +++ b/x/merkledb/key.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package merkledb diff --git a/x/merkledb/key_test.go b/x/merkledb/key_test.go index f0819483b1a8..aab666e13afc 100644 --- a/x/merkledb/key_test.go +++ b/x/merkledb/key_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package merkledb diff --git a/x/merkledb/metrics.go b/x/merkledb/metrics.go index d8a80a02db5a..058b4869904a 100644 --- a/x/merkledb/metrics.go +++ b/x/merkledb/metrics.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package merkledb diff --git a/x/merkledb/metrics_test.go b/x/merkledb/metrics_test.go index 304c3027133b..20c4accbd13c 100644 --- a/x/merkledb/metrics_test.go +++ b/x/merkledb/metrics_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package merkledb diff --git a/x/merkledb/node.go b/x/merkledb/node.go index 4caad76f294a..701e120e4b52 100644 --- a/x/merkledb/node.go +++ b/x/merkledb/node.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package merkledb diff --git a/x/merkledb/node_test.go b/x/merkledb/node_test.go index e0cb4dd04b06..3c09679570f3 100644 --- a/x/merkledb/node_test.go +++ b/x/merkledb/node_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package merkledb diff --git a/x/merkledb/proof.go b/x/merkledb/proof.go index c49cd6bab679..e863ca53c8e5 100644 --- a/x/merkledb/proof.go +++ b/x/merkledb/proof.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package merkledb diff --git a/x/merkledb/proof_test.go b/x/merkledb/proof_test.go index e00326a56408..fa047e87d4a4 100644 --- a/x/merkledb/proof_test.go +++ b/x/merkledb/proof_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package merkledb diff --git a/x/merkledb/tracer.go b/x/merkledb/tracer.go index 707028f2c9cd..d4e7a6fce4d7 100644 --- a/x/merkledb/tracer.go +++ b/x/merkledb/tracer.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package merkledb diff --git a/x/merkledb/trie.go b/x/merkledb/trie.go index 0feeecdbfac2..bc2b4db81541 100644 --- a/x/merkledb/trie.go +++ b/x/merkledb/trie.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package merkledb diff --git a/x/merkledb/trie_test.go b/x/merkledb/trie_test.go index 223822aa611e..f6dc0351f549 100644 --- a/x/merkledb/trie_test.go +++ b/x/merkledb/trie_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package merkledb diff --git a/x/merkledb/value_node_db.go b/x/merkledb/value_node_db.go index 406c9a986dba..16cabe3d718f 100644 --- a/x/merkledb/value_node_db.go +++ b/x/merkledb/value_node_db.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package merkledb diff --git a/x/merkledb/value_node_db_test.go b/x/merkledb/value_node_db_test.go index 78dfe62b1e3b..224a4fe94ac1 100644 --- a/x/merkledb/value_node_db_test.go +++ b/x/merkledb/value_node_db_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package merkledb diff --git a/x/merkledb/view.go b/x/merkledb/view.go index 301379d0a778..8f9e688efc26 100644 --- a/x/merkledb/view.go +++ b/x/merkledb/view.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package merkledb diff --git a/x/merkledb/view_iterator.go b/x/merkledb/view_iterator.go index 2995cb6e8449..60d1b8909e76 100644 --- a/x/merkledb/view_iterator.go +++ b/x/merkledb/view_iterator.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package merkledb diff --git a/x/merkledb/view_iterator_test.go b/x/merkledb/view_iterator_test.go index 97d4e47ca11a..ba71c414c902 100644 --- a/x/merkledb/view_iterator_test.go +++ b/x/merkledb/view_iterator_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package merkledb diff --git a/x/sync/client.go b/x/sync/client.go index ad79e35f7e71..b753e48f9f9e 100644 --- a/x/sync/client.go +++ b/x/sync/client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sync diff --git a/x/sync/client_test.go b/x/sync/client_test.go index 8f4f9173b5d9..dd1767261296 100644 --- a/x/sync/client_test.go +++ b/x/sync/client_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sync diff --git a/x/sync/db.go b/x/sync/db.go index 5a0a5164c6a6..5ed9061b5889 100644 --- a/x/sync/db.go +++ b/x/sync/db.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sync diff --git a/x/sync/g_db/db_client.go b/x/sync/g_db/db_client.go index 376bff6aeab9..37b3339766ae 100644 --- a/x/sync/g_db/db_client.go +++ b/x/sync/g_db/db_client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package gdb diff --git a/x/sync/g_db/db_server.go b/x/sync/g_db/db_server.go index 820a130bb496..a65e8a4fe0de 100644 --- a/x/sync/g_db/db_server.go +++ b/x/sync/g_db/db_server.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package gdb diff --git a/x/sync/manager.go b/x/sync/manager.go index d094f33165cb..82f05eef08f9 100644 --- a/x/sync/manager.go +++ b/x/sync/manager.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sync diff --git a/x/sync/metrics.go b/x/sync/metrics.go index 881ca37282ef..fb27e6b45ffb 100644 --- a/x/sync/metrics.go +++ b/x/sync/metrics.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sync diff --git a/x/sync/network_client.go b/x/sync/network_client.go index efc3c6ef089e..22d7766f3f52 100644 --- a/x/sync/network_client.go +++ b/x/sync/network_client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sync diff --git a/x/sync/network_server.go b/x/sync/network_server.go index e31e6d8f3ace..f8c311964e05 100644 --- a/x/sync/network_server.go +++ b/x/sync/network_server.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sync diff --git a/x/sync/network_server_test.go b/x/sync/network_server_test.go index a73aa3736979..66135c0025c6 100644 --- a/x/sync/network_server_test.go +++ b/x/sync/network_server_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sync diff --git a/x/sync/response_handler.go b/x/sync/response_handler.go index 71e0c5f64580..624a3221fc9c 100644 --- a/x/sync/response_handler.go +++ b/x/sync/response_handler.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sync diff --git a/x/sync/sync_test.go b/x/sync/sync_test.go index f970229aa2f5..0d659b3d84c3 100644 --- a/x/sync/sync_test.go +++ b/x/sync/sync_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sync diff --git a/x/sync/workheap.go b/x/sync/workheap.go index 76d438c92d17..b49a19372caf 100644 --- a/x/sync/workheap.go +++ b/x/sync/workheap.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sync diff --git a/x/sync/workheap_test.go b/x/sync/workheap_test.go index 826011dbdebd..d073ce5f9fdc 100644 --- a/x/sync/workheap_test.go +++ b/x/sync/workheap_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package sync From 935bfe45f95591a9b3710f5b53666a289ba6222b Mon Sep 17 00:00:00 2001 From: David Boehm <91908103+dboehm-avalabs@users.noreply.github.com> Date: Thu, 4 Jan 2024 09:59:38 -0500 Subject: [PATCH 19/57] [MerkleDB] Make intermediate node cache two layered (#2576) Co-authored-by: Dan Laine --- x/merkledb/db.go | 43 +++++++++++-------- x/merkledb/db_test.go | 17 ++++---- x/merkledb/intermediate_node_db.go | 53 ++++++++++++++++-------- x/merkledb/intermediate_node_db_test.go | 55 +++++++++++++++++-------- x/merkledb/proof.go | 16 ++++--- x/sync/client_test.go | 15 +++---- 6 files changed, 122 insertions(+), 77 deletions(-) diff --git a/x/merkledb/db.go b/x/merkledb/db.go index 1f96c2a89d0c..5edcc809ae34 100644 --- a/x/merkledb/db.go +++ b/x/merkledb/db.go @@ -161,16 +161,19 @@ type Config struct { // // If 0 is specified, [runtime.NumCPU] will be used. RootGenConcurrency uint - // The number of bytes to write to disk when intermediate nodes are evicted - // from their cache and written to disk. - EvictionBatchSize uint + // The number of changes to the database that we store in memory in order to // serve change proofs. HistoryLength uint - // The number of bytes to cache nodes with values. + // The number of bytes used to cache nodes with values. ValueNodeCacheSize uint - // The number of bytes to cache nodes without values. + // The number of bytes used to cache nodes without values. IntermediateNodeCacheSize uint + // The number of bytes used to store nodes without values in memory before forcing them onto disk. + IntermediateWriteBufferSize uint + // The number of bytes to write to disk when intermediate nodes are evicted + // from the write buffer and written to disk. + IntermediateWriteBatchSize uint // If [Reg] is nil, metrics are collected locally but not exported through // Prometheus. // This may be useful for testing. @@ -256,11 +259,23 @@ func newDatabase( return make([]byte, 0, defaultBufferLength) }, } + iNodeDB, err := newIntermediateNodeDB( + db, + bufferPool, + metrics, + int(config.IntermediateNodeCacheSize), + int(config.IntermediateWriteBufferSize), + int(config.IntermediateWriteBatchSize), + BranchFactorToTokenSize[config.BranchFactor]) + if err != nil { + return nil, err + } + trieDB := &merkleDB{ metrics: metrics, baseDB: db, + intermediateNodeDB: iNodeDB, valueNodeDB: newValueNodeDB(db, bufferPool, metrics, int(config.ValueNodeCacheSize)), - intermediateNodeDB: newIntermediateNodeDB(db, bufferPool, metrics, int(config.IntermediateNodeCacheSize), int(config.EvictionBatchSize), BranchFactorToTokenSize[config.BranchFactor]), history: newTrieHistory(int(config.HistoryLength)), debugTracer: getTracerIfEnabled(config.TraceLevel, DebugTrace, config.Tracer), infoTracer: getTracerIfEnabled(config.TraceLevel, InfoTrace, config.Tracer), @@ -483,19 +498,11 @@ func (db *merkleDB) PrefetchPath(key []byte) error { func (db *merkleDB) prefetchPath(keyBytes []byte) error { return visitPathToKey(db, ToKey(keyBytes), func(n *node) error { - if !n.hasValue() { - // this value is already in the cache, so skip writing - // to avoid grabbing the cache write lock - if _, ok := db.intermediateNodeDB.nodeCache.Get(n.key); ok { - return nil - } - return db.intermediateNodeDB.nodeCache.Put(n.key, n) - } - // this value is already in the cache, so skip writing - if _, ok := db.valueNodeDB.nodeCache.Get(n.key); ok { - return nil + if n.hasValue() { + db.valueNodeDB.nodeCache.Put(n.key, n) + } else { + db.intermediateNodeDB.nodeCache.Put(n.key, n) } - db.valueNodeDB.nodeCache.Put(n.key, n) return nil }) } diff --git a/x/merkledb/db_test.go b/x/merkledb/db_test.go index 12bda7c03626..244858aeccc8 100644 --- a/x/merkledb/db_test.go +++ b/x/merkledb/db_test.go @@ -42,13 +42,14 @@ func newDB(ctx context.Context, db database.Database, config Config) (*merkleDB, func newDefaultConfig() Config { return Config{ - EvictionBatchSize: 10, - HistoryLength: defaultHistoryLength, - ValueNodeCacheSize: units.MiB, - IntermediateNodeCacheSize: units.MiB, - Reg: prometheus.NewRegistry(), - Tracer: trace.Noop, - BranchFactor: BranchFactor16, + IntermediateWriteBatchSize: 10, + HistoryLength: defaultHistoryLength, + ValueNodeCacheSize: units.MiB, + IntermediateNodeCacheSize: units.MiB, + IntermediateWriteBufferSize: units.KiB, + Reg: prometheus.NewRegistry(), + Tracer: trace.Noop, + BranchFactor: BranchFactor16, } } @@ -807,7 +808,7 @@ func TestMerkleDBClear(t *testing.T) { // Assert caches are empty. require.Zero(db.valueNodeDB.nodeCache.Len()) - require.Zero(db.intermediateNodeDB.nodeCache.currentSize) + require.Zero(db.intermediateNodeDB.writeBuffer.currentSize) // Assert history has only the clearing change. require.Len(db.history.lastChanges, 1) diff --git a/x/merkledb/intermediate_node_db.go b/x/merkledb/intermediate_node_db.go index 5039c618e7cb..fa31771d7b36 100644 --- a/x/merkledb/intermediate_node_db.go +++ b/x/merkledb/intermediate_node_db.go @@ -4,13 +4,18 @@ package merkledb import ( + "errors" "sync" + "github.com/ava-labs/avalanchego/cache" + "github.com/ava-labs/avalanchego/database" ) const defaultBufferLength = 256 +var errCacheSizeTooSmall = errors.New("cache size must be larger than or equal to write buffer size") + // Holds intermediate nodes. That is, those without values. // Changes to this database aren't written to [baseDB] until // they're evicted from the [nodeCache] or Flush is called. @@ -22,12 +27,16 @@ type intermediateNodeDB struct { // Keys written to [baseDB] are prefixed with [intermediateNodePrefix]. baseDB database.Database - // If a value is nil, the corresponding key isn't in the trie. + // The write buffer contains nodes that have been changed but have not been written to disk. // Note that a call to Put may cause a node to be evicted // from the cache, which will call [OnEviction]. // A non-nil error returned from Put is considered fatal. // Keys in [nodeCache] aren't prefixed with [intermediateNodePrefix]. - nodeCache onEvictCache[Key, *node] + writeBuffer onEvictCache[Key, *node] + + // If a value is nil, the corresponding key isn't in the trie. + nodeCache cache.Cacher[Key, *node] + // the number of bytes to evict during an eviction batch evictionBatchSize int metrics merkleMetrics @@ -38,29 +47,34 @@ func newIntermediateNodeDB( db database.Database, bufferPool *sync.Pool, metrics merkleMetrics, - size int, + cacheSize int, + writeBufferSize int, evictionBatchSize int, tokenSize int, -) *intermediateNodeDB { +) (*intermediateNodeDB, error) { + if cacheSize < writeBufferSize { + return nil, errCacheSizeTooSmall + } result := &intermediateNodeDB{ metrics: metrics, baseDB: db, bufferPool: bufferPool, evictionBatchSize: evictionBatchSize, tokenSize: tokenSize, + nodeCache: cache.NewSizedLRU(cacheSize, cacheEntrySize), } - result.nodeCache = newOnEvictCache( - size, + result.writeBuffer = newOnEvictCache( + writeBufferSize, cacheEntrySize, result.onEviction, ) - return result + + return result, nil } // A non-nil error is considered fatal and closes [db.baseDB]. func (db *intermediateNodeDB) onEviction(key Key, n *node) error { writeBatch := db.baseDB.NewBatch() - totalSize := cacheEntrySize(key, n) if err := db.addToBatch(writeBatch, key, n); err != nil { _ = db.baseDB.Close() @@ -73,7 +87,7 @@ func (db *intermediateNodeDB) onEviction(key Key, n *node) error { // node, because each time this method is called we do a disk write. // Evicts a total number of bytes, rather than a number of nodes for totalSize < db.evictionBatchSize { - key, n, exists := db.nodeCache.removeOldest() + key, n, exists := db.writeBuffer.removeOldest() if !exists { // The cache is empty. break @@ -136,24 +150,29 @@ func (db *intermediateNodeDB) constructDBKey(key Key) []byte { } func (db *intermediateNodeDB) Put(key Key, n *node) error { - return db.nodeCache.Put(key, n) + db.nodeCache.Put(key, n) + return db.writeBuffer.Put(key, n) } func (db *intermediateNodeDB) Flush() error { - return db.nodeCache.Flush() + db.nodeCache.Flush() + return db.writeBuffer.Flush() } func (db *intermediateNodeDB) Delete(key Key) error { - return db.nodeCache.Put(key, nil) + db.nodeCache.Put(key, nil) + return db.writeBuffer.Put(key, nil) } func (db *intermediateNodeDB) Clear() error { - // Reset the cache. Note we don't flush because that would cause us to + db.nodeCache.Flush() + + // Reset the buffer. Note we don't flush because that would cause us to // persist intermediate nodes we're about to delete. - db.nodeCache = newOnEvictCache( - db.nodeCache.maxSize, - db.nodeCache.size, - db.nodeCache.onEviction, + db.writeBuffer = newOnEvictCache( + db.writeBuffer.maxSize, + db.writeBuffer.size, + db.writeBuffer.onEviction, ) return database.AtomicClearPrefix(db.baseDB, db.baseDB, intermediateNodePrefix) } diff --git a/x/merkledb/intermediate_node_db_test.go b/x/merkledb/intermediate_node_db_test.go index 6b6012bccf7b..86bf67475096 100644 --- a/x/merkledb/intermediate_node_db_test.go +++ b/x/merkledb/intermediate_node_db_test.go @@ -28,19 +28,23 @@ func Test_IntermediateNodeDB(t *testing.T) { nodeSize := cacheEntrySize(n.key, n) // use exact multiple of node size so require.Equal(1, db.nodeCache.fifo.Len()) is correct later - cacheSize := nodeSize * 20 - evictionBatchSize := cacheSize + cacheSize := nodeSize * 100 + bufferSize := nodeSize * 20 + + evictionBatchSize := bufferSize baseDB := memdb.New() - db := newIntermediateNodeDB( + db, err := newIntermediateNodeDB( baseDB, &sync.Pool{ New: func() interface{} { return make([]byte, 0) }, }, &mockMetrics{}, cacheSize, + bufferSize, evictionBatchSize, 4, ) + require.NoError(err) // Put a key-node pair node1Key := ToKey([]byte{0x01}) @@ -78,7 +82,7 @@ func Test_IntermediateNodeDB(t *testing.T) { node := newNode(Key{}) node.setValue(maybe.Some([]byte{byte(added)})) newExpectedSize := expectedSize + cacheEntrySize(key, node) - if newExpectedSize > cacheSize { + if newExpectedSize > bufferSize { // Don't trigger eviction. break } @@ -89,7 +93,7 @@ func Test_IntermediateNodeDB(t *testing.T) { } // Assert cache has expected number of elements - require.Equal(added, db.nodeCache.fifo.Len()) + require.Equal(added, db.writeBuffer.fifo.Len()) // Put one more element in the cache, which should trigger an eviction // of all but 2 elements. 2 elements remain rather than 1 element because of @@ -100,14 +104,14 @@ func Test_IntermediateNodeDB(t *testing.T) { require.NoError(db.Put(key, node)) // Assert cache has expected number of elements - require.Equal(1, db.nodeCache.fifo.Len()) - gotKey, _, ok := db.nodeCache.fifo.Oldest() + require.Equal(1, db.writeBuffer.fifo.Len()) + gotKey, _, ok := db.writeBuffer.fifo.Oldest() require.True(ok) require.Equal(ToKey([]byte{byte(added)}), gotKey) // Get a node from the base database // Use an early key that has been evicted from the cache - _, inCache := db.nodeCache.Get(node1Key) + _, inCache := db.writeBuffer.Get(node1Key) require.False(inCache) nodeRead, err := db.Get(node1Key) require.NoError(err) @@ -117,7 +121,7 @@ func Test_IntermediateNodeDB(t *testing.T) { require.NoError(db.Flush()) // Assert the cache is empty - require.Zero(db.nodeCache.fifo.Len()) + require.Zero(db.writeBuffer.fifo.Len()) // Assert the evicted cache elements were written to disk with prefix. it := baseDB.NewIteratorWithPrefix(intermediateNodePrefix) @@ -132,8 +136,9 @@ func Test_IntermediateNodeDB(t *testing.T) { } func FuzzIntermediateNodeDBConstructDBKey(f *testing.F) { + bufferSize := 200 cacheSize := 200 - evictionBatchSize := cacheSize + evictionBatchSize := bufferSize baseDB := memdb.New() f.Fuzz(func( @@ -143,16 +148,18 @@ func FuzzIntermediateNodeDBConstructDBKey(f *testing.F) { ) { require := require.New(t) for _, tokenSize := range validTokenSizes { - db := newIntermediateNodeDB( + db, err := newIntermediateNodeDB( baseDB, &sync.Pool{ New: func() interface{} { return make([]byte, 0) }, }, &mockMetrics{}, cacheSize, + bufferSize, evictionBatchSize, tokenSize, ) + require.NoError(err) p := ToKey(key) uBitLength := tokenLength * uint(tokenSize) @@ -182,19 +189,23 @@ func FuzzIntermediateNodeDBConstructDBKey(f *testing.F) { func Test_IntermediateNodeDB_ConstructDBKey_DirtyBuffer(t *testing.T) { require := require.New(t) cacheSize := 200 - evictionBatchSize := cacheSize + bufferSize := 200 + evictionBatchSize := bufferSize baseDB := memdb.New() - db := newIntermediateNodeDB( + db, err := newIntermediateNodeDB( baseDB, &sync.Pool{ New: func() interface{} { return make([]byte, 0) }, }, &mockMetrics{}, cacheSize, + bufferSize, evictionBatchSize, 4, ) + require.NoError(err) + db.bufferPool.Put([]byte{0xFF, 0xFF, 0xFF}) constructedKey := db.constructDBKey(ToKey([]byte{})) require.Len(constructedKey, 2) @@ -217,19 +228,23 @@ func Test_IntermediateNodeDB_ConstructDBKey_DirtyBuffer(t *testing.T) { func TestIntermediateNodeDBClear(t *testing.T) { require := require.New(t) cacheSize := 200 - evictionBatchSize := cacheSize + bufferSize := 200 + evictionBatchSize := bufferSize baseDB := memdb.New() - db := newIntermediateNodeDB( + db, err := newIntermediateNodeDB( baseDB, &sync.Pool{ New: func() interface{} { return make([]byte, 0) }, }, &mockMetrics{}, cacheSize, + bufferSize, evictionBatchSize, 4, ) + require.NoError(err) + for _, b := range [][]byte{{1}, {2}, {3}} { require.NoError(db.Put(ToKey(b), newNode(ToKey(b)))) } @@ -240,7 +255,7 @@ func TestIntermediateNodeDBClear(t *testing.T) { defer iter.Release() require.False(iter.Next()) - require.Zero(db.nodeCache.currentSize) + require.Zero(db.writeBuffer.currentSize) } // Test that deleting the empty key and flushing works correctly. @@ -251,19 +266,23 @@ func TestIntermediateNodeDBClear(t *testing.T) { func TestIntermediateNodeDBDeleteEmptyKey(t *testing.T) { require := require.New(t) cacheSize := 200 - evictionBatchSize := cacheSize + bufferSize := 200 + evictionBatchSize := bufferSize baseDB := memdb.New() - db := newIntermediateNodeDB( + db, err := newIntermediateNodeDB( baseDB, &sync.Pool{ New: func() interface{} { return make([]byte, 0) }, }, &mockMetrics{}, cacheSize, + bufferSize, evictionBatchSize, 4, ) + require.NoError(err) + emptyKey := ToKey([]byte{}) require.NoError(db.Put(emptyKey, newNode(emptyKey))) require.NoError(db.Flush()) diff --git a/x/merkledb/proof.go b/x/merkledb/proof.go index e863ca53c8e5..8ddd97ffa5f9 100644 --- a/x/merkledb/proof.go +++ b/x/merkledb/proof.go @@ -20,10 +20,7 @@ import ( pb "github.com/ava-labs/avalanchego/proto/pb/sync" ) -const ( - verificationEvictionBatchSize = 0 - verificationCacheSize = math.MaxInt -) +const verificationCacheSize = math.MaxUint16 var ( ErrInvalidProof = errors.New("proof obtained an invalid root ID") @@ -861,11 +858,12 @@ func getStandaloneView(ctx context.Context, ops []database.BatchOp, size int) (* ctx, memdb.New(), Config{ - EvictionBatchSize: verificationEvictionBatchSize, - Tracer: trace.Noop, - ValueNodeCacheSize: verificationCacheSize, - IntermediateNodeCacheSize: verificationCacheSize, - BranchFactor: tokenSizeToBranchFactor[size], + BranchFactor: tokenSizeToBranchFactor[size], + Tracer: trace.Noop, + ValueNodeCacheSize: verificationCacheSize, + IntermediateNodeCacheSize: verificationCacheSize, + IntermediateWriteBufferSize: verificationCacheSize, + IntermediateWriteBatchSize: verificationCacheSize, }, &mockMetrics{}, ) diff --git a/x/sync/client_test.go b/x/sync/client_test.go index dd1767261296..e81d1a44010c 100644 --- a/x/sync/client_test.go +++ b/x/sync/client_test.go @@ -32,13 +32,14 @@ import ( func newDefaultDBConfig() merkledb.Config { return merkledb.Config{ - EvictionBatchSize: 100, - HistoryLength: defaultRequestKeyLimit, - ValueNodeCacheSize: defaultRequestKeyLimit, - IntermediateNodeCacheSize: defaultRequestKeyLimit, - Reg: prometheus.NewRegistry(), - Tracer: trace.Noop, - BranchFactor: merkledb.BranchFactor16, + IntermediateWriteBatchSize: 100, + HistoryLength: defaultRequestKeyLimit, + ValueNodeCacheSize: defaultRequestKeyLimit, + IntermediateWriteBufferSize: defaultRequestKeyLimit, + IntermediateNodeCacheSize: defaultRequestKeyLimit, + Reg: prometheus.NewRegistry(), + Tracer: trace.Noop, + BranchFactor: merkledb.BranchFactor16, } } From 72dc44224e839ec0d905559d2d8bfdac9fef5848 Mon Sep 17 00:00:00 2001 From: David Boehm <91908103+dboehm-avalabs@users.noreply.github.com> Date: Thu, 4 Jan 2024 11:36:57 -0500 Subject: [PATCH 20/57] Fix merkledb rebuild iterator (#2581) --- x/merkledb/db.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x/merkledb/db.go b/x/merkledb/db.go index 5edcc809ae34..a4af8058a440 100644 --- a/x/merkledb/db.go +++ b/x/merkledb/db.go @@ -336,7 +336,8 @@ func (db *merkleDB) rebuild(ctx context.Context, cacheSize int) error { ) currentOps := make([]database.BatchOp, 0, opsSizeLimit) valueIt := db.NewIterator() - defer valueIt.Release() + // ensure valueIt is captured and release gets called on the latest copy of valueIt + defer func() { valueIt.Release() }() for valueIt.Next() { if len(currentOps) >= opsSizeLimit { view, err := newView(db, db, ViewChanges{BatchOps: currentOps, ConsumeBytes: true}) From 7c82a5bc23c6e0006377ee2cf59a32a62c334ca5 Mon Sep 17 00:00:00 2001 From: David Boehm <91908103+dboehm-avalabs@users.noreply.github.com> Date: Thu, 4 Jan 2024 15:37:06 -0500 Subject: [PATCH 21/57] Fix intermediate node caching (#2585) Co-authored-by: Dan Laine --- x/merkledb/db.go | 29 ++++++++++++------------- x/merkledb/intermediate_node_db.go | 19 +++++++++------- x/merkledb/intermediate_node_db_test.go | 18 +++++---------- 3 files changed, 30 insertions(+), 36 deletions(-) diff --git a/x/merkledb/db.go b/x/merkledb/db.go index a4af8058a440..021ebc12d7d8 100644 --- a/x/merkledb/db.go +++ b/x/merkledb/db.go @@ -259,23 +259,22 @@ func newDatabase( return make([]byte, 0, defaultBufferLength) }, } - iNodeDB, err := newIntermediateNodeDB( - db, - bufferPool, - metrics, - int(config.IntermediateNodeCacheSize), - int(config.IntermediateWriteBufferSize), - int(config.IntermediateWriteBatchSize), - BranchFactorToTokenSize[config.BranchFactor]) - if err != nil { - return nil, err - } trieDB := &merkleDB{ - metrics: metrics, - baseDB: db, - intermediateNodeDB: iNodeDB, - valueNodeDB: newValueNodeDB(db, bufferPool, metrics, int(config.ValueNodeCacheSize)), + metrics: metrics, + baseDB: db, + intermediateNodeDB: newIntermediateNodeDB( + db, + bufferPool, + metrics, + int(config.IntermediateNodeCacheSize), + int(config.IntermediateWriteBufferSize), + int(config.IntermediateWriteBatchSize), + BranchFactorToTokenSize[config.BranchFactor]), + valueNodeDB: newValueNodeDB(db, + bufferPool, + metrics, + int(config.ValueNodeCacheSize)), history: newTrieHistory(int(config.HistoryLength)), debugTracer: getTracerIfEnabled(config.TraceLevel, DebugTrace, config.Tracer), infoTracer: getTracerIfEnabled(config.TraceLevel, InfoTrace, config.Tracer), diff --git a/x/merkledb/intermediate_node_db.go b/x/merkledb/intermediate_node_db.go index fa31771d7b36..b0318e99064d 100644 --- a/x/merkledb/intermediate_node_db.go +++ b/x/merkledb/intermediate_node_db.go @@ -4,7 +4,6 @@ package merkledb import ( - "errors" "sync" "github.com/ava-labs/avalanchego/cache" @@ -14,8 +13,6 @@ import ( const defaultBufferLength = 256 -var errCacheSizeTooSmall = errors.New("cache size must be larger than or equal to write buffer size") - // Holds intermediate nodes. That is, those without values. // Changes to this database aren't written to [baseDB] until // they're evicted from the [nodeCache] or Flush is called. @@ -51,10 +48,7 @@ func newIntermediateNodeDB( writeBufferSize int, evictionBatchSize int, tokenSize int, -) (*intermediateNodeDB, error) { - if cacheSize < writeBufferSize { - return nil, errCacheSizeTooSmall - } +) *intermediateNodeDB { result := &intermediateNodeDB{ metrics: metrics, baseDB: db, @@ -69,7 +63,7 @@ func newIntermediateNodeDB( result.onEviction, ) - return result, nil + return result } // A non-nil error is considered fatal and closes [db.baseDB]. @@ -125,6 +119,15 @@ func (db *intermediateNodeDB) Get(key Key) (*node, error) { } db.metrics.IntermediateNodeCacheMiss() + if cachedValue, isCached := db.writeBuffer.Get(key); isCached { + db.metrics.IntermediateNodeCacheHit() + if cachedValue == nil { + return nil, database.ErrNotFound + } + return cachedValue, nil + } + db.metrics.IntermediateNodeCacheMiss() + dbKey := db.constructDBKey(key) db.metrics.DatabaseNodeRead() nodeBytes, err := db.baseDB.Get(dbKey) diff --git a/x/merkledb/intermediate_node_db_test.go b/x/merkledb/intermediate_node_db_test.go index 86bf67475096..26ad722ffa45 100644 --- a/x/merkledb/intermediate_node_db_test.go +++ b/x/merkledb/intermediate_node_db_test.go @@ -33,7 +33,7 @@ func Test_IntermediateNodeDB(t *testing.T) { evictionBatchSize := bufferSize baseDB := memdb.New() - db, err := newIntermediateNodeDB( + db := newIntermediateNodeDB( baseDB, &sync.Pool{ New: func() interface{} { return make([]byte, 0) }, @@ -44,7 +44,6 @@ func Test_IntermediateNodeDB(t *testing.T) { evictionBatchSize, 4, ) - require.NoError(err) // Put a key-node pair node1Key := ToKey([]byte{0x01}) @@ -148,7 +147,7 @@ func FuzzIntermediateNodeDBConstructDBKey(f *testing.F) { ) { require := require.New(t) for _, tokenSize := range validTokenSizes { - db, err := newIntermediateNodeDB( + db := newIntermediateNodeDB( baseDB, &sync.Pool{ New: func() interface{} { return make([]byte, 0) }, @@ -159,7 +158,6 @@ func FuzzIntermediateNodeDBConstructDBKey(f *testing.F) { evictionBatchSize, tokenSize, ) - require.NoError(err) p := ToKey(key) uBitLength := tokenLength * uint(tokenSize) @@ -192,7 +190,7 @@ func Test_IntermediateNodeDB_ConstructDBKey_DirtyBuffer(t *testing.T) { bufferSize := 200 evictionBatchSize := bufferSize baseDB := memdb.New() - db, err := newIntermediateNodeDB( + db := newIntermediateNodeDB( baseDB, &sync.Pool{ New: func() interface{} { return make([]byte, 0) }, @@ -204,8 +202,6 @@ func Test_IntermediateNodeDB_ConstructDBKey_DirtyBuffer(t *testing.T) { 4, ) - require.NoError(err) - db.bufferPool.Put([]byte{0xFF, 0xFF, 0xFF}) constructedKey := db.constructDBKey(ToKey([]byte{})) require.Len(constructedKey, 2) @@ -231,7 +227,7 @@ func TestIntermediateNodeDBClear(t *testing.T) { bufferSize := 200 evictionBatchSize := bufferSize baseDB := memdb.New() - db, err := newIntermediateNodeDB( + db := newIntermediateNodeDB( baseDB, &sync.Pool{ New: func() interface{} { return make([]byte, 0) }, @@ -243,8 +239,6 @@ func TestIntermediateNodeDBClear(t *testing.T) { 4, ) - require.NoError(err) - for _, b := range [][]byte{{1}, {2}, {3}} { require.NoError(db.Put(ToKey(b), newNode(ToKey(b)))) } @@ -269,7 +263,7 @@ func TestIntermediateNodeDBDeleteEmptyKey(t *testing.T) { bufferSize := 200 evictionBatchSize := bufferSize baseDB := memdb.New() - db, err := newIntermediateNodeDB( + db := newIntermediateNodeDB( baseDB, &sync.Pool{ New: func() interface{} { return make([]byte, 0) }, @@ -281,8 +275,6 @@ func TestIntermediateNodeDBDeleteEmptyKey(t *testing.T) { 4, ) - require.NoError(err) - emptyKey := ToKey([]byte{}) require.NoError(db.Put(emptyKey, newNode(emptyKey))) require.NoError(db.Flush()) From 71f920d8b5073b878d15f5ac8a0e68d13b74e8f3 Mon Sep 17 00:00:00 2001 From: Stephen Buttolph Date: Thu, 4 Jan 2024 17:23:24 -0500 Subject: [PATCH 22/57] Remove codec length check after Durango (#2586) --- api/keystore/codec.go | 7 ++- chains/atomic/codec.go | 7 ++- codec/hierarchycodec/codec.go | 9 +-- codec/hierarchycodec/codec_test.go | 22 ++++++- codec/linearcodec/codec.go | 13 +++-- codec/linearcodec/codec_test.go | 22 ++++++- codec/reflectcodec/type_codec.go | 49 ++++++++++------ codec/test_codec.go | 57 +++++++++++++++++++ database/encdb/codec.go | 4 +- database/linkeddb/codec.go | 3 +- genesis/genesis.go | 9 ++- go.mod | 2 +- go.sum | 4 +- indexer/codec.go | 3 +- node/node.go | 16 +++++- snow/engine/avalanche/vertex/codec.go | 6 +- vms/avm/block/block_test.go | 18 ++++-- vms/avm/block/builder/builder_test.go | 9 ++- vms/avm/block/parser.go | 8 ++- vms/avm/config/config.go | 5 ++ vms/avm/environment_test.go | 10 +++- vms/avm/network/gossip_test.go | 14 +++-- vms/avm/network/network_test.go | 57 ++++++++++++------- vms/avm/state/state_test.go | 9 ++- vms/avm/static_service.go | 14 +++-- vms/avm/txs/base_tx_test.go | 10 +++- vms/avm/txs/create_asset_tx_test.go | 19 +++++-- vms/avm/txs/executor/executor_test.go | 16 +++++- .../txs/executor/semantic_verifier_test.go | 5 ++ .../txs/executor/syntactic_verifier_test.go | 46 ++++++++++----- vms/avm/txs/export_tx_test.go | 10 +++- vms/avm/txs/import_tx_test.go | 10 +++- vms/avm/txs/initial_state_test.go | 13 +++-- vms/avm/txs/operation_test.go | 3 +- vms/avm/txs/parser.go | 10 ++-- vms/avm/vm.go | 1 + vms/components/avax/asset_test.go | 3 +- vms/components/avax/transferables_test.go | 9 +-- vms/components/avax/utxo_fetching_test.go | 5 +- vms/components/avax/utxo_id_test.go | 3 +- vms/components/avax/utxo_state_test.go | 3 +- vms/components/avax/utxo_test.go | 3 +- vms/components/keystore/codec.go | 5 +- vms/components/message/codec.go | 5 +- vms/example/xsvm/tx/codec.go | 3 +- vms/nftfx/fx_test.go | 32 +++++------ vms/platformvm/block/builder/helpers_test.go | 2 +- vms/platformvm/block/codec.go | 43 +++++++++----- vms/platformvm/block/executor/helpers_test.go | 2 +- vms/platformvm/state/metadata_codec.go | 5 +- vms/platformvm/txs/codec.go | 32 ++++++++--- vms/platformvm/txs/executor/helpers_test.go | 2 +- vms/platformvm/vm.go | 3 +- vms/platformvm/warp/codec.go | 3 +- vms/platformvm/warp/payload/codec.go | 8 +-- vms/propertyfx/fx_test.go | 26 ++++----- vms/proposervm/block/codec.go | 3 +- vms/proposervm/state/codec.go | 3 +- vms/proposervm/summary/codec.go | 3 +- vms/secp256k1fx/credential_test.go | 3 +- vms/secp256k1fx/fx_test.go | 48 ++++++++-------- vms/secp256k1fx/transfer_input_test.go | 3 +- vms/secp256k1fx/transfer_output_test.go | 3 +- wallet/chain/x/constants.go | 15 +++-- 64 files changed, 544 insertions(+), 254 deletions(-) diff --git a/api/keystore/codec.go b/api/keystore/codec.go index 099bdbfa79e7..b925747c44ec 100644 --- a/api/keystore/codec.go +++ b/api/keystore/codec.go @@ -4,6 +4,8 @@ package keystore import ( + "time" + "github.com/ava-labs/avalanchego/codec" "github.com/ava-labs/avalanchego/codec/linearcodec" "github.com/ava-labs/avalanchego/utils/units" @@ -12,14 +14,13 @@ import ( const ( CodecVersion = 0 - maxPackerSize = 1 * units.GiB // max size, in bytes, of something being marshalled by Marshal() - maxSliceLength = linearcodec.DefaultMaxSliceLength + maxPackerSize = 1 * units.GiB // max size, in bytes, of something being marshalled by Marshal() ) var Codec codec.Manager func init() { - lc := linearcodec.NewCustomMaxLength(maxSliceLength) + lc := linearcodec.NewDefault(time.Time{}) Codec = codec.NewManager(maxPackerSize) if err := Codec.RegisterCodec(CodecVersion, lc); err != nil { panic(err) diff --git a/chains/atomic/codec.go b/chains/atomic/codec.go index 6a947fb27841..290713b3c258 100644 --- a/chains/atomic/codec.go +++ b/chains/atomic/codec.go @@ -4,6 +4,9 @@ package atomic import ( + "math" + "time" + "github.com/ava-labs/avalanchego/codec" "github.com/ava-labs/avalanchego/codec/linearcodec" ) @@ -14,8 +17,8 @@ const CodecVersion = 0 var Codec codec.Manager func init() { - lc := linearcodec.NewDefault() - Codec = codec.NewDefaultManager() + lc := linearcodec.NewDefault(time.Time{}) + Codec = codec.NewManager(math.MaxInt) if err := Codec.RegisterCodec(CodecVersion, lc); err != nil { panic(err) } diff --git a/codec/hierarchycodec/codec.go b/codec/hierarchycodec/codec.go index 63bd9efa0443..db2ffed0425d 100644 --- a/codec/hierarchycodec/codec.go +++ b/codec/hierarchycodec/codec.go @@ -7,6 +7,7 @@ import ( "fmt" "reflect" "sync" + "time" "github.com/ava-labs/avalanchego/codec" "github.com/ava-labs/avalanchego/codec/reflectcodec" @@ -50,19 +51,19 @@ type hierarchyCodec struct { } // New returns a new, concurrency-safe codec -func New(tagNames []string, maxSliceLen uint32) Codec { +func New(durangoTime time.Time, tagNames []string, maxSliceLen uint32) Codec { hCodec := &hierarchyCodec{ currentGroupID: 0, nextTypeID: 0, registeredTypes: bimap.New[typeID, reflect.Type](), } - hCodec.Codec = reflectcodec.New(hCodec, tagNames, maxSliceLen) + hCodec.Codec = reflectcodec.New(hCodec, tagNames, durangoTime, maxSliceLen) return hCodec } // NewDefault returns a new codec with reasonable default values -func NewDefault() Codec { - return New([]string{reflectcodec.DefaultTagName}, defaultMaxSliceLength) +func NewDefault(durangoTime time.Time) Codec { + return New(durangoTime, []string{reflectcodec.DefaultTagName}, defaultMaxSliceLength) } // SkipRegistrations some number of type IDs diff --git a/codec/hierarchycodec/codec_test.go b/codec/hierarchycodec/codec_test.go index 72f3e30982db..8149cdcc65e2 100644 --- a/codec/hierarchycodec/codec_test.go +++ b/codec/hierarchycodec/codec_test.go @@ -5,25 +5,41 @@ package hierarchycodec import ( "testing" + "time" "github.com/ava-labs/avalanchego/codec" + "github.com/ava-labs/avalanchego/utils/timer/mockable" ) func TestVectors(t *testing.T) { for _, test := range codec.Tests { - c := NewDefault() + c := NewDefault(mockable.MaxTime) test(c, t) } } func TestMultipleTags(t *testing.T) { for _, test := range codec.MultipleTagsTests { - c := New([]string{"tag1", "tag2"}, defaultMaxSliceLength) + c := New(mockable.MaxTime, []string{"tag1", "tag2"}, defaultMaxSliceLength) + test(c, t) + } +} + +func TestEnforceSliceLen(t *testing.T) { + for _, test := range codec.EnforceSliceLenTests { + c := NewDefault(mockable.MaxTime) + test(c, t) + } +} + +func TestIgnoreSliceLen(t *testing.T) { + for _, test := range codec.IgnoreSliceLenTests { + c := NewDefault(time.Time{}) test(c, t) } } func FuzzStructUnmarshalHierarchyCodec(f *testing.F) { - c := NewDefault() + c := NewDefault(mockable.MaxTime) codec.FuzzStructUnmarshal(c, f) } diff --git a/codec/linearcodec/codec.go b/codec/linearcodec/codec.go index 0bb0dbf27ed1..6ad36b8a197d 100644 --- a/codec/linearcodec/codec.go +++ b/codec/linearcodec/codec.go @@ -7,6 +7,7 @@ import ( "fmt" "reflect" "sync" + "time" "github.com/ava-labs/avalanchego/codec" "github.com/ava-labs/avalanchego/codec/reflectcodec" @@ -44,23 +45,23 @@ type linearCodec struct { // New returns a new, concurrency-safe codec; it allow to specify // both tagNames and maxSlicelenght -func New(tagNames []string, maxSliceLen uint32) Codec { +func New(durangoTime time.Time, tagNames []string, maxSliceLen uint32) Codec { hCodec := &linearCodec{ nextTypeID: 0, registeredTypes: bimap.New[uint32, reflect.Type](), } - hCodec.Codec = reflectcodec.New(hCodec, tagNames, maxSliceLen) + hCodec.Codec = reflectcodec.New(hCodec, tagNames, durangoTime, maxSliceLen) return hCodec } // NewDefault is a convenience constructor; it returns a new codec with reasonable default values -func NewDefault() Codec { - return New([]string{reflectcodec.DefaultTagName}, DefaultMaxSliceLength) +func NewDefault(durangoTime time.Time) Codec { + return New(durangoTime, []string{reflectcodec.DefaultTagName}, DefaultMaxSliceLength) } // NewCustomMaxLength is a convenience constructor; it returns a new codec with custom max length and default tags -func NewCustomMaxLength(maxSliceLen uint32) Codec { - return New([]string{reflectcodec.DefaultTagName}, maxSliceLen) +func NewCustomMaxLength(durangoTime time.Time, maxSliceLen uint32) Codec { + return New(durangoTime, []string{reflectcodec.DefaultTagName}, maxSliceLen) } // Skip some number of type IDs diff --git a/codec/linearcodec/codec_test.go b/codec/linearcodec/codec_test.go index 1e9b14852a72..3d2f3efff68a 100644 --- a/codec/linearcodec/codec_test.go +++ b/codec/linearcodec/codec_test.go @@ -5,25 +5,41 @@ package linearcodec import ( "testing" + "time" "github.com/ava-labs/avalanchego/codec" + "github.com/ava-labs/avalanchego/utils/timer/mockable" ) func TestVectors(t *testing.T) { for _, test := range codec.Tests { - c := NewDefault() + c := NewDefault(mockable.MaxTime) test(c, t) } } func TestMultipleTags(t *testing.T) { for _, test := range codec.MultipleTagsTests { - c := New([]string{"tag1", "tag2"}, DefaultMaxSliceLength) + c := New(mockable.MaxTime, []string{"tag1", "tag2"}, DefaultMaxSliceLength) + test(c, t) + } +} + +func TestEnforceSliceLen(t *testing.T) { + for _, test := range codec.EnforceSliceLenTests { + c := NewDefault(mockable.MaxTime) + test(c, t) + } +} + +func TestIgnoreSliceLen(t *testing.T) { + for _, test := range codec.IgnoreSliceLenTests { + c := NewDefault(time.Time{}) test(c, t) } } func FuzzStructUnmarshalLinearCodec(f *testing.F) { - c := NewDefault() + c := NewDefault(mockable.MaxTime) codec.FuzzStructUnmarshal(c, f) } diff --git a/codec/reflectcodec/type_codec.go b/codec/reflectcodec/type_codec.go index 30a8d9dcc268..312927559280 100644 --- a/codec/reflectcodec/type_codec.go +++ b/codec/reflectcodec/type_codec.go @@ -9,6 +9,7 @@ import ( "fmt" "math" "reflect" + "time" "golang.org/x/exp/slices" @@ -72,14 +73,16 @@ type TypeCodec interface { // 7. nil slices are marshaled as empty slices type genericCodec struct { typer TypeCodec + durangoTime time.Time // Time after which [maxSliceLen] will be ignored maxSliceLen uint32 fielder StructFielder } // New returns a new, concurrency-safe codec -func New(typer TypeCodec, tagNames []string, maxSliceLen uint32) codec.Codec { +func New(typer TypeCodec, tagNames []string, durangoTime time.Time, maxSliceLen uint32) codec.Codec { return &genericCodec{ typer: typer, + durangoTime: durangoTime, maxSliceLen: maxSliceLen, fielder: NewStructFielder(tagNames), } @@ -361,7 +364,14 @@ func (c *genericCodec) marshal( return p.Err case reflect.Slice: numElts := value.Len() // # elements in the slice/array. 0 if this slice is nil. - if uint32(numElts) > c.maxSliceLen { + if numElts > math.MaxInt32 { + return fmt.Errorf("%w; slice length, %d, exceeds maximum length, %d", + codec.ErrMaxSliceLenExceeded, + numElts, + math.MaxInt32, + ) + } + if time.Now().Before(c.durangoTime) && uint32(numElts) > c.maxSliceLen { return fmt.Errorf("%w; slice length, %d, exceeds maximum length, %d", codec.ErrMaxSliceLenExceeded, numElts, @@ -391,19 +401,12 @@ func (c *genericCodec) marshal( } return nil case reflect.Array: - numElts := value.Len() if elemKind := value.Type().Kind(); elemKind == reflect.Uint8 { sliceVal := value.Convert(reflect.TypeOf([]byte{})) p.PackFixedBytes(sliceVal.Bytes()) return p.Err } - if uint32(numElts) > c.maxSliceLen { - return fmt.Errorf("%w; array length, %d, exceeds maximum length, %d", - codec.ErrMaxSliceLenExceeded, - numElts, - c.maxSliceLen, - ) - } + numElts := value.Len() for i := 0; i < numElts; i++ { // Process each element in the array if err := c.marshal(value.Index(i), p, typeStack); err != nil { return err @@ -424,7 +427,14 @@ func (c *genericCodec) marshal( case reflect.Map: keys := value.MapKeys() numElts := len(keys) - if uint32(numElts) > c.maxSliceLen { + if numElts > math.MaxInt32 { + return fmt.Errorf("%w; slice length, %d, exceeds maximum length, %d", + codec.ErrMaxSliceLenExceeded, + numElts, + math.MaxInt32, + ) + } + if time.Now().Before(c.durangoTime) && uint32(numElts) > c.maxSliceLen { return fmt.Errorf("%w; map length, %d, exceeds maximum length, %d", codec.ErrMaxSliceLenExceeded, numElts, @@ -586,18 +596,18 @@ func (c *genericCodec) unmarshal( if p.Err != nil { return fmt.Errorf("couldn't unmarshal slice: %w", p.Err) } - if numElts32 > c.maxSliceLen { + if numElts32 > math.MaxInt32 { return fmt.Errorf("%w; array length, %d, exceeds maximum length, %d", codec.ErrMaxSliceLenExceeded, numElts32, - c.maxSliceLen, + math.MaxInt32, ) } - if numElts32 > math.MaxInt32 { + if time.Now().Before(c.durangoTime) && numElts32 > c.maxSliceLen { return fmt.Errorf("%w; array length, %d, exceeds maximum length, %d", codec.ErrMaxSliceLenExceeded, numElts32, - math.MaxInt32, + c.maxSliceLen, ) } numElts := int(numElts32) @@ -694,7 +704,14 @@ func (c *genericCodec) unmarshal( if p.Err != nil { return fmt.Errorf("couldn't unmarshal map: %w", p.Err) } - if numElts32 > c.maxSliceLen { + if numElts32 > math.MaxInt32 { + return fmt.Errorf("%w; map length, %d, exceeds maximum length, %d", + codec.ErrMaxSliceLenExceeded, + numElts32, + math.MaxInt32, + ) + } + if time.Now().Before(c.durangoTime) && numElts32 > c.maxSliceLen { return fmt.Errorf("%w; map length, %d, exceeds maximum length, %d", codec.ErrMaxSliceLenExceeded, numElts32, diff --git a/codec/test_codec.go b/codec/test_codec.go index 931f9bd2e89d..d58e2d818f9e 100644 --- a/codec/test_codec.go +++ b/codec/test_codec.go @@ -8,6 +8,8 @@ import ( "testing" "github.com/stretchr/testify/require" + + "github.com/ava-labs/avalanchego/utils/wrappers" ) var ( @@ -47,6 +49,15 @@ var ( MultipleTagsTests = []func(c GeneralCodec, t testing.TB){ TestMultipleTags, } + + EnforceSliceLenTests = []func(c GeneralCodec, t testing.TB){ + TestCanNotMarshalLargeSlices, + TestCanNotUnmarshalLargeSlices, + } + + IgnoreSliceLenTests = []func(c GeneralCodec, t testing.TB){ + TestCanMarshalLargeSlices, + } ) // The below structs and interfaces exist @@ -1020,6 +1031,52 @@ func TestMap(codec GeneralCodec, t testing.TB) { require.Len(outerArrayBytes, outerArraySize) } +func TestCanNotMarshalLargeSlices(codec GeneralCodec, t testing.TB) { + require := require.New(t) + + data := make([]uint16, 1_000_000) + + manager := NewManager(math.MaxInt) + require.NoError(manager.RegisterCodec(0, codec)) + + _, err := manager.Marshal(0, data) + require.ErrorIs(err, ErrMaxSliceLenExceeded) +} + +func TestCanNotUnmarshalLargeSlices(codec GeneralCodec, t testing.TB) { + require := require.New(t) + + writer := wrappers.Packer{ + Bytes: make([]byte, 2+4+2_000_000), + } + writer.PackShort(0) + writer.PackInt(1_000_000) + + manager := NewManager(math.MaxInt) + require.NoError(manager.RegisterCodec(0, codec)) + + var data []uint16 + _, err := manager.Unmarshal(writer.Bytes, &data) + require.ErrorIs(err, ErrMaxSliceLenExceeded) +} + +func TestCanMarshalLargeSlices(codec GeneralCodec, t testing.TB) { + require := require.New(t) + + data := make([]uint16, 1_000_000) + + manager := NewManager(math.MaxInt) + require.NoError(manager.RegisterCodec(0, codec)) + + bytes, err := manager.Marshal(0, data) + require.NoError(err) + + var unmarshalledData []uint16 + _, err = manager.Unmarshal(bytes, &unmarshalledData) + require.NoError(err) + require.Equal(data, unmarshalledData) +} + func FuzzStructUnmarshal(codec GeneralCodec, f *testing.F) { manager := NewDefaultManager() // Register the types that may be unmarshaled into interfaces diff --git a/database/encdb/codec.go b/database/encdb/codec.go index b786bec66916..62223b4fdd2f 100644 --- a/database/encdb/codec.go +++ b/database/encdb/codec.go @@ -4,6 +4,8 @@ package encdb import ( + "time" + "github.com/ava-labs/avalanchego/codec" "github.com/ava-labs/avalanchego/codec/linearcodec" ) @@ -13,7 +15,7 @@ const CodecVersion = 0 var Codec codec.Manager func init() { - lc := linearcodec.NewDefault() + lc := linearcodec.NewDefault(time.Time{}) Codec = codec.NewDefaultManager() if err := Codec.RegisterCodec(CodecVersion, lc); err != nil { diff --git a/database/linkeddb/codec.go b/database/linkeddb/codec.go index 24c5398aa8a1..f1982e1c7cfd 100644 --- a/database/linkeddb/codec.go +++ b/database/linkeddb/codec.go @@ -5,6 +5,7 @@ package linkeddb import ( "math" + "time" "github.com/ava-labs/avalanchego/codec" "github.com/ava-labs/avalanchego/codec/linearcodec" @@ -15,7 +16,7 @@ const CodecVersion = 0 var Codec codec.Manager func init() { - lc := linearcodec.NewCustomMaxLength(math.MaxUint32) + lc := linearcodec.NewDefault(time.Time{}) Codec = codec.NewManager(math.MaxInt32) if err := Codec.RegisterCodec(CodecVersion, lc); err != nil { diff --git a/genesis/genesis.go b/genesis/genesis.go index 217713520fb0..6a61b80aa559 100644 --- a/genesis/genesis.go +++ b/genesis/genesis.go @@ -552,9 +552,12 @@ func VMGenesis(genesisBytes []byte, vmID ids.ID) (*pchaintxs.Tx, error) { } func AVAXAssetID(avmGenesisBytes []byte) (ids.ID, error) { - parser, err := xchaintxs.NewParser([]fxs.Fx{ - &secp256k1fx.Fx{}, - }) + parser, err := xchaintxs.NewParser( + time.Time{}, + []fxs.Fx{ + &secp256k1fx.Fx{}, + }, + ) if err != nil { return ids.Empty, err } diff --git a/go.mod b/go.mod index c1b6367a5223..7e333adf6682 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/DataDog/zstd v1.5.2 github.com/Microsoft/go-winio v0.5.2 github.com/NYTimes/gziphandler v1.1.1 - github.com/ava-labs/coreth v0.12.10-rc.2 + github.com/ava-labs/coreth v0.12.10-rc.4 github.com/ava-labs/ledger-avalanche/go v0.0.0-20231102202641-ae2ebdaeac34 github.com/btcsuite/btcd/btcutil v1.1.3 github.com/cockroachdb/pebble v0.0.0-20230209160836-829675f94811 diff --git a/go.sum b/go.sum index d83821fc4ceb..df800dfefb61 100644 --- a/go.sum +++ b/go.sum @@ -66,8 +66,8 @@ github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/ava-labs/coreth v0.12.10-rc.2 h1:+2YK7PzStcLCHtsBb1VQjw6DyMl1sMZatReZAyIy7w8= -github.com/ava-labs/coreth v0.12.10-rc.2/go.mod h1:RIbv14KMyWSj4hB1danS+vEPCUsgArZUEo99SaP5nW8= +github.com/ava-labs/coreth v0.12.10-rc.4 h1:+Ll3cpi3tZbw37lTa+1a/VnPa7xZktpbAFiuKtDKnIE= +github.com/ava-labs/coreth v0.12.10-rc.4/go.mod h1:8pt5LW6MP/luIdhQA+gvs8LobKE8tP/5APXUiFbfb2c= github.com/ava-labs/ledger-avalanche/go v0.0.0-20231102202641-ae2ebdaeac34 h1:mg9Uw6oZFJKytJxgxnl3uxZOs/SB8CVHg6Io4Tf99Zc= github.com/ava-labs/ledger-avalanche/go v0.0.0-20231102202641-ae2ebdaeac34/go.mod h1:pJxaT9bUgeRNVmNRgtCHb7sFDIRKy7CzTQVi8gGNT6g= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= diff --git a/indexer/codec.go b/indexer/codec.go index 6addc9e3ca19..afde47502ac3 100644 --- a/indexer/codec.go +++ b/indexer/codec.go @@ -5,6 +5,7 @@ package indexer import ( "math" + "time" "github.com/ava-labs/avalanchego/codec" "github.com/ava-labs/avalanchego/codec/linearcodec" @@ -15,7 +16,7 @@ const CodecVersion = 0 var Codec codec.Manager func init() { - lc := linearcodec.NewCustomMaxLength(math.MaxUint32) + lc := linearcodec.NewDefault(time.Time{}) Codec = codec.NewManager(math.MaxInt) if err := Codec.RegisterCodec(CodecVersion, lc); err != nil { diff --git a/node/node.go b/node/node.go index c5d75c2e1d59..45e2f6a506eb 100644 --- a/node/node.go +++ b/node/node.go @@ -78,7 +78,9 @@ import ( "github.com/ava-labs/avalanchego/vms/avm" "github.com/ava-labs/avalanchego/vms/nftfx" "github.com/ava-labs/avalanchego/vms/platformvm" + "github.com/ava-labs/avalanchego/vms/platformvm/block" "github.com/ava-labs/avalanchego/vms/platformvm/signer" + "github.com/ava-labs/avalanchego/vms/platformvm/txs" "github.com/ava-labs/avalanchego/vms/propertyfx" "github.com/ava-labs/avalanchego/vms/registry" "github.com/ava-labs/avalanchego/vms/rpcchainvm/runtime" @@ -1075,6 +1077,17 @@ func (n *Node) initVMs() error { VMManager: n.VMManager, }) + durangoTime := version.GetDurangoTime(n.Config.NetworkID) + if err := txs.InitCodec(durangoTime); err != nil { + return err + } + if err := block.InitCodec(durangoTime); err != nil { + return err + } + if err := coreth.InitCodec(durangoTime); err != nil { + return err + } + // Register the VMs that Avalanche supports err := utils.Err( vmRegisterer.Register(context.TODO(), constants.PlatformVMID, &platformvm.Factory{ @@ -1106,7 +1119,7 @@ func (n *Node) initVMs() error { ApricotPhase5Time: version.GetApricotPhase5Time(n.Config.NetworkID), BanffTime: version.GetBanffTime(n.Config.NetworkID), CortinaTime: version.GetCortinaTime(n.Config.NetworkID), - DurangoTime: version.GetDurangoTime(n.Config.NetworkID), + DurangoTime: durangoTime, UseCurrentHeight: n.Config.UseCurrentHeight, }, }), @@ -1114,6 +1127,7 @@ func (n *Node) initVMs() error { Config: avmconfig.Config{ TxFee: n.Config.TxFee, CreateAssetTxFee: n.Config.CreateAssetTxFee, + DurangoTime: durangoTime, }, }), vmRegisterer.Register(context.TODO(), constants.EVMID, &coreth.Factory{}), diff --git a/snow/engine/avalanche/vertex/codec.go b/snow/engine/avalanche/vertex/codec.go index c6da27f1f57f..12f387d0d25d 100644 --- a/snow/engine/avalanche/vertex/codec.go +++ b/snow/engine/avalanche/vertex/codec.go @@ -4,6 +4,8 @@ package vertex import ( + "time" + "github.com/ava-labs/avalanchego/codec" "github.com/ava-labs/avalanchego/codec/linearcodec" "github.com/ava-labs/avalanchego/codec/reflectcodec" @@ -22,8 +24,8 @@ const ( var Codec codec.Manager func init() { - lc0 := linearcodec.New([]string{reflectcodec.DefaultTagName + "V0"}, maxSize) - lc1 := linearcodec.New([]string{reflectcodec.DefaultTagName + "V1"}, maxSize) + lc0 := linearcodec.New(time.Time{}, []string{reflectcodec.DefaultTagName + "V0"}, maxSize) + lc1 := linearcodec.New(time.Time{}, []string{reflectcodec.DefaultTagName + "V1"}, maxSize) Codec = codec.NewManager(maxSize) err := utils.Err( diff --git a/vms/avm/block/block_test.go b/vms/avm/block/block_test.go index db2e3b074b59..6100f1d6d987 100644 --- a/vms/avm/block/block_test.go +++ b/vms/avm/block/block_test.go @@ -28,9 +28,12 @@ var ( func TestInvalidBlock(t *testing.T) { require := require.New(t) - parser, err := NewParser([]fxs.Fx{ - &secp256k1fx.Fx{}, - }) + parser, err := NewParser( + time.Time{}, + []fxs.Fx{ + &secp256k1fx.Fx{}, + }, + ) require.NoError(err) _, err = parser.ParseBlock(nil) @@ -41,9 +44,12 @@ func TestStandardBlocks(t *testing.T) { // check standard block can be built and parsed require := require.New(t) - parser, err := NewParser([]fxs.Fx{ - &secp256k1fx.Fx{}, - }) + parser, err := NewParser( + time.Time{}, + []fxs.Fx{ + &secp256k1fx.Fx{}, + }, + ) require.NoError(err) blkTimestamp := time.Now() diff --git a/vms/avm/block/builder/builder_test.go b/vms/avm/block/builder/builder_test.go index 5ff59b8d66f8..185c93260eca 100644 --- a/vms/avm/block/builder/builder_test.go +++ b/vms/avm/block/builder/builder_test.go @@ -514,9 +514,12 @@ func TestBlockBuilderAddLocalTx(t *testing.T) { _, ok := mempool.Get(txID) require.True(ok) - parser, err := block.NewParser([]fxs.Fx{ - &secp256k1fx.Fx{}, - }) + parser, err := block.NewParser( + time.Time{}, + []fxs.Fx{ + &secp256k1fx.Fx{}, + }, + ) require.NoError(err) backend := &txexecutor.Backend{ diff --git a/vms/avm/block/parser.go b/vms/avm/block/parser.go index bfae841093d1..f0c359a513b0 100644 --- a/vms/avm/block/parser.go +++ b/vms/avm/block/parser.go @@ -5,6 +5,7 @@ package block import ( "reflect" + "time" "github.com/ava-labs/avalanchego/codec" "github.com/ava-labs/avalanchego/utils" @@ -30,8 +31,8 @@ type parser struct { txs.Parser } -func NewParser(fxs []fxs.Fx) (Parser, error) { - p, err := txs.NewParser(fxs) +func NewParser(durangoTime time.Time, fxs []fxs.Fx) (Parser, error) { + p, err := txs.NewParser(durangoTime, fxs) if err != nil { return nil, err } @@ -48,12 +49,13 @@ func NewParser(fxs []fxs.Fx) (Parser, error) { } func NewCustomParser( + durangoTime time.Time, typeToFxIndex map[reflect.Type]int, clock *mockable.Clock, log logging.Logger, fxs []fxs.Fx, ) (Parser, error) { - p, err := txs.NewCustomParser(typeToFxIndex, clock, log, fxs) + p, err := txs.NewCustomParser(durangoTime, typeToFxIndex, clock, log, fxs) if err != nil { return nil, err } diff --git a/vms/avm/config/config.go b/vms/avm/config/config.go index 08f6ab04240a..df6e4f7de2ae 100644 --- a/vms/avm/config/config.go +++ b/vms/avm/config/config.go @@ -3,6 +3,8 @@ package config +import "time" + // Struct collecting all the foundational parameters of the AVM type Config struct { // Fee that is burned by every non-asset creating transaction @@ -10,4 +12,7 @@ type Config struct { // Fee that must be burned by every asset creating transaction CreateAssetTxFee uint64 + + // Time of the Durango network upgrade + DurangoTime time.Time } diff --git a/vms/avm/environment_test.go b/vms/avm/environment_test.go index d572298dc5e5..236c20875796 100644 --- a/vms/avm/environment_test.go +++ b/vms/avm/environment_test.go @@ -7,6 +7,7 @@ import ( "context" "math/rand" "testing" + "time" stdjson "encoding/json" @@ -228,9 +229,12 @@ func setup(tb testing.TB, c *envConfig) *environment { func getCreateTxFromGenesisTest(tb testing.TB, genesisBytes []byte, assetName string) *txs.Tx { require := require.New(tb) - parser, err := txs.NewParser([]fxs.Fx{ - &secp256k1fx.Fx{}, - }) + parser, err := txs.NewParser( + time.Time{}, + []fxs.Fx{ + &secp256k1fx.Fx{}, + }, + ) require.NoError(err) cm := parser.GenesisCodec() diff --git a/vms/avm/network/gossip_test.go b/vms/avm/network/gossip_test.go index 725851e54606..8f9df5ac7c86 100644 --- a/vms/avm/network/gossip_test.go +++ b/vms/avm/network/gossip_test.go @@ -5,6 +5,7 @@ package network import ( "testing" + "time" "github.com/prometheus/client_golang/prometheus" @@ -33,9 +34,12 @@ func (v testVerifier) VerifyTx(*txs.Tx) error { func TestMarshaller(t *testing.T) { require := require.New(t) - parser, err := txs.NewParser([]fxs.Fx{ - &secp256k1fx.Fx{}, - }) + parser, err := txs.NewParser( + time.Time{}, + []fxs.Fx{ + &secp256k1fx.Fx{}, + }, + ) require.NoError(err) marhsaller := txParser{ @@ -62,7 +66,7 @@ func TestGossipMempoolAdd(t *testing.T) { baseMempool, err := mempool.New("", metrics, toEngine) require.NoError(err) - parser, err := txs.NewParser(nil) + parser, err := txs.NewParser(time.Time{}, nil) require.NoError(err) mempool, err := newGossipMempool( @@ -98,7 +102,7 @@ func TestGossipMempoolAddVerified(t *testing.T) { baseMempool, err := mempool.New("", metrics, toEngine) require.NoError(err) - parser, err := txs.NewParser(nil) + parser, err := txs.NewParser(time.Time{}, nil) require.NoError(err) mempool, err := newGossipMempool( diff --git a/vms/avm/network/network_test.go b/vms/avm/network/network_test.go index b2df09eec1b2..f5b45f8a6aae 100644 --- a/vms/avm/network/network_test.go +++ b/vms/avm/network/network_test.go @@ -59,9 +59,12 @@ func TestNetworkAppGossip(t *testing.T) { }, } - parser, err := txs.NewParser([]fxs.Fx{ - &secp256k1fx.Fx{}, - }) + parser, err := txs.NewParser( + time.Time{}, + []fxs.Fx{ + &secp256k1fx.Fx{}, + }, + ) require.NoError(t, err) require.NoError(t, testTx.Initialize(parser.Codec())) @@ -183,11 +186,14 @@ func TestNetworkAppGossip(t *testing.T) { require := require.New(t) ctrl := gomock.NewController(t) - parser, err := txs.NewParser([]fxs.Fx{ - &secp256k1fx.Fx{}, - &nftfx.Fx{}, - &propertyfx.Fx{}, - }) + parser, err := txs.NewParser( + time.Time{}, + []fxs.Fx{ + &secp256k1fx.Fx{}, + &nftfx.Fx{}, + &propertyfx.Fx{}, + }, + ) require.NoError(err) mempoolFunc := func(ctrl *gomock.Controller) mempool.Mempool { @@ -319,11 +325,14 @@ func TestNetworkIssueTx(t *testing.T) { require := require.New(t) ctrl := gomock.NewController(t) - parser, err := txs.NewParser([]fxs.Fx{ - &secp256k1fx.Fx{}, - &nftfx.Fx{}, - &propertyfx.Fx{}, - }) + parser, err := txs.NewParser( + time.Time{}, + []fxs.Fx{ + &secp256k1fx.Fx{}, + &nftfx.Fx{}, + &propertyfx.Fx{}, + }, + ) require.NoError(err) mempoolFunc := func(ctrl *gomock.Controller) mempool.Mempool { @@ -406,11 +415,14 @@ func TestNetworkIssueVerifiedTx(t *testing.T) { require := require.New(t) ctrl := gomock.NewController(t) - parser, err := txs.NewParser([]fxs.Fx{ - &secp256k1fx.Fx{}, - &nftfx.Fx{}, - &propertyfx.Fx{}, - }) + parser, err := txs.NewParser( + time.Time{}, + []fxs.Fx{ + &secp256k1fx.Fx{}, + &nftfx.Fx{}, + &propertyfx.Fx{}, + }, + ) require.NoError(err) mempoolFunc := func(ctrl *gomock.Controller) mempool.Mempool { @@ -449,9 +461,12 @@ func TestNetworkGossipTx(t *testing.T) { require := require.New(t) ctrl := gomock.NewController(t) - parser, err := txs.NewParser([]fxs.Fx{ - &secp256k1fx.Fx{}, - }) + parser, err := txs.NewParser( + time.Time{}, + []fxs.Fx{ + &secp256k1fx.Fx{}, + }, + ) require.NoError(err) appSender := common.NewMockSender(ctrl) diff --git a/vms/avm/state/state_test.go b/vms/avm/state/state_test.go index e0b3c8e1794b..758e55ffd7cd 100644 --- a/vms/avm/state/state_test.go +++ b/vms/avm/state/state_test.go @@ -38,9 +38,12 @@ var ( func init() { var err error - parser, err = block.NewParser([]fxs.Fx{ - &secp256k1fx.Fx{}, - }) + parser, err = block.NewParser( + time.Time{}, + []fxs.Fx{ + &secp256k1fx.Fx{}, + }, + ) if err != nil { panic(err) } diff --git a/vms/avm/static_service.go b/vms/avm/static_service.go index 3599a3faa2de..8340bbb6a5df 100644 --- a/vms/avm/static_service.go +++ b/vms/avm/static_service.go @@ -7,6 +7,7 @@ import ( "errors" "fmt" "net/http" + "time" stdjson "encoding/json" @@ -77,11 +78,14 @@ type BuildGenesisReply struct { // BuildGenesis returns the UTXOs such that at least one address in [args.Addresses] is // referenced in the UTXO. func (*StaticService) BuildGenesis(_ *http.Request, args *BuildGenesisArgs, reply *BuildGenesisReply) error { - parser, err := txs.NewParser([]fxs.Fx{ - &secp256k1fx.Fx{}, - &nftfx.Fx{}, - &propertyfx.Fx{}, - }) + parser, err := txs.NewParser( + time.Time{}, + []fxs.Fx{ + &secp256k1fx.Fx{}, + &nftfx.Fx{}, + &propertyfx.Fx{}, + }, + ) if err != nil { return err } diff --git a/vms/avm/txs/base_tx_test.go b/vms/avm/txs/base_tx_test.go index 4dcb82e38ce7..d7403e3420fc 100644 --- a/vms/avm/txs/base_tx_test.go +++ b/vms/avm/txs/base_tx_test.go @@ -5,6 +5,7 @@ package txs import ( "testing" + "time" "github.com/stretchr/testify/require" @@ -125,9 +126,12 @@ func TestBaseTxSerialization(t *testing.T) { Memo: []byte{0x00, 0x01, 0x02, 0x03}, }}} - parser, err := NewParser([]fxs.Fx{ - &secp256k1fx.Fx{}, - }) + parser, err := NewParser( + time.Time{}, + []fxs.Fx{ + &secp256k1fx.Fx{}, + }, + ) require.NoError(err) require.NoError(tx.Initialize(parser.Codec())) diff --git a/vms/avm/txs/create_asset_tx_test.go b/vms/avm/txs/create_asset_tx_test.go index f71ca13b4de1..9ef548eedea2 100644 --- a/vms/avm/txs/create_asset_tx_test.go +++ b/vms/avm/txs/create_asset_tx_test.go @@ -5,6 +5,7 @@ package txs import ( "testing" + "time" "github.com/stretchr/testify/require" @@ -193,9 +194,12 @@ func TestCreateAssetTxSerialization(t *testing.T) { }, }} - parser, err := NewParser([]fxs.Fx{ - &secp256k1fx.Fx{}, - }) + parser, err := NewParser( + time.Time{}, + []fxs.Fx{ + &secp256k1fx.Fx{}, + }, + ) require.NoError(err) require.NoError(tx.Initialize(parser.Codec())) @@ -362,9 +366,12 @@ func TestCreateAssetTxSerializationAgain(t *testing.T) { }) } - parser, err := NewParser([]fxs.Fx{ - &secp256k1fx.Fx{}, - }) + parser, err := NewParser( + time.Time{}, + []fxs.Fx{ + &secp256k1fx.Fx{}, + }, + ) require.NoError(err) require.NoError(tx.Initialize(parser.Codec())) diff --git a/vms/avm/txs/executor/executor_test.go b/vms/avm/txs/executor/executor_test.go index ba5f13e836ef..66d210b40cb8 100644 --- a/vms/avm/txs/executor/executor_test.go +++ b/vms/avm/txs/executor/executor_test.go @@ -5,6 +5,7 @@ package executor import ( "testing" + "time" "github.com/prometheus/client_golang/prometheus" @@ -37,7 +38,10 @@ func TestBaseTxExecutor(t *testing.T) { require := require.New(t) secpFx := &secp256k1fx.Fx{} - parser, err := block.NewParser([]fxs.Fx{secpFx}) + parser, err := block.NewParser( + time.Time{}, + []fxs.Fx{secpFx}, + ) require.NoError(err) codec := parser.Codec() @@ -142,7 +146,10 @@ func TestCreateAssetTxExecutor(t *testing.T) { require := require.New(t) secpFx := &secp256k1fx.Fx{} - parser, err := block.NewParser([]fxs.Fx{secpFx}) + parser, err := block.NewParser( + time.Time{}, + []fxs.Fx{secpFx}, + ) require.NoError(err) codec := parser.Codec() @@ -285,7 +292,10 @@ func TestOperationTxExecutor(t *testing.T) { require := require.New(t) secpFx := &secp256k1fx.Fx{} - parser, err := block.NewParser([]fxs.Fx{secpFx}) + parser, err := block.NewParser( + time.Time{}, + []fxs.Fx{secpFx}, + ) require.NoError(err) codec := parser.Codec() diff --git a/vms/avm/txs/executor/semantic_verifier_test.go b/vms/avm/txs/executor/semantic_verifier_test.go index 4678d0548fb2..6579e29784d5 100644 --- a/vms/avm/txs/executor/semantic_verifier_test.go +++ b/vms/avm/txs/executor/semantic_verifier_test.go @@ -6,6 +6,7 @@ package executor import ( "reflect" "testing" + "time" "github.com/stretchr/testify/require" @@ -36,6 +37,7 @@ func TestSemanticVerifierBaseTx(t *testing.T) { typeToFxIndex := make(map[reflect.Type]int) secpFx := &secp256k1fx.Fx{} parser, err := txs.NewCustomParser( + time.Time{}, typeToFxIndex, new(mockable.Clock), logging.NoWarn{}, @@ -393,6 +395,7 @@ func TestSemanticVerifierExportTx(t *testing.T) { typeToFxIndex := make(map[reflect.Type]int) secpFx := &secp256k1fx.Fx{} parser, err := txs.NewCustomParser( + time.Time{}, typeToFxIndex, new(mockable.Clock), logging.NoWarn{}, @@ -761,6 +764,7 @@ func TestSemanticVerifierExportTxDifferentSubnet(t *testing.T) { typeToFxIndex := make(map[reflect.Type]int) secpFx := &secp256k1fx.Fx{} parser, err := txs.NewCustomParser( + time.Time{}, typeToFxIndex, new(mockable.Clock), logging.NoWarn{}, @@ -877,6 +881,7 @@ func TestSemanticVerifierImportTx(t *testing.T) { typeToFxIndex := make(map[reflect.Type]int) fx := &secp256k1fx.Fx{} parser, err := txs.NewCustomParser( + time.Time{}, typeToFxIndex, new(mockable.Clock), logging.NoWarn{}, diff --git a/vms/avm/txs/executor/syntactic_verifier_test.go b/vms/avm/txs/executor/syntactic_verifier_test.go index 21f2396148a0..108ac9e94a60 100644 --- a/vms/avm/txs/executor/syntactic_verifier_test.go +++ b/vms/avm/txs/executor/syntactic_verifier_test.go @@ -7,6 +7,7 @@ import ( "math" "strings" "testing" + "time" "github.com/stretchr/testify/require" @@ -36,9 +37,12 @@ func TestSyntacticVerifierBaseTx(t *testing.T) { ctx := snowtest.Context(t, snowtest.XChainID) fx := &secp256k1fx.Fx{} - parser, err := txs.NewParser([]fxs.Fx{ - fx, - }) + parser, err := txs.NewParser( + time.Time{}, + []fxs.Fx{ + fx, + }, + ) require.NoError(t, err) feeAssetID := ids.GenerateTestID() @@ -406,9 +410,12 @@ func TestSyntacticVerifierCreateAssetTx(t *testing.T) { ctx := snowtest.Context(t, snowtest.XChainID) fx := &secp256k1fx.Fx{} - parser, err := txs.NewParser([]fxs.Fx{ - fx, - }) + parser, err := txs.NewParser( + time.Time{}, + []fxs.Fx{ + fx, + }, + ) require.NoError(t, err) feeAssetID := ids.GenerateTestID() @@ -1013,9 +1020,12 @@ func TestSyntacticVerifierOperationTx(t *testing.T) { ctx := snowtest.Context(t, snowtest.XChainID) fx := &secp256k1fx.Fx{} - parser, err := txs.NewParser([]fxs.Fx{ - fx, - }) + parser, err := txs.NewParser( + time.Time{}, + []fxs.Fx{ + fx, + }, + ) require.NoError(t, err) feeAssetID := ids.GenerateTestID() @@ -1500,9 +1510,12 @@ func TestSyntacticVerifierImportTx(t *testing.T) { ctx := snowtest.Context(t, snowtest.XChainID) fx := &secp256k1fx.Fx{} - parser, err := txs.NewParser([]fxs.Fx{ - fx, - }) + parser, err := txs.NewParser( + time.Time{}, + []fxs.Fx{ + fx, + }, + ) require.NoError(t, err) feeAssetID := ids.GenerateTestID() @@ -1898,9 +1911,12 @@ func TestSyntacticVerifierExportTx(t *testing.T) { ctx := snowtest.Context(t, snowtest.XChainID) fx := &secp256k1fx.Fx{} - parser, err := txs.NewParser([]fxs.Fx{ - fx, - }) + parser, err := txs.NewParser( + time.Time{}, + []fxs.Fx{ + fx, + }, + ) require.NoError(t, err) feeAssetID := ids.GenerateTestID() diff --git a/vms/avm/txs/export_tx_test.go b/vms/avm/txs/export_tx_test.go index b56ae7003e5b..1d3ce2dee276 100644 --- a/vms/avm/txs/export_tx_test.go +++ b/vms/avm/txs/export_tx_test.go @@ -5,6 +5,7 @@ package txs import ( "testing" + "time" "github.com/stretchr/testify/require" @@ -108,9 +109,12 @@ func TestExportTxSerialization(t *testing.T) { }, }} - parser, err := NewParser([]fxs.Fx{ - &secp256k1fx.Fx{}, - }) + parser, err := NewParser( + time.Time{}, + []fxs.Fx{ + &secp256k1fx.Fx{}, + }, + ) require.NoError(err) require.NoError(tx.Initialize(parser.Codec())) diff --git a/vms/avm/txs/import_tx_test.go b/vms/avm/txs/import_tx_test.go index 4e4b95a16447..82dd0cfcd7b2 100644 --- a/vms/avm/txs/import_tx_test.go +++ b/vms/avm/txs/import_tx_test.go @@ -5,6 +5,7 @@ package txs import ( "testing" + "time" "github.com/stretchr/testify/require" @@ -108,9 +109,12 @@ func TestImportTxSerialization(t *testing.T) { }}, }} - parser, err := NewParser([]fxs.Fx{ - &secp256k1fx.Fx{}, - }) + parser, err := NewParser( + time.Time{}, + []fxs.Fx{ + &secp256k1fx.Fx{}, + }, + ) require.NoError(err) require.NoError(tx.Initialize(parser.Codec())) diff --git a/vms/avm/txs/initial_state_test.go b/vms/avm/txs/initial_state_test.go index 48c15ae196c4..5f61deb3e7c6 100644 --- a/vms/avm/txs/initial_state_test.go +++ b/vms/avm/txs/initial_state_test.go @@ -7,6 +7,7 @@ import ( "errors" "fmt" "testing" + "time" "github.com/stretchr/testify/require" @@ -23,7 +24,7 @@ var errTest = errors.New("non-nil error") func TestInitialStateVerifySerialization(t *testing.T) { require := require.New(t) - c := linearcodec.NewDefault() + c := linearcodec.NewDefault(time.Time{}) require.NoError(c.RegisterType(&secp256k1fx.TransferOutput{})) m := codec.NewDefaultManager() require.NoError(m.RegisterCodec(CodecVersion, c)) @@ -80,7 +81,7 @@ func TestInitialStateVerifySerialization(t *testing.T) { func TestInitialStateVerifyNil(t *testing.T) { require := require.New(t) - c := linearcodec.NewDefault() + c := linearcodec.NewDefault(time.Time{}) m := codec.NewDefaultManager() require.NoError(m.RegisterCodec(CodecVersion, c)) numFxs := 1 @@ -93,7 +94,7 @@ func TestInitialStateVerifyNil(t *testing.T) { func TestInitialStateVerifyUnknownFxID(t *testing.T) { require := require.New(t) - c := linearcodec.NewDefault() + c := linearcodec.NewDefault(time.Time{}) m := codec.NewDefaultManager() require.NoError(m.RegisterCodec(CodecVersion, c)) numFxs := 1 @@ -108,7 +109,7 @@ func TestInitialStateVerifyUnknownFxID(t *testing.T) { func TestInitialStateVerifyNilOutput(t *testing.T) { require := require.New(t) - c := linearcodec.NewDefault() + c := linearcodec.NewDefault(time.Time{}) m := codec.NewDefaultManager() require.NoError(m.RegisterCodec(CodecVersion, c)) numFxs := 1 @@ -124,7 +125,7 @@ func TestInitialStateVerifyNilOutput(t *testing.T) { func TestInitialStateVerifyInvalidOutput(t *testing.T) { require := require.New(t) - c := linearcodec.NewDefault() + c := linearcodec.NewDefault(time.Time{}) require.NoError(c.RegisterType(&avax.TestState{})) m := codec.NewDefaultManager() require.NoError(m.RegisterCodec(CodecVersion, c)) @@ -141,7 +142,7 @@ func TestInitialStateVerifyInvalidOutput(t *testing.T) { func TestInitialStateVerifyUnsortedOutputs(t *testing.T) { require := require.New(t) - c := linearcodec.NewDefault() + c := linearcodec.NewDefault(time.Time{}) require.NoError(c.RegisterType(&avax.TestTransferable{})) m := codec.NewDefaultManager() require.NoError(m.RegisterCodec(CodecVersion, c)) diff --git a/vms/avm/txs/operation_test.go b/vms/avm/txs/operation_test.go index ac9cf62530c6..3ca4676eb370 100644 --- a/vms/avm/txs/operation_test.go +++ b/vms/avm/txs/operation_test.go @@ -5,6 +5,7 @@ package txs import ( "testing" + "time" "github.com/stretchr/testify/require" @@ -79,7 +80,7 @@ func TestOperationVerify(t *testing.T) { func TestOperationSorting(t *testing.T) { require := require.New(t) - c := linearcodec.NewDefault() + c := linearcodec.NewDefault(time.Time{}) require.NoError(c.RegisterType(&testOperable{})) m := codec.NewDefaultManager() diff --git a/vms/avm/txs/parser.go b/vms/avm/txs/parser.go index 6ccd34e35bd6..979c71d8a7c8 100644 --- a/vms/avm/txs/parser.go +++ b/vms/avm/txs/parser.go @@ -7,10 +7,10 @@ import ( "fmt" "math" "reflect" + "time" "github.com/ava-labs/avalanchego/codec" "github.com/ava-labs/avalanchego/codec/linearcodec" - "github.com/ava-labs/avalanchego/codec/reflectcodec" "github.com/ava-labs/avalanchego/utils" "github.com/ava-labs/avalanchego/utils/logging" "github.com/ava-labs/avalanchego/utils/timer/mockable" @@ -40,8 +40,9 @@ type parser struct { gc linearcodec.Codec } -func NewParser(fxs []fxs.Fx) (Parser, error) { +func NewParser(durangoTime time.Time, fxs []fxs.Fx) (Parser, error) { return NewCustomParser( + durangoTime, make(map[reflect.Type]int), &mockable.Clock{}, logging.NoLog{}, @@ -50,13 +51,14 @@ func NewParser(fxs []fxs.Fx) (Parser, error) { } func NewCustomParser( + durangoTime time.Time, typeToFxIndex map[reflect.Type]int, clock *mockable.Clock, log logging.Logger, fxs []fxs.Fx, ) (Parser, error) { - gc := linearcodec.New([]string{reflectcodec.DefaultTagName}, 1<<20) - c := linearcodec.NewDefault() + gc := linearcodec.NewDefault(time.Time{}) + c := linearcodec.NewDefault(durangoTime) gcm := codec.NewManager(math.MaxInt32) cm := codec.NewDefaultManager() diff --git a/vms/avm/vm.go b/vms/avm/vm.go index fb42158034a7..59907c934e91 100644 --- a/vms/avm/vm.go +++ b/vms/avm/vm.go @@ -219,6 +219,7 @@ func (vm *VM) Initialize( vm.typeToFxIndex = map[reflect.Type]int{} vm.parser, err = block.NewCustomParser( + vm.DurangoTime, vm.typeToFxIndex, &vm.clock, ctx.Log, diff --git a/vms/components/avax/asset_test.go b/vms/components/avax/asset_test.go index ccb6f5549630..ad7628ce98b9 100644 --- a/vms/components/avax/asset_test.go +++ b/vms/components/avax/asset_test.go @@ -5,6 +5,7 @@ package avax import ( "testing" + "time" "github.com/stretchr/testify/require" @@ -28,7 +29,7 @@ func TestAssetVerifyEmpty(t *testing.T) { func TestAssetID(t *testing.T) { require := require.New(t) - c := linearcodec.NewDefault() + c := linearcodec.NewDefault(time.Time{}) manager := codec.NewDefaultManager() require.NoError(manager.RegisterCodec(codecVersion, c)) diff --git a/vms/components/avax/transferables_test.go b/vms/components/avax/transferables_test.go index f46d580e839a..755a0124eb7b 100644 --- a/vms/components/avax/transferables_test.go +++ b/vms/components/avax/transferables_test.go @@ -5,6 +5,7 @@ package avax import ( "testing" + "time" "github.com/stretchr/testify/require" @@ -42,7 +43,7 @@ func TestTransferableOutputVerify(t *testing.T) { func TestTransferableOutputSorting(t *testing.T) { require := require.New(t) - c := linearcodec.NewDefault() + c := linearcodec.NewDefault(time.Time{}) require.NoError(c.RegisterType(&TestTransferable{})) manager := codec.NewDefaultManager() require.NoError(manager.RegisterCodec(codecVersion, c)) @@ -84,7 +85,7 @@ func TestTransferableOutputSorting(t *testing.T) { func TestTransferableOutputSerialization(t *testing.T) { require := require.New(t) - c := linearcodec.NewDefault() + c := linearcodec.NewDefault(time.Time{}) require.NoError(c.RegisterType(&secp256k1fx.TransferOutput{})) manager := codec.NewDefaultManager() require.NoError(manager.RegisterCodec(codecVersion, c)) @@ -175,7 +176,7 @@ func TestTransferableInputVerify(t *testing.T) { func TestTransferableInputSorting(t *testing.T) { require := require.New(t) - c := linearcodec.NewDefault() + c := linearcodec.NewDefault(time.Time{}) require.NoError(c.RegisterType(&TestTransferable{})) ins := []*TransferableInput{ @@ -232,7 +233,7 @@ func TestTransferableInputSorting(t *testing.T) { func TestTransferableInputSerialization(t *testing.T) { require := require.New(t) - c := linearcodec.NewDefault() + c := linearcodec.NewDefault(time.Time{}) require.NoError(c.RegisterType(&secp256k1fx.TransferInput{})) manager := codec.NewDefaultManager() require.NoError(manager.RegisterCodec(codecVersion, c)) diff --git a/vms/components/avax/utxo_fetching_test.go b/vms/components/avax/utxo_fetching_test.go index 25fe3fd91155..e36545c19cb7 100644 --- a/vms/components/avax/utxo_fetching_test.go +++ b/vms/components/avax/utxo_fetching_test.go @@ -5,6 +5,7 @@ package avax import ( "testing" + "time" "github.com/stretchr/testify/require" @@ -39,7 +40,7 @@ func TestFetchUTXOs(t *testing.T) { }, } - c := linearcodec.NewDefault() + c := linearcodec.NewDefault(time.Time{}) manager := codec.NewDefaultManager() require.NoError(c.RegisterType(&secp256k1fx.TransferOutput{})) @@ -72,7 +73,7 @@ func TestGetPaginatedUTXOs(t *testing.T) { addr2 := ids.GenerateTestShortID() addrs := set.Of(addr0, addr1) - c := linearcodec.NewDefault() + c := linearcodec.NewDefault(time.Time{}) manager := codec.NewDefaultManager() require.NoError(c.RegisterType(&secp256k1fx.TransferOutput{})) diff --git a/vms/components/avax/utxo_id_test.go b/vms/components/avax/utxo_id_test.go index 09887c0312e9..fed21d5ce986 100644 --- a/vms/components/avax/utxo_id_test.go +++ b/vms/components/avax/utxo_id_test.go @@ -6,6 +6,7 @@ package avax import ( "math" "testing" + "time" "github.com/stretchr/testify/require" @@ -23,7 +24,7 @@ func TestUTXOIDVerifyNil(t *testing.T) { func TestUTXOID(t *testing.T) { require := require.New(t) - c := linearcodec.NewDefault() + c := linearcodec.NewDefault(time.Time{}) manager := codec.NewDefaultManager() require.NoError(manager.RegisterCodec(codecVersion, c)) diff --git a/vms/components/avax/utxo_state_test.go b/vms/components/avax/utxo_state_test.go index 09213bfa1bc6..fa4c530e011a 100644 --- a/vms/components/avax/utxo_state_test.go +++ b/vms/components/avax/utxo_state_test.go @@ -5,6 +5,7 @@ package avax import ( "testing" + "time" "github.com/stretchr/testify/require" @@ -41,7 +42,7 @@ func TestUTXOState(t *testing.T) { } utxoID := utxo.InputID() - c := linearcodec.NewDefault() + c := linearcodec.NewDefault(time.Time{}) manager := codec.NewDefaultManager() require.NoError(c.RegisterType(&secp256k1fx.MintOutput{})) diff --git a/vms/components/avax/utxo_test.go b/vms/components/avax/utxo_test.go index 54f8360173a7..a79c8fcb6cd6 100644 --- a/vms/components/avax/utxo_test.go +++ b/vms/components/avax/utxo_test.go @@ -5,6 +5,7 @@ package avax import ( "testing" + "time" "github.com/stretchr/testify/require" @@ -32,7 +33,7 @@ func TestUTXOVerifyEmpty(t *testing.T) { func TestUTXOSerialize(t *testing.T) { require := require.New(t) - c := linearcodec.NewDefault() + c := linearcodec.NewDefault(time.Time{}) manager := codec.NewDefaultManager() require.NoError(c.RegisterType(&secp256k1fx.MintOutput{})) diff --git a/vms/components/keystore/codec.go b/vms/components/keystore/codec.go index 6cfa131ed183..15576b73e4ea 100644 --- a/vms/components/keystore/codec.go +++ b/vms/components/keystore/codec.go @@ -5,6 +5,7 @@ package keystore import ( "math" + "time" "github.com/ava-labs/avalanchego/codec" "github.com/ava-labs/avalanchego/codec/linearcodec" @@ -19,9 +20,9 @@ var ( ) func init() { - c := linearcodec.NewDefault() + c := linearcodec.NewDefault(time.Time{}) Codec = codec.NewDefaultManager() - lc := linearcodec.NewCustomMaxLength(math.MaxUint32) + lc := linearcodec.NewDefault(time.Time{}) LegacyCodec = codec.NewManager(math.MaxInt32) err := utils.Err( diff --git a/vms/components/message/codec.go b/vms/components/message/codec.go index bb34ed490c4b..5614125b1cee 100644 --- a/vms/components/message/codec.go +++ b/vms/components/message/codec.go @@ -4,6 +4,8 @@ package message import ( + "time" + "github.com/ava-labs/avalanchego/codec" "github.com/ava-labs/avalanchego/codec/linearcodec" "github.com/ava-labs/avalanchego/utils" @@ -14,14 +16,13 @@ const ( CodecVersion = 0 maxMessageSize = 512 * units.KiB - maxSliceLen = maxMessageSize ) var Codec codec.Manager func init() { Codec = codec.NewManager(maxMessageSize) - lc := linearcodec.NewCustomMaxLength(maxSliceLen) + lc := linearcodec.NewDefault(time.Time{}) err := utils.Err( lc.RegisterType(&Tx{}), diff --git a/vms/example/xsvm/tx/codec.go b/vms/example/xsvm/tx/codec.go index c15150c4b37f..f61c7bf18098 100644 --- a/vms/example/xsvm/tx/codec.go +++ b/vms/example/xsvm/tx/codec.go @@ -5,6 +5,7 @@ package tx import ( "math" + "time" "github.com/ava-labs/avalanchego/codec" "github.com/ava-labs/avalanchego/codec/linearcodec" @@ -16,7 +17,7 @@ const CodecVersion = 0 var Codec codec.Manager func init() { - c := linearcodec.NewCustomMaxLength(math.MaxInt32) + c := linearcodec.NewDefault(time.Time{}) Codec = codec.NewManager(math.MaxInt32) err := utils.Err( diff --git a/vms/nftfx/fx_test.go b/vms/nftfx/fx_test.go index 99a047b11328..1ed3426f5b11 100644 --- a/vms/nftfx/fx_test.go +++ b/vms/nftfx/fx_test.go @@ -39,7 +39,7 @@ var ( func TestFxInitialize(t *testing.T) { vm := secp256k1fx.TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } fx := Fx{} @@ -56,7 +56,7 @@ func TestFxVerifyMintOperation(t *testing.T) { require := require.New(t) vm := secp256k1fx.TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -92,7 +92,7 @@ func TestFxVerifyMintOperationWrongTx(t *testing.T) { require := require.New(t) vm := secp256k1fx.TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -126,7 +126,7 @@ func TestFxVerifyMintOperationWrongNumberUTXOs(t *testing.T) { require := require.New(t) vm := secp256k1fx.TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -157,7 +157,7 @@ func TestFxVerifyMintOperationWrongCredential(t *testing.T) { require := require.New(t) vm := secp256k1fx.TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -189,7 +189,7 @@ func TestFxVerifyMintOperationInvalidUTXO(t *testing.T) { require := require.New(t) vm := secp256k1fx.TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -220,7 +220,7 @@ func TestFxVerifyMintOperationFailingVerification(t *testing.T) { require := require.New(t) vm := secp256k1fx.TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -258,7 +258,7 @@ func TestFxVerifyMintOperationInvalidGroupID(t *testing.T) { require := require.New(t) vm := secp256k1fx.TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -296,7 +296,7 @@ func TestFxVerifyTransferOperation(t *testing.T) { require := require.New(t) vm := secp256k1fx.TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -346,7 +346,7 @@ func TestFxVerifyTransferOperationWrongUTXO(t *testing.T) { require := require.New(t) vm := secp256k1fx.TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -387,7 +387,7 @@ func TestFxVerifyTransferOperationFailedVerify(t *testing.T) { require := require.New(t) vm := secp256k1fx.TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -435,7 +435,7 @@ func TestFxVerifyTransferOperationWrongGroupID(t *testing.T) { require := require.New(t) vm := secp256k1fx.TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -486,7 +486,7 @@ func TestFxVerifyTransferOperationWrongBytes(t *testing.T) { require := require.New(t) vm := secp256k1fx.TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -537,7 +537,7 @@ func TestFxVerifyTransferOperationTooSoon(t *testing.T) { require := require.New(t) vm := secp256k1fx.TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -589,7 +589,7 @@ func TestFxVerifyOperationUnknownOperation(t *testing.T) { require := require.New(t) vm := secp256k1fx.TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -625,7 +625,7 @@ func TestFxVerifyTransfer(t *testing.T) { require := require.New(t) vm := secp256k1fx.TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) diff --git a/vms/platformvm/block/builder/helpers_test.go b/vms/platformvm/block/builder/helpers_test.go index 7918411b3944..fa7339be6fdb 100644 --- a/vms/platformvm/block/builder/helpers_test.go +++ b/vms/platformvm/block/builder/helpers_test.go @@ -330,7 +330,7 @@ func defaultFx(t *testing.T, clk *mockable.Clock, log logging.Logger, isBootstra require := require.New(t) fxVMInt := &fxVMInt{ - registry: linearcodec.NewDefault(), + registry: linearcodec.NewDefault(time.Time{}), clk: clk, log: log, } diff --git a/vms/platformvm/block/codec.go b/vms/platformvm/block/codec.go index b7338ea98a03..33babbaf3a79 100644 --- a/vms/platformvm/block/codec.go +++ b/vms/platformvm/block/codec.go @@ -5,6 +5,7 @@ package block import ( "math" + "time" "github.com/ava-labs/avalanchego/codec" "github.com/ava-labs/avalanchego/codec/linearcodec" @@ -15,20 +16,23 @@ import ( const CodecVersion = txs.CodecVersion -// GenesisCode allows blocks of larger than usual size to be parsed. -// While this gives flexibility in accommodating large genesis blocks -// it must not be used to parse new, unverified blocks which instead -// must be processed by Codec var ( - Codec codec.Manager + // GenesisCodec allows blocks of larger than usual size to be parsed. + // While this gives flexibility in accommodating large genesis blocks + // it must not be used to parse new, unverified blocks which instead + // must be processed by Codec GenesisCodec codec.Manager + + Codec codec.Manager ) -func init() { - c := linearcodec.NewDefault() - Codec = codec.NewDefaultManager() - gc := linearcodec.NewCustomMaxLength(math.MaxInt32) - GenesisCodec = codec.NewManager(math.MaxInt32) +// TODO: Remove after v1.11.x has activated +// +// Invariant: InitCodec, Codec, and GenesisCodec must not be accessed +// concurrently +func InitCodec(durangoTime time.Time) error { + c := linearcodec.NewDefault(durangoTime) + gc := linearcodec.NewDefault(time.Time{}) errs := wrappers.Errs{} for _, c := range []linearcodec.Codec{c, gc} { @@ -39,12 +43,25 @@ func init() { txs.RegisterDUnsignedTxsTypes(c), ) } + + newCodec := codec.NewDefaultManager() + newGenesisCodec := codec.NewManager(math.MaxInt32) errs.Add( - Codec.RegisterCodec(CodecVersion, c), - GenesisCodec.RegisterCodec(CodecVersion, gc), + newCodec.RegisterCodec(CodecVersion, c), + newGenesisCodec.RegisterCodec(CodecVersion, gc), ) if errs.Errored() { - panic(errs.Err) + return errs.Err + } + + Codec = newCodec + GenesisCodec = newGenesisCodec + return nil +} + +func init() { + if err := InitCodec(time.Time{}); err != nil { + panic(err) } } diff --git a/vms/platformvm/block/executor/helpers_test.go b/vms/platformvm/block/executor/helpers_test.go index 67ace707bd5a..5e7b5a3fce1e 100644 --- a/vms/platformvm/block/executor/helpers_test.go +++ b/vms/platformvm/block/executor/helpers_test.go @@ -345,7 +345,7 @@ func (fvi *fxVMInt) Logger() logging.Logger { func defaultFx(clk *mockable.Clock, log logging.Logger, isBootstrapped bool) fx.Fx { fxVMInt := &fxVMInt{ - registry: linearcodec.NewDefault(), + registry: linearcodec.NewDefault(time.Time{}), clk: clk, log: log, } diff --git a/vms/platformvm/state/metadata_codec.go b/vms/platformvm/state/metadata_codec.go index 400d23e29af2..65832ed77460 100644 --- a/vms/platformvm/state/metadata_codec.go +++ b/vms/platformvm/state/metadata_codec.go @@ -5,6 +5,7 @@ package state import ( "math" + "time" "github.com/ava-labs/avalanchego/codec" "github.com/ava-labs/avalanchego/codec/linearcodec" @@ -22,8 +23,8 @@ const ( var MetadataCodec codec.Manager func init() { - c0 := linearcodec.New([]string{CodecVersion0Tag}, math.MaxInt32) - c1 := linearcodec.New([]string{CodecVersion0Tag, CodecVersion1Tag}, math.MaxInt32) + c0 := linearcodec.New(time.Time{}, []string{CodecVersion0Tag}, math.MaxInt32) + c1 := linearcodec.New(time.Time{}, []string{CodecVersion0Tag, CodecVersion1Tag}, math.MaxInt32) MetadataCodec = codec.NewManager(math.MaxInt32) err := utils.Err( diff --git a/vms/platformvm/txs/codec.go b/vms/platformvm/txs/codec.go index c0c300c4d79b..36fe2e5a8eb0 100644 --- a/vms/platformvm/txs/codec.go +++ b/vms/platformvm/txs/codec.go @@ -5,6 +5,7 @@ package txs import ( "math" + "time" "github.com/ava-labs/avalanchego/codec" "github.com/ava-labs/avalanchego/codec/linearcodec" @@ -27,11 +28,13 @@ var ( GenesisCodec codec.Manager ) -func init() { - c := linearcodec.NewDefault() - Codec = codec.NewDefaultManager() - gc := linearcodec.NewCustomMaxLength(math.MaxInt32) - GenesisCodec = codec.NewManager(math.MaxInt32) +// TODO: Remove after v1.11.x has activated +// +// Invariant: InitCodec, Codec, and GenesisCodec must not be accessed +// concurrently +func InitCodec(durangoTime time.Time) error { + c := linearcodec.NewDefault(durangoTime) + gc := linearcodec.NewDefault(time.Time{}) errs := wrappers.Errs{} for _, c := range []linearcodec.Codec{c, gc} { @@ -46,12 +49,25 @@ func init() { errs.Add(RegisterDUnsignedTxsTypes(c)) } + + newCodec := codec.NewDefaultManager() + newGenesisCodec := codec.NewManager(math.MaxInt32) errs.Add( - Codec.RegisterCodec(CodecVersion, c), - GenesisCodec.RegisterCodec(CodecVersion, gc), + newCodec.RegisterCodec(CodecVersion, c), + newGenesisCodec.RegisterCodec(CodecVersion, gc), ) if errs.Errored() { - panic(errs.Err) + return errs.Err + } + + Codec = newCodec + GenesisCodec = newGenesisCodec + return nil +} + +func init() { + if err := InitCodec(time.Time{}); err != nil { + panic(err) } } diff --git a/vms/platformvm/txs/executor/helpers_test.go b/vms/platformvm/txs/executor/helpers_test.go index b18498fac1e1..1ea645efcfb8 100644 --- a/vms/platformvm/txs/executor/helpers_test.go +++ b/vms/platformvm/txs/executor/helpers_test.go @@ -318,7 +318,7 @@ func (fvi *fxVMInt) Logger() logging.Logger { func defaultFx(clk *mockable.Clock, log logging.Logger, isBootstrapped bool) fx.Fx { fxVMInt := &fxVMInt{ - registry: linearcodec.NewDefault(), + registry: linearcodec.NewDefault(time.Time{}), clk: clk, log: log, } diff --git a/vms/platformvm/vm.go b/vms/platformvm/vm.go index 341e5329666c..33053aef97f7 100644 --- a/vms/platformvm/vm.go +++ b/vms/platformvm/vm.go @@ -137,7 +137,8 @@ func (vm *VM) Initialize( vm.ctx = chainCtx vm.db = db - vm.codecRegistry = linearcodec.NewDefault() + // Note: this codec is never used to serialize anything + vm.codecRegistry = linearcodec.NewDefault(time.Time{}) vm.fx = &secp256k1fx.Fx{} if err := vm.fx.Initialize(vm); err != nil { return err diff --git a/vms/platformvm/warp/codec.go b/vms/platformvm/warp/codec.go index 78b194eb6291..6ef6e526bdc1 100644 --- a/vms/platformvm/warp/codec.go +++ b/vms/platformvm/warp/codec.go @@ -5,6 +5,7 @@ package warp import ( "math" + "time" "github.com/ava-labs/avalanchego/codec" "github.com/ava-labs/avalanchego/codec/linearcodec" @@ -17,7 +18,7 @@ var Codec codec.Manager func init() { Codec = codec.NewManager(math.MaxInt) - lc := linearcodec.NewCustomMaxLength(math.MaxInt32) + lc := linearcodec.NewDefault(time.Time{}) err := utils.Err( lc.RegisterType(&BitSetSignature{}), diff --git a/vms/platformvm/warp/payload/codec.go b/vms/platformvm/warp/payload/codec.go index 906b86bc09ed..d188029abfed 100644 --- a/vms/platformvm/warp/payload/codec.go +++ b/vms/platformvm/warp/payload/codec.go @@ -4,6 +4,8 @@ package payload import ( + "time" + "github.com/ava-labs/avalanchego/codec" "github.com/ava-labs/avalanchego/codec/linearcodec" "github.com/ava-labs/avalanchego/utils" @@ -14,17 +16,13 @@ const ( CodecVersion = 0 MaxMessageSize = 24 * units.KiB - - // Note: Modifying this variable can have subtle implications on memory - // usage when parsing malformed payloads. - MaxSliceLen = 24 * 1024 ) var Codec codec.Manager func init() { Codec = codec.NewManager(MaxMessageSize) - lc := linearcodec.NewCustomMaxLength(MaxSliceLen) + lc := linearcodec.NewDefault(time.Time{}) err := utils.Err( lc.RegisterType(&Hash{}), diff --git a/vms/propertyfx/fx_test.go b/vms/propertyfx/fx_test.go index 10a96e6e5b0b..0cd995ba5282 100644 --- a/vms/propertyfx/fx_test.go +++ b/vms/propertyfx/fx_test.go @@ -39,7 +39,7 @@ var ( func TestFxInitialize(t *testing.T) { vm := secp256k1fx.TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } fx := Fx{} @@ -56,7 +56,7 @@ func TestFxVerifyMintOperation(t *testing.T) { require := require.New(t) vm := secp256k1fx.TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -98,7 +98,7 @@ func TestFxVerifyMintOperationWrongTx(t *testing.T) { require := require.New(t) vm := secp256k1fx.TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -132,7 +132,7 @@ func TestFxVerifyMintOperationWrongNumberUTXOs(t *testing.T) { require := require.New(t) vm := secp256k1fx.TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -163,7 +163,7 @@ func TestFxVerifyMintOperationWrongCredential(t *testing.T) { require := require.New(t) vm := secp256k1fx.TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -195,7 +195,7 @@ func TestFxVerifyMintOperationInvalidUTXO(t *testing.T) { require := require.New(t) vm := secp256k1fx.TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -226,7 +226,7 @@ func TestFxVerifyMintOperationFailingVerification(t *testing.T) { require := require.New(t) vm := secp256k1fx.TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -264,7 +264,7 @@ func TestFxVerifyMintOperationInvalidGroupID(t *testing.T) { require := require.New(t) vm := secp256k1fx.TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -301,7 +301,7 @@ func TestFxVerifyTransferOperation(t *testing.T) { require := require.New(t) vm := secp256k1fx.TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -335,7 +335,7 @@ func TestFxVerifyTransferOperationWrongUTXO(t *testing.T) { require := require.New(t) vm := secp256k1fx.TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -364,7 +364,7 @@ func TestFxVerifyTransferOperationFailedVerify(t *testing.T) { require := require.New(t) vm := secp256k1fx.TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -399,7 +399,7 @@ func TestFxVerifyOperationUnknownOperation(t *testing.T) { require := require.New(t) vm := secp256k1fx.TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -431,7 +431,7 @@ func TestFxVerifyTransfer(t *testing.T) { require := require.New(t) vm := secp256k1fx.TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) diff --git a/vms/proposervm/block/codec.go b/vms/proposervm/block/codec.go index d3ccce4f1d43..ca2318002093 100644 --- a/vms/proposervm/block/codec.go +++ b/vms/proposervm/block/codec.go @@ -5,6 +5,7 @@ package block import ( "math" + "time" "github.com/ava-labs/avalanchego/codec" "github.com/ava-labs/avalanchego/codec/linearcodec" @@ -16,7 +17,7 @@ const CodecVersion = 0 var Codec codec.Manager func init() { - lc := linearcodec.NewCustomMaxLength(math.MaxUint32) + lc := linearcodec.NewDefault(time.Time{}) // The maximum block size is enforced by the p2p message size limit. // See: [constants.DefaultMaxMessageSize] Codec = codec.NewManager(math.MaxInt) diff --git a/vms/proposervm/state/codec.go b/vms/proposervm/state/codec.go index 21d30d24da86..63727894e356 100644 --- a/vms/proposervm/state/codec.go +++ b/vms/proposervm/state/codec.go @@ -5,6 +5,7 @@ package state import ( "math" + "time" "github.com/ava-labs/avalanchego/codec" "github.com/ava-labs/avalanchego/codec/linearcodec" @@ -15,7 +16,7 @@ const CodecVersion = 0 var Codec codec.Manager func init() { - lc := linearcodec.NewCustomMaxLength(math.MaxUint32) + lc := linearcodec.NewDefault(time.Time{}) Codec = codec.NewManager(math.MaxInt32) err := Codec.RegisterCodec(CodecVersion, lc) diff --git a/vms/proposervm/summary/codec.go b/vms/proposervm/summary/codec.go index 3eaa15e88683..41a9eb9a37d0 100644 --- a/vms/proposervm/summary/codec.go +++ b/vms/proposervm/summary/codec.go @@ -6,6 +6,7 @@ package summary import ( "errors" "math" + "time" "github.com/ava-labs/avalanchego/codec" "github.com/ava-labs/avalanchego/codec/linearcodec" @@ -20,7 +21,7 @@ var ( ) func init() { - lc := linearcodec.NewCustomMaxLength(math.MaxUint32) + lc := linearcodec.NewDefault(time.Time{}) Codec = codec.NewManager(math.MaxInt32) if err := Codec.RegisterCodec(CodecVersion, lc); err != nil { panic(err) diff --git a/vms/secp256k1fx/credential_test.go b/vms/secp256k1fx/credential_test.go index c08548e0bcc7..e69b98b286e7 100644 --- a/vms/secp256k1fx/credential_test.go +++ b/vms/secp256k1fx/credential_test.go @@ -5,6 +5,7 @@ package secp256k1fx import ( "testing" + "time" "github.com/stretchr/testify/require" @@ -27,7 +28,7 @@ func TestCredentialVerifyNil(t *testing.T) { func TestCredentialSerialize(t *testing.T) { require := require.New(t) - c := linearcodec.NewDefault() + c := linearcodec.NewDefault(time.Time{}) m := codec.NewDefaultManager() require.NoError(m.RegisterCodec(0, c)) diff --git a/vms/secp256k1fx/fx_test.go b/vms/secp256k1fx/fx_test.go index 388d7bc14d84..dcdf78385404 100644 --- a/vms/secp256k1fx/fx_test.go +++ b/vms/secp256k1fx/fx_test.go @@ -53,7 +53,7 @@ func init() { func TestFxInitialize(t *testing.T) { vm := TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } fx := Fx{} @@ -69,7 +69,7 @@ func TestFxInitializeInvalid(t *testing.T) { func TestFxVerifyTransfer(t *testing.T) { require := require.New(t) vm := TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -107,7 +107,7 @@ func TestFxVerifyTransfer(t *testing.T) { func TestFxVerifyTransferNilTx(t *testing.T) { require := require.New(t) vm := TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -143,7 +143,7 @@ func TestFxVerifyTransferNilTx(t *testing.T) { func TestFxVerifyTransferNilOutput(t *testing.T) { require := require.New(t) vm := TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -170,7 +170,7 @@ func TestFxVerifyTransferNilOutput(t *testing.T) { func TestFxVerifyTransferNilInput(t *testing.T) { require := require.New(t) vm := TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -201,7 +201,7 @@ func TestFxVerifyTransferNilInput(t *testing.T) { func TestFxVerifyTransferNilCredential(t *testing.T) { require := require.New(t) vm := TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -233,7 +233,7 @@ func TestFxVerifyTransferNilCredential(t *testing.T) { func TestFxVerifyTransferInvalidOutput(t *testing.T) { require := require.New(t) vm := TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -270,7 +270,7 @@ func TestFxVerifyTransferInvalidOutput(t *testing.T) { func TestFxVerifyTransferWrongAmounts(t *testing.T) { require := require.New(t) vm := TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -307,7 +307,7 @@ func TestFxVerifyTransferWrongAmounts(t *testing.T) { func TestFxVerifyTransferTimelocked(t *testing.T) { require := require.New(t) vm := TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -344,7 +344,7 @@ func TestFxVerifyTransferTimelocked(t *testing.T) { func TestFxVerifyTransferTooManySigners(t *testing.T) { require := require.New(t) vm := TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -382,7 +382,7 @@ func TestFxVerifyTransferTooManySigners(t *testing.T) { func TestFxVerifyTransferTooFewSigners(t *testing.T) { require := require.New(t) vm := TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -417,7 +417,7 @@ func TestFxVerifyTransferTooFewSigners(t *testing.T) { func TestFxVerifyTransferMismatchedSigners(t *testing.T) { require := require.New(t) vm := TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -455,7 +455,7 @@ func TestFxVerifyTransferMismatchedSigners(t *testing.T) { func TestFxVerifyTransferInvalidSignature(t *testing.T) { require := require.New(t) vm := TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -495,7 +495,7 @@ func TestFxVerifyTransferInvalidSignature(t *testing.T) { func TestFxVerifyTransferWrongSigner(t *testing.T) { require := require.New(t) vm := TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -535,7 +535,7 @@ func TestFxVerifyTransferWrongSigner(t *testing.T) { func TestFxVerifyTransferSigIndexOOB(t *testing.T) { require := require.New(t) vm := TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -575,7 +575,7 @@ func TestFxVerifyTransferSigIndexOOB(t *testing.T) { func TestFxVerifyOperation(t *testing.T) { require := require.New(t) vm := TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -627,7 +627,7 @@ func TestFxVerifyOperation(t *testing.T) { func TestFxVerifyOperationUnknownTx(t *testing.T) { require := require.New(t) vm := TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -679,7 +679,7 @@ func TestFxVerifyOperationUnknownTx(t *testing.T) { func TestFxVerifyOperationUnknownOperation(t *testing.T) { require := require.New(t) vm := TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -709,7 +709,7 @@ func TestFxVerifyOperationUnknownOperation(t *testing.T) { func TestFxVerifyOperationUnknownCredential(t *testing.T) { require := require.New(t) vm := TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -757,7 +757,7 @@ func TestFxVerifyOperationUnknownCredential(t *testing.T) { func TestFxVerifyOperationWrongNumberOfUTXOs(t *testing.T) { require := require.New(t) vm := TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -810,7 +810,7 @@ func TestFxVerifyOperationWrongNumberOfUTXOs(t *testing.T) { func TestFxVerifyOperationUnknownUTXOType(t *testing.T) { require := require.New(t) vm := TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -855,7 +855,7 @@ func TestFxVerifyOperationUnknownUTXOType(t *testing.T) { func TestFxVerifyOperationInvalidOperationVerify(t *testing.T) { require := require.New(t) vm := TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -905,7 +905,7 @@ func TestFxVerifyOperationInvalidOperationVerify(t *testing.T) { func TestFxVerifyOperationMismatchedMintOutputs(t *testing.T) { require := require.New(t) vm := TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } date := time.Date(2019, time.January, 19, 16, 25, 17, 3, time.UTC) @@ -952,7 +952,7 @@ func TestFxVerifyOperationMismatchedMintOutputs(t *testing.T) { func TestVerifyPermission(t *testing.T) { vm := TestVM{ - Codec: linearcodec.NewDefault(), + Codec: linearcodec.NewDefault(time.Time{}), Log: logging.NoLog{}, } fx := Fx{} diff --git a/vms/secp256k1fx/transfer_input_test.go b/vms/secp256k1fx/transfer_input_test.go index 4434584e1a9d..c155d848e559 100644 --- a/vms/secp256k1fx/transfer_input_test.go +++ b/vms/secp256k1fx/transfer_input_test.go @@ -5,6 +5,7 @@ package secp256k1fx import ( "testing" + "time" "github.com/stretchr/testify/require" @@ -80,7 +81,7 @@ func TestTransferInputVerifyUnsorted(t *testing.T) { func TestTransferInputSerialize(t *testing.T) { require := require.New(t) - c := linearcodec.NewDefault() + c := linearcodec.NewDefault(time.Time{}) m := codec.NewDefaultManager() require.NoError(m.RegisterCodec(0, c)) diff --git a/vms/secp256k1fx/transfer_output_test.go b/vms/secp256k1fx/transfer_output_test.go index b1d8a2170b5a..864fb85b9ff0 100644 --- a/vms/secp256k1fx/transfer_output_test.go +++ b/vms/secp256k1fx/transfer_output_test.go @@ -5,6 +5,7 @@ package secp256k1fx import ( "testing" + "time" "github.com/stretchr/testify/require" @@ -135,7 +136,7 @@ func TestOutputVerifyDuplicated(t *testing.T) { func TestOutputSerialize(t *testing.T) { require := require.New(t) - c := linearcodec.NewDefault() + c := linearcodec.NewDefault(time.Time{}) m := codec.NewDefaultManager() require.NoError(m.RegisterCodec(0, c)) diff --git a/wallet/chain/x/constants.go b/wallet/chain/x/constants.go index 44ff38393acc..47efbfc2ff6d 100644 --- a/wallet/chain/x/constants.go +++ b/wallet/chain/x/constants.go @@ -4,6 +4,8 @@ package x import ( + "time" + "github.com/ava-labs/avalanchego/vms/avm/block" "github.com/ava-labs/avalanchego/vms/avm/fxs" "github.com/ava-labs/avalanchego/vms/nftfx" @@ -22,11 +24,14 @@ var Parser block.Parser func init() { var err error - Parser, err = block.NewParser([]fxs.Fx{ - &secp256k1fx.Fx{}, - &nftfx.Fx{}, - &propertyfx.Fx{}, - }) + Parser, err = block.NewParser( + time.Time{}, + []fxs.Fx{ + &secp256k1fx.Fx{}, + &nftfx.Fx{}, + &propertyfx.Fx{}, + }, + ) if err != nil { panic(err) } From c74a08f3fefe1f02452924acd03acc18933e246a Mon Sep 17 00:00:00 2001 From: marun Date: Fri, 5 Jan 2024 13:37:03 -0500 Subject: [PATCH 23/57] `tmpnet`: Use AvalancheLocalChainConfig for cchain genesis (#2583) --- tests/fixture/tmpnet/genesis.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/fixture/tmpnet/genesis.go b/tests/fixture/tmpnet/genesis.go index a200efb3b065..a9c85fe8b441 100644 --- a/tests/fixture/tmpnet/genesis.go +++ b/tests/fixture/tmpnet/genesis.go @@ -148,9 +148,7 @@ func NewTestGenesis( // Define C-Chain genesis cChainGenesis := &core.Genesis{ - Config: ¶ms.ChainConfig{ - ChainID: big.NewInt(43112), // Arbitrary chain ID is arbitrary - }, + Config: params.AvalancheLocalChainConfig, Difficulty: big.NewInt(0), // Difficulty is a mandatory field GasLimit: defaultGasLimit, Alloc: cChainBalances, From 3096b61a6708da8bb7f13133e6713c1f14c7223d Mon Sep 17 00:00:00 2001 From: marun Date: Fri, 5 Jan 2024 14:48:05 -0500 Subject: [PATCH 24/57] `testing`: Ensure CheckBootstrapIsPossible is safe for teardown (#2582) --- tests/fixture/e2e/helpers.go | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/tests/fixture/e2e/helpers.go b/tests/fixture/e2e/helpers.go index e57949106805..d4a8e3ade568 100644 --- a/tests/fixture/e2e/helpers.go +++ b/tests/fixture/e2e/helpers.go @@ -122,9 +122,7 @@ func Eventually(condition func() bool, waitFor time.Duration, tick time.Duration func AddEphemeralNode(network *tmpnet.Network, flags tmpnet.FlagsMap) *tmpnet.Node { require := require.New(ginkgo.GinkgoT()) - ctx, cancel := context.WithTimeout(context.Background(), DefaultTimeout) - defer cancel() - node, err := network.AddEphemeralNode(ctx, ginkgo.GinkgoWriter, flags) + node, err := network.AddEphemeralNode(DefaultContext(), ginkgo.GinkgoWriter, flags) require.NoError(err) ginkgo.DeferCleanup(func() { @@ -188,16 +186,34 @@ func WithSuggestedGasPrice(ethClient ethclient.Client) common.Option { return common.WithBaseFee(baseFee) } -// Verify that a new node can bootstrap into the network. +// Verify that a new node can bootstrap into the network. This function is safe to call +// from `Teardown` by virtue of not depending on ginkgo.DeferCleanup. func CheckBootstrapIsPossible(network *tmpnet.Network) { + require := require.New(ginkgo.GinkgoT()) + if len(os.Getenv(SkipBootstrapChecksEnvName)) > 0 { tests.Outf("{{yellow}}Skipping bootstrap check due to the %s env var being set", SkipBootstrapChecksEnvName) return } ginkgo.By("checking if bootstrap is possible with the current network state") - node := AddEphemeralNode(network, tmpnet.FlagsMap{}) - WaitForHealthy(node) + ctx, cancel := context.WithTimeout(context.Background(), DefaultTimeout) + defer cancel() + + node, err := network.AddEphemeralNode(ctx, ginkgo.GinkgoWriter, tmpnet.FlagsMap{}) + // AddEphemeralNode will initiate node stop if an error is encountered during start, + // so no further cleanup effort is required if an error is seen here. + require.NoError(err) + + // Ensure the node is always stopped at the end of the check + defer func() { + ctx, cancel = context.WithTimeout(context.Background(), DefaultTimeout) + defer cancel() + require.NoError(node.Stop(ctx)) + }() + + // Check that the node becomes healthy within timeout + require.NoError(tmpnet.WaitForHealthy(ctx, node)) } // Start a temporary network with the provided avalanchego binary. From 4d6d25513e9f40f9f924c9fe402a4361671c22c8 Mon Sep 17 00:00:00 2001 From: marun Date: Fri, 5 Jan 2024 15:52:34 -0500 Subject: [PATCH 25/57] `tmpnet`: Separate network into orchestration and configuration (#2464) --- tests/e2e/README.md | 2 +- tests/fixture/e2e/env.go | 4 +- tests/fixture/e2e/helpers.go | 18 +- tests/fixture/tmpnet/README.md | 72 +-- tests/fixture/tmpnet/cmd/main.go | 29 +- tests/fixture/tmpnet/defaults.go | 21 +- tests/fixture/tmpnet/network.go | 714 ++++++++----------------- tests/fixture/tmpnet/network_config.go | 220 ++++++++ tests/fixture/tmpnet/network_test.go | 11 +- tests/fixture/tmpnet/node.go | 6 +- tests/upgrade/upgrade_test.go | 20 +- 11 files changed, 514 insertions(+), 603 deletions(-) create mode 100644 tests/fixture/tmpnet/network_config.go diff --git a/tests/e2e/README.md b/tests/e2e/README.md index 41c724a15051..50ab608a3c4f 100644 --- a/tests/e2e/README.md +++ b/tests/e2e/README.md @@ -42,7 +42,7 @@ Define any flags/configurations in [`e2e.go`](./e2e.go). Create a new package to implement feature-specific tests, or add tests to an existing package. For example: ``` -. +tests └── e2e ├── README.md ├── e2e.go diff --git a/tests/fixture/e2e/env.go b/tests/fixture/e2e/env.go index ddd50580ade5..d87c0985edd6 100644 --- a/tests/fixture/e2e/env.go +++ b/tests/fixture/e2e/env.go @@ -69,7 +69,7 @@ func NewTestEnvironment(flagVars *FlagVars) *TestEnvironment { network = StartNetwork(flagVars.AvalancheGoExecPath(), DefaultNetworkDir) } - uris := tmpnet.GetNodeURIs(network.Nodes) + uris := network.GetNodeURIs() require.NotEmpty(uris, "network contains no nodes") tests.Outf("{{green}}network URIs: {{/}} %+v\n", uris) @@ -132,5 +132,5 @@ func (te *TestEnvironment) NewPrivateNetwork() *tmpnet.Network { privateNetworksDir := filepath.Join(sharedNetwork.Dir, PrivateNetworksDirName) te.require.NoError(os.MkdirAll(privateNetworksDir, perms.ReadWriteExecute)) - return StartNetwork(sharedNetwork.AvalancheGoPath, privateNetworksDir) + return StartNetwork(sharedNetwork.DefaultRuntimeConfig.AvalancheGoPath, privateNetworksDir) } diff --git a/tests/fixture/e2e/helpers.go b/tests/fixture/e2e/helpers.go index d4a8e3ade568..706af72dde05 100644 --- a/tests/fixture/e2e/helpers.go +++ b/tests/fixture/e2e/helpers.go @@ -217,22 +217,14 @@ func CheckBootstrapIsPossible(network *tmpnet.Network) { } // Start a temporary network with the provided avalanchego binary. -func StartNetwork(avalancheGoExecPath string, networkDir string) *tmpnet.Network { +func StartNetwork(avalancheGoExecPath string, rootNetworkDir string) *tmpnet.Network { require := require.New(ginkgo.GinkgoT()) - network, err := tmpnet.StartNetwork( - DefaultContext(), - ginkgo.GinkgoWriter, - networkDir, - &tmpnet.Network{ - NodeRuntimeConfig: tmpnet.NodeRuntimeConfig{ - AvalancheGoPath: avalancheGoExecPath, - }, - }, - tmpnet.DefaultNodeCount, - tmpnet.DefaultPreFundedKeyCount, - ) + network, err := tmpnet.NewDefaultNetwork(ginkgo.GinkgoWriter, avalancheGoExecPath, tmpnet.DefaultNodeCount) require.NoError(err) + require.NoError(network.Create(rootNetworkDir)) + require.NoError(network.Start(DefaultContext(), ginkgo.GinkgoWriter)) + ginkgo.DeferCleanup(func() { tests.Outf("Shutting down network\n") ctx, cancel := context.WithTimeout(context.Background(), DefaultTimeout) diff --git a/tests/fixture/tmpnet/README.md b/tests/fixture/tmpnet/README.md index 90ec7f678b2f..abccbf52cf79 100644 --- a/tests/fixture/tmpnet/README.md +++ b/tests/fixture/tmpnet/README.md @@ -30,6 +30,7 @@ the following non-test files: | flags.go | FlagsMap | Simplifies configuration of avalanchego flags | | genesis.go | | Creates test genesis | | network.go | Network | Orchestrates and configures temporary networks | +| network_config.go | Network | Reads and writes network configuration | | node.go | Node | Orchestrates and configures nodes | | node_config.go | Node | Reads and writes node configuration | | node_process.go | NodeProcess | Orchestrates node processes | @@ -73,60 +74,25 @@ network. A temporary network can be managed in code: ```golang -network, _ := tmpnet.StartNetwork( - ctx, // Context used to limit duration of waiting for network health - ginkgo.GinkgoWriter, // Writer to report progress of network start - "", // Use default root dir (~/.tmpnet) - &tmpnet.Network{ - NodeRuntimeConfig: tmpnet.NodeRuntimeConfig{ - ExecPath: "/path/to/avalanchego", // Defining the avalanchego exec path is required - }, - }, - 5, // Number of initial validating nodes - 50, // Number of pre-funded keys to create +network, _ := tmpnet.NewDefaultNetwork( + ginkgo.GinkgoWriter, // Writer to report progress of initialization + "/path/to/avalanchego", // The path to the binary that nodes will execute + 5, // Number of initial validating nodes +) +_ = network.Create("") // Finalize network configuration and write to disk +_ = network.Start( // Start the nodes of the network and wait until they report healthy + ctx, // Context used to limit duration of waiting for network health + ginkgo.GinkgoWriter, // Writer to report progress of network start ) -uris := network.GetURIs() +uris := network.GetNodeURIs() // Use URIs to interact with the network // Stop all nodes in the network -network.Stop() +network.Stop(context.Background()) ``` -If non-default node behavior is required, the `Network` instance -supplied to `StartNetwork()` can be initialized with explicit node -configuration and by supplying a nodeCount argument of `0`: - -```golang -network, _ := tmpnet.StartNetwork( - ctx, - ginkgo.GinkgoWriter, - "", - &tmpnet.Network{ - NodeRuntimeConfig: tmpnet.NodeRuntimeConfig{ - ExecPath: "/path/to/avalanchego", - }, - Nodes: []*Node{ - { // node1 configuration is customized - Flags: FlagsMap{ // Any and all node flags can be configured here - config.DataDirKey: "/custom/path/to/node/data", - } - }, - }, - {}, // node2 uses default configuration - {}, // node3 uses default configuration - {}, // node4 uses default configuration - {}, // node5 uses default configuration - }, - 0, // Node count must be zero when setting node config - 50, -) -``` - -Further examples of code-based usage are located in the [e2e -tests](../../e2e/e2e_test.go). - ## Networking configuration By default, nodes in a temporary network will be started with staking and @@ -161,18 +127,18 @@ HOME ├── chains │ └── C │ └── config.json // C-Chain config for all nodes - ├── defaults.json // Default flags and configuration for network + ├── config.json // Common configuration (including defaults and pre-funded keys) ├── genesis.json // Genesis for all nodes └── network.env // Sets network dir env var to simplify network usage ``` -### Default flags and configuration +### Common networking configuration -The default avalanchego node flags (e.g. `--staking-port=`) and -default configuration like the avalanchego path are stored at -`[network-dir]/defaults.json`. The value for a given defaulted flag -will be set on initial and subsequently added nodes that do not supply -values for a given defaulted flag. +Network configuration such as default flags (e.g. `--log-level=`), +runtime defaults (e.g. avalanchego path) and pre-funded private keys +are stored at `[network-dir]/config.json`. A given default will only +be applied to a new node on its addition to the network if the node +does not explicitly set a given value. ### Genesis diff --git a/tests/fixture/tmpnet/cmd/main.go b/tests/fixture/tmpnet/cmd/main.go index 45ed58cef7a5..1ab3f2648325 100644 --- a/tests/fixture/tmpnet/cmd/main.go +++ b/tests/fixture/tmpnet/cmd/main.go @@ -10,6 +10,7 @@ import ( "io/fs" "os" "path/filepath" + "time" "github.com/spf13/cobra" @@ -45,10 +46,9 @@ func main() { rootCmd.AddCommand(versionCmd) var ( - rootDir string - execPath string - nodeCount uint8 - preFundedKeyCount uint8 + rootDir string + execPath string + nodeCount uint8 ) startNetworkCmd := &cobra.Command{ Use: "start-network", @@ -60,15 +60,21 @@ func main() { // Root dir will be defaulted on start if not provided - network := &tmpnet.Network{ - NodeRuntimeConfig: tmpnet.NodeRuntimeConfig{ - AvalancheGoPath: execPath, - }, + network, err := tmpnet.NewDefaultNetwork(os.Stdout, execPath, int(nodeCount)) + if err != nil { + return err } - ctx, cancel := context.WithTimeout(context.Background(), tmpnet.DefaultNetworkTimeout) + + if err := network.Create(rootDir); err != nil { + return err + } + + // Extreme upper bound, should never take this long + networkStartTimeout := 2 * time.Minute + + ctx, cancel := context.WithTimeout(context.Background(), networkStartTimeout) defer cancel() - network, err := tmpnet.StartNetwork(ctx, os.Stdout, rootDir, network, int(nodeCount), int(preFundedKeyCount)) - if err != nil { + if err := network.Start(ctx, os.Stdout); err != nil { return err } @@ -94,7 +100,6 @@ func main() { startNetworkCmd.PersistentFlags().StringVar(&rootDir, "root-dir", os.Getenv(tmpnet.RootDirEnvName), "The path to the root directory for temporary networks") startNetworkCmd.PersistentFlags().StringVar(&execPath, "avalanchego-path", os.Getenv(tmpnet.AvalancheGoPathEnvName), "The path to an avalanchego binary") startNetworkCmd.PersistentFlags().Uint8Var(&nodeCount, "node-count", tmpnet.DefaultNodeCount, "Number of nodes the network should initially consist of") - startNetworkCmd.PersistentFlags().Uint8Var(&preFundedKeyCount, "pre-funded-key-count", tmpnet.DefaultPreFundedKeyCount, "Number of pre-funded keys the network should start with") rootCmd.AddCommand(startNetworkCmd) var networkDir string diff --git a/tests/fixture/tmpnet/defaults.go b/tests/fixture/tmpnet/defaults.go index 8ae303cf9af4..ce09def2582a 100644 --- a/tests/fixture/tmpnet/defaults.go +++ b/tests/fixture/tmpnet/defaults.go @@ -10,11 +10,6 @@ import ( ) const ( - // Constants defining the names of shell variables whose value can - // configure temporary network orchestration. - NetworkDirEnvName = "TMPNET_NETWORK_DIR" - RootDirEnvName = "TMPNET_ROOT_DIR" - DefaultNetworkTimeout = 2 * time.Minute // Minimum required to ensure connectivity-based health checks will pass @@ -48,12 +43,14 @@ func DefaultFlags() FlagsMap { } } -// C-Chain config for testing. -func DefaultCChainConfig() FlagsMap { - // Supply only non-default configuration to ensure that default - // values will be used. Available C-Chain configuration options are - // defined in the `github.com/ava-labs/coreth/evm` package. - return FlagsMap{ - "log-level": "trace", +// A set of chain configurations appropriate for testing. +func DefaultChainConfigs() map[string]FlagsMap { + return map[string]FlagsMap{ + // Supply only non-default configuration to ensure that default + // values will be used. Available C-Chain configuration options are + // defined in the `github.com/ava-labs/coreth/evm` package. + "C": { + "log-level": "trace", + }, } } diff --git a/tests/fixture/tmpnet/network.go b/tests/fixture/tmpnet/network.go index 0c5818efa0ee..da18b59c0c58 100644 --- a/tests/fixture/tmpnet/network.go +++ b/tests/fixture/tmpnet/network.go @@ -5,7 +5,6 @@ package tmpnet import ( "context" - "encoding/json" "errors" "fmt" "io" @@ -24,114 +23,121 @@ import ( "github.com/ava-labs/avalanchego/utils/set" ) +// The Network type is defined in this file (orchestration) and +// network_config.go (reading/writing configuration). + const ( + // Constants defining the names of shell variables whose value can + // configure network orchestration. + NetworkDirEnvName = "TMPNET_NETWORK_DIR" + RootDirEnvName = "TMPNET_ROOT_DIR" + // This interval was chosen to avoid spamming node APIs during // startup, as smaller intervals (e.g. 50ms) seemed to noticeably // increase the time for a network's nodes to be seen as healthy. networkHealthCheckInterval = 200 * time.Millisecond - - defaultEphemeralDirName = "ephemeral" ) -var ( - errInvalidNodeCount = errors.New("failed to populate network config: non-zero node count is only valid for a network without nodes") - errInvalidKeyCount = errors.New("failed to populate network config: non-zero key count is only valid for a network without keys") - errNetworkDirNotSet = errors.New("network directory not set - has Create() been called?") - errInvalidNetworkDir = errors.New("failed to write network: invalid network directory") - errMissingBootstrapNodes = errors.New("failed to add node due to missing bootstrap nodes") -) +// Collects the configuration for running a temporary avalanchego network +type Network struct { + // Path where network configuration and data is stored + Dir string -// Default root dir for storing networks and their configuration. -func GetDefaultRootDir() (string, error) { - homeDir, err := os.UserHomeDir() - if err != nil { - return "", err - } - return filepath.Join(homeDir, ".tmpnet", "networks"), nil -} + // Configuration common across nodes + Genesis *genesis.UnparsedConfig + ChainConfigs map[string]FlagsMap -// Find the next available network ID by attempting to create a -// directory numbered from 1000 until creation succeeds. Returns the -// network id and the full path of the created directory. -func FindNextNetworkID(rootDir string) (uint32, string, error) { - var ( - networkID uint32 = 1000 - dirPath string - ) - for { - _, reserved := constants.NetworkIDToNetworkName[networkID] - if reserved { - networkID++ - continue - } + // Default configuration to use when creating new nodes + DefaultFlags FlagsMap + DefaultRuntimeConfig NodeRuntimeConfig - dirPath = filepath.Join(rootDir, strconv.FormatUint(uint64(networkID), 10)) - err := os.Mkdir(dirPath, perms.ReadWriteExecute) - if err == nil { - return networkID, dirPath, nil - } + // Keys pre-funded in the genesis on both the X-Chain and the C-Chain + PreFundedKeys []*secp256k1.PrivateKey - if !errors.Is(err, fs.ErrExist) { - return 0, "", fmt.Errorf("failed to create network directory: %w", err) - } + // Nodes that constitute the network + Nodes []*Node +} - // Directory already exists, keep iterating - networkID++ +// Ensure a real and absolute network dir so that node +// configuration that embeds the network path will continue to +// work regardless of symlink and working directory changes. +func toCanonicalDir(dir string) (string, error) { + absDir, err := filepath.Abs(dir) + if err != nil { + return "", err } + return filepath.EvalSymlinks(absDir) } -// Defines the configuration required for a tempoary network -type Network struct { - NodeRuntimeConfig +// Initializes a new network with default configuration. +func NewDefaultNetwork(w io.Writer, avalancheGoPath string, nodeCount int) (*Network, error) { + if _, err := fmt.Fprintf(w, "Preparing configuration for new network with %s\n", avalancheGoPath); err != nil { + return nil, err + } - Genesis *genesis.UnparsedConfig - CChainConfig FlagsMap - DefaultFlags FlagsMap - PreFundedKeys []*secp256k1.PrivateKey + keys, err := NewPrivateKeys(DefaultPreFundedKeyCount) + if err != nil { + return nil, err + } - // Nodes comprising the network - Nodes []*Node + network := &Network{ + DefaultFlags: DefaultFlags(), + DefaultRuntimeConfig: NodeRuntimeConfig{ + AvalancheGoPath: avalancheGoPath, + }, + PreFundedKeys: keys, + ChainConfigs: DefaultChainConfigs(), + } - // Path where network configuration will be stored - Dir string + network.Nodes = make([]*Node, nodeCount) + for i := range network.Nodes { + network.Nodes[i] = NewNode("") + if err := network.EnsureNodeConfig(network.Nodes[i]); err != nil { + return nil, err + } + } + + return network, nil } -// Adds a backend-agnostic ephemeral node to the network -func (n *Network) AddEphemeralNode(ctx context.Context, w io.Writer, flags FlagsMap) (*Node, error) { - if flags == nil { - flags = FlagsMap{} +// Stops the nodes of the network configured in the provided directory. +func StopNetwork(ctx context.Context, dir string) error { + network, err := ReadNetwork(dir) + if err != nil { + return err } - return n.AddNode(ctx, w, &Node{ - Flags: flags, - }, true /* isEphemeral */) + return network.Stop(ctx) } -// Starts a new network stored under the provided root dir. Required -// configuration will be defaulted if not provided. -func StartNetwork( - ctx context.Context, - w io.Writer, - rootDir string, - network *Network, - nodeCount int, - keyCount int, -) (*Network, error) { - if _, err := fmt.Fprintf(w, "Preparing configuration for new temporary network with %s\n", network.AvalancheGoPath); err != nil { +// Reads a network from the provided directory. +func ReadNetwork(dir string) (*Network, error) { + canonicalDir, err := toCanonicalDir(dir) + if err != nil { return nil, err } + network := &Network{ + Dir: canonicalDir, + } + if err := network.Read(); err != nil { + return nil, fmt.Errorf("failed to read network: %w", err) + } + return network, nil +} +// Creates the network on disk, choosing its network id and generating its genesis in the process. +func (n *Network) Create(rootDir string) error { if len(rootDir) == 0 { // Use the default root dir var err error - rootDir, err = GetDefaultRootDir() + rootDir, err = getDefaultRootDir() if err != nil { - return nil, err + return err } } // Ensure creation of the root dir if err := os.MkdirAll(rootDir, perms.ReadWriteExecute); err != nil { - return nil, fmt.Errorf("failed to create root network dir: %w", err) + return fmt.Errorf("failed to create root network dir: %w", err) } // Determine the network path and ID @@ -139,107 +145,30 @@ func StartNetwork( networkDir string networkID uint32 ) - if network.Genesis != nil && network.Genesis.NetworkID > 0 { + if n.Genesis != nil && n.Genesis.NetworkID > 0 { // Use the network ID defined in the provided genesis - networkID = network.Genesis.NetworkID + networkID = n.Genesis.NetworkID } if networkID > 0 { // Use a directory with a random suffix var err error - networkDir, err = os.MkdirTemp(rootDir, fmt.Sprintf("%d.", network.Genesis.NetworkID)) + networkDir, err = os.MkdirTemp(rootDir, fmt.Sprintf("%d.", n.Genesis.NetworkID)) if err != nil { - return nil, fmt.Errorf("failed to create network dir: %w", err) + return fmt.Errorf("failed to create network dir: %w", err) } } else { // Find the next available network ID based on the contents of the root dir var err error - networkID, networkDir, err = FindNextNetworkID(rootDir) + networkID, networkDir, err = findNextNetworkID(rootDir) if err != nil { - return nil, err + return err } } - - // Setting the network dir before populating config ensures the - // nodes know where to write their configuration. - network.Dir = networkDir - - if err := network.PopulateNetworkConfig(networkID, nodeCount, keyCount); err != nil { - return nil, err - } - - if err := network.WriteAll(); err != nil { - return nil, err - } - if _, err := fmt.Fprintf(w, "Starting network %d @ %s\n", network.Genesis.NetworkID, network.Dir); err != nil { - return nil, err - } - if err := network.Start(w); err != nil { - return nil, err - } - if _, err := fmt.Fprintf(w, "Waiting for all nodes to report healthy...\n\n"); err != nil { - return nil, err - } - if err := network.WaitForHealthy(ctx, w); err != nil { - return nil, err - } - if _, err := fmt.Fprintf(w, "\nStarted network %d @ %s\n", network.Genesis.NetworkID, network.Dir); err != nil { - return nil, err - } - return network, nil -} - -// Read a network from the provided directory. -func ReadNetwork(dir string) (*Network, error) { - network := &Network{Dir: dir} - if err := network.ReadAll(); err != nil { - return nil, fmt.Errorf("failed to read network: %w", err) - } - return network, nil -} - -// Stop the nodes of the network configured in the provided directory. -func StopNetwork(ctx context.Context, dir string) error { - network, err := ReadNetwork(dir) + canonicalDir, err := toCanonicalDir(networkDir) if err != nil { return err } - return network.Stop(ctx) -} - -// Ensure the network has the configuration it needs to start. -func (n *Network) PopulateNetworkConfig(networkID uint32, nodeCount int, keyCount int) error { - if len(n.Nodes) > 0 && nodeCount > 0 { - return errInvalidNodeCount - } - if len(n.PreFundedKeys) > 0 && keyCount > 0 { - return errInvalidKeyCount - } - - if nodeCount > 0 { - // Add the specified number of nodes - nodes := make([]*Node, 0, nodeCount) - for i := 0; i < nodeCount; i++ { - nodes = append(nodes, NewNode("")) - } - n.Nodes = nodes - } - - // Ensure each node has keys and an associated node ID. This - // ensures the availability of node IDs and proofs of possession - // for genesis generation. - for _, node := range n.Nodes { - if err := node.EnsureKeys(); err != nil { - return err - } - } - - if keyCount > 0 { - keys, err := NewPrivateKeys(keyCount) - if err != nil { - return err - } - n.PreFundedKeys = keys - } + n.Dir = canonicalDir if n.Genesis == nil { genesis, err := NewTestGenesis(networkID, n.Nodes, n.PreFundedKeys) @@ -249,117 +178,81 @@ func (n *Network) PopulateNetworkConfig(networkID uint32, nodeCount int, keyCoun n.Genesis = genesis } - if n.CChainConfig == nil { - n.CChainConfig = DefaultCChainConfig() - } - - // Default flags need to be set in advance of node config - // population to ensure correct node configuration. - if n.DefaultFlags == nil { - n.DefaultFlags = DefaultFlags() - } - for _, node := range n.Nodes { // Ensure the node is configured for use with the network and // knows where to write its configuration. - if err := n.PopulateNodeConfig(node, n.Dir); err != nil { - return err + if err := n.EnsureNodeConfig(node); err != nil { + return nil } } - return nil + // Ensure configuration on disk is current + return n.Write() } -// Ensure the provided node has the configuration it needs to start. If the data dir is -// not set, it will be defaulted to [nodeParentDir]/[node ID]. Requires that the -// network has valid genesis data. -func (n *Network) PopulateNodeConfig(node *Node, nodeParentDir string) error { - flags := node.Flags - - // Set values common to all nodes - flags.SetDefaults(n.DefaultFlags) - flags.SetDefaults(FlagsMap{ - config.GenesisFileKey: n.GetGenesisPath(), - config.ChainConfigDirKey: n.GetChainConfigDir(), - }) - - // Convert the network id to a string to ensure consistency in JSON round-tripping. - flags[config.NetworkNameKey] = strconv.FormatUint(uint64(n.Genesis.NetworkID), 10) - - // Ensure keys are added if necessary - if err := node.EnsureKeys(); err != nil { +// Starts all nodes in the network +func (n *Network) Start(ctx context.Context, w io.Writer) error { + if _, err := fmt.Fprintf(w, "Starting network %d @ %s\n", n.Genesis.NetworkID, n.Dir); err != nil { return err } - // Ensure the node is configured with a runtime config - if node.RuntimeConfig == nil { - node.RuntimeConfig = &NodeRuntimeConfig{ - AvalancheGoPath: n.AvalancheGoPath, + // Configure the networking for each node and start + for _, node := range n.Nodes { + if err := n.StartNode(ctx, w, node); err != nil { + return err } } - // Ensure the node's data dir is configured - dataDir := node.getDataDir() - if len(dataDir) == 0 { - // NodeID will have been set by EnsureKeys - dataDir = filepath.Join(nodeParentDir, node.NodeID.String()) - flags[config.DataDirKey] = dataDir + if _, err := fmt.Fprintf(w, "Waiting for all nodes to report healthy...\n\n"); err != nil { + return err + } + if err := n.WaitForHealthy(ctx, w); err != nil { + return err + } + if _, err := fmt.Fprintf(w, "\nStarted network %d @ %s\n", n.Genesis.NetworkID, n.Dir); err != nil { + return err } return nil } -// Starts a network for the first time -func (n *Network) Start(w io.Writer) error { - if len(n.Dir) == 0 { - return errNetworkDirNotSet +func (n *Network) AddEphemeralNode(ctx context.Context, w io.Writer, flags FlagsMap) (*Node, error) { + node := NewNode("") + node.Flags = flags + node.IsEphemeral = true + if err := n.StartNode(ctx, w, node); err != nil { + return nil, err } + return node, nil +} - // Ensure configuration on disk is current - if err := n.WriteAll(); err != nil { +// Starts the provided node after configuring it for the network. +func (n *Network) StartNode(ctx context.Context, w io.Writer, node *Node) error { + if err := n.EnsureNodeConfig(node); err != nil { return err } - // Accumulate bootstrap nodes such that each subsequently started - // node bootstraps from the nodes previously started. - // - // e.g. - // 1st node: no bootstrap nodes - // 2nd node: 1st node - // 3rd node: 1st and 2nd nodes - // ... - // - bootstrapIDs := make([]string, 0, len(n.Nodes)) - bootstrapIPs := make([]string, 0, len(n.Nodes)) - - // Configure networking and start each node - for _, node := range n.Nodes { - // Update network configuration - node.SetNetworkingConfig(bootstrapIDs, bootstrapIPs) - - // Write configuration to disk in preparation for node start - if err := node.Write(); err != nil { - return err - } + bootstrapIPs, bootstrapIDs, err := n.getBootstrapIPsAndIDs(node) + if err != nil { + return err + } + node.SetNetworkingConfig(bootstrapIDs, bootstrapIPs) - // Start waits for the process context to be written which - // indicates that the node will be accepting connections on - // its staking port. The network will start faster with this - // synchronization due to the avoidance of exponential backoff - // if a node tries to connect to a beacon that is not ready. - if err := node.Start(w); err != nil { - return err - } + if err := node.Write(); err != nil { + return err + } - // Collect bootstrap nodes for subsequently started nodes to use - bootstrapIDs = append(bootstrapIDs, node.NodeID.String()) - bootstrapIPs = append(bootstrapIPs, node.StakingAddress) + if err := node.Start(w); err != nil { + // Attempt to stop an unhealthy node to provide some assurance to the caller + // that an error condition will not result in a lingering process. + err = errors.Join(err, node.Stop(ctx)) + return err } return nil } -// Wait until all nodes in the network are healthy. +// Waits until all nodes in the network are healthy. func (n *Network) WaitForHealthy(ctx context.Context, w io.Writer) error { ticker := time.NewTicker(networkHealthCheckInterval) defer ticker.Stop() @@ -394,303 +287,150 @@ func (n *Network) WaitForHealthy(ctx context.Context, w io.Writer) error { return nil } -// Retrieve API URIs for all running primary validator nodes. URIs for -// ephemeral nodes are not returned. -func (n *Network) GetURIs() []NodeURI { - uris := make([]NodeURI, 0, len(n.Nodes)) - for _, node := range n.Nodes { - // Only append URIs that are not empty. A node may have an - // empty URI if it was not running at the time - // node.ReadProcessContext() was called. - if len(node.URI) > 0 { - uris = append(uris, NodeURI{ - NodeID: node.NodeID, - URI: node.URI, - }) - } +// Stops all nodes in the network. +func (n *Network) Stop(ctx context.Context) error { + // Target all nodes, including the ephemeral ones + nodes, err := ReadNodes(n.Dir, true /* includeEphemeral */) + if err != nil { + return err } - return uris -} -// Stop all nodes in the network. -func (n *Network) Stop(ctx context.Context) error { var errs []error - // Assume the nodes are loaded and the pids are current - for _, node := range n.Nodes { - if err := node.Stop(ctx); err != nil { + + // Initiate stop on all nodes + for _, node := range nodes { + if err := node.InitiateStop(); err != nil { errs = append(errs, fmt.Errorf("failed to stop node %s: %w", node.NodeID, err)) } } - if len(errs) > 0 { - return fmt.Errorf("failed to stop network:\n%w", errors.Join(errs...)) - } - return nil -} - -func (n *Network) GetGenesisPath() string { - return filepath.Join(n.Dir, "genesis.json") -} - -func (n *Network) ReadGenesis() error { - bytes, err := os.ReadFile(n.GetGenesisPath()) - if err != nil { - return fmt.Errorf("failed to read genesis: %w", err) - } - genesis := genesis.UnparsedConfig{} - if err := json.Unmarshal(bytes, &genesis); err != nil { - return fmt.Errorf("failed to unmarshal genesis: %w", err) - } - n.Genesis = &genesis - return nil -} -func (n *Network) WriteGenesis() error { - bytes, err := DefaultJSONMarshal(n.Genesis) - if err != nil { - return fmt.Errorf("failed to marshal genesis: %w", err) - } - if err := os.WriteFile(n.GetGenesisPath(), bytes, perms.ReadWrite); err != nil { - return fmt.Errorf("failed to write genesis: %w", err) + // Wait for stop to complete on all nodes + for _, node := range nodes { + if err := node.WaitForStopped(ctx); err != nil { + errs = append(errs, fmt.Errorf("failed to wait for node %s to stop: %w", node.NodeID, err)) + } } - return nil -} -func (n *Network) GetChainConfigDir() string { - return filepath.Join(n.Dir, "chains") -} - -func (n *Network) GetCChainConfigPath() string { - return filepath.Join(n.GetChainConfigDir(), "C", "config.json") -} - -func (n *Network) ReadCChainConfig() error { - chainConfig, err := ReadFlagsMap(n.GetCChainConfigPath(), "C-Chain config") - if err != nil { - return err + if len(errs) > 0 { + return fmt.Errorf("failed to stop network:\n%w", errors.Join(errs...)) } - n.CChainConfig = *chainConfig return nil } -func (n *Network) WriteCChainConfig() error { - path := n.GetCChainConfigPath() - dir := filepath.Dir(path) - if err := os.MkdirAll(dir, perms.ReadWriteExecute); err != nil { - return fmt.Errorf("failed to create C-Chain config dir: %w", err) - } - return n.CChainConfig.Write(path, "C-Chain config") -} - -// Used to marshal/unmarshal persistent network defaults. -type networkDefaults struct { - Flags FlagsMap - AvalancheGoPath string - PreFundedKeys []*secp256k1.PrivateKey -} - -func (n *Network) GetDefaultsPath() string { - return filepath.Join(n.Dir, "defaults.json") -} +// Ensures the provided node has the configuration it needs to start. If the data dir is not +// set, it will be defaulted to [nodeParentDir]/[node ID]. For a not-yet-created network, +// no action will be taken. +// TODO(marun) Reword or refactor to account for the differing behavior pre- vs post-start +func (n *Network) EnsureNodeConfig(node *Node) error { + flags := node.Flags -func (n *Network) ReadDefaults() error { - bytes, err := os.ReadFile(n.GetDefaultsPath()) - if err != nil { - return fmt.Errorf("failed to read defaults: %w", err) - } - defaults := networkDefaults{} - if err := json.Unmarshal(bytes, &defaults); err != nil { - return fmt.Errorf("failed to unmarshal defaults: %w", err) + // Set the network name if available + if n.Genesis != nil && n.Genesis.NetworkID > 0 { + // Convert the network id to a string to ensure consistency in JSON round-tripping. + flags[config.NetworkNameKey] = strconv.FormatUint(uint64(n.Genesis.NetworkID), 10) } - n.DefaultFlags = defaults.Flags - n.AvalancheGoPath = defaults.AvalancheGoPath - n.PreFundedKeys = defaults.PreFundedKeys - return nil -} -func (n *Network) WriteDefaults() error { - defaults := networkDefaults{ - Flags: n.DefaultFlags, - AvalancheGoPath: n.AvalancheGoPath, - PreFundedKeys: n.PreFundedKeys, - } - bytes, err := DefaultJSONMarshal(defaults) - if err != nil { - return fmt.Errorf("failed to marshal defaults: %w", err) - } - if err := os.WriteFile(n.GetDefaultsPath(), bytes, perms.ReadWrite); err != nil { - return fmt.Errorf("failed to write defaults: %w", err) + if err := node.EnsureKeys(); err != nil { + return err } - return nil -} - -func (n *Network) EnvFilePath() string { - return filepath.Join(n.Dir, "network.env") -} -func (n *Network) EnvFileContents() string { - return fmt.Sprintf("export %s=%s", NetworkDirEnvName, n.Dir) -} + flags.SetDefaults(n.DefaultFlags) -// Write an env file that sets the network dir env when sourced. -func (n *Network) WriteEnvFile() error { - if err := os.WriteFile(n.EnvFilePath(), []byte(n.EnvFileContents()), perms.ReadWrite); err != nil { - return fmt.Errorf("failed to write network env file: %w", err) + // Set fields including the network path + if len(n.Dir) > 0 { + node.Flags.SetDefaults(FlagsMap{ + config.GenesisFileKey: n.getGenesisPath(), + config.ChainConfigDirKey: n.getChainConfigDir(), + }) + + // Ensure the node's data dir is configured + dataDir := node.getDataDir() + if len(dataDir) == 0 { + // NodeID will have been set by EnsureKeys + dataDir = filepath.Join(n.Dir, node.NodeID.String()) + flags[config.DataDirKey] = dataDir + } } - return nil -} -func (n *Network) WriteNodes() error { - for _, node := range n.Nodes { - if err := node.Write(); err != nil { - return err + // Ensure the node runtime is configured + if node.RuntimeConfig == nil { + node.RuntimeConfig = &NodeRuntimeConfig{ + AvalancheGoPath: n.DefaultRuntimeConfig.AvalancheGoPath, } } - return nil -} -// Write network configuration to disk. -func (n *Network) WriteAll() error { - if len(n.Dir) == 0 { - return errInvalidNetworkDir - } - if err := n.WriteGenesis(); err != nil { - return err - } - if err := n.WriteCChainConfig(); err != nil { - return err - } - if err := n.WriteDefaults(); err != nil { - return err - } - if err := n.WriteEnvFile(); err != nil { - return err - } - return n.WriteNodes() + return nil } -// Read network configuration from disk. -func (n *Network) ReadConfig() error { - if err := n.ReadGenesis(); err != nil { - return err - } - if err := n.ReadCChainConfig(); err != nil { - return err - } - return n.ReadDefaults() +func (n *Network) GetNodeURIs() []NodeURI { + return GetNodeURIs(n.Nodes) } -// Read node configuration and process context from disk. -func (n *Network) ReadNodes() error { - nodes := []*Node{} - - // Node configuration / process context is stored in child directories - entries, err := os.ReadDir(n.Dir) +// Retrieves bootstrap IPs and IDs for all nodes except the skipped one (this supports +// collecting the bootstrap details for restarting a node). +func (n *Network) getBootstrapIPsAndIDs(skippedNode *Node) ([]string, []string, error) { + // Collect staking addresses of non-ephemeral nodes for use in bootstrapping a node + nodes, err := ReadNodes(n.Dir, false /* includeEphemeral */) if err != nil { - return fmt.Errorf("failed to read network path: %w", err) + return nil, nil, fmt.Errorf("failed to read network's nodes: %w", err) } - for _, entry := range entries { - if !entry.IsDir() { + var ( + bootstrapIPs = make([]string, 0, len(nodes)) + bootstrapIDs = make([]string, 0, len(nodes)) + ) + for _, node := range nodes { + if skippedNode != nil && node.NodeID == skippedNode.NodeID { continue } - nodeDir := filepath.Join(n.Dir, entry.Name()) - node, err := ReadNode(nodeDir) - if errors.Is(err, os.ErrNotExist) { - // If no config file exists, assume this is not the path of a node + if len(node.StakingAddress) == 0 { + // Node is not running continue - } else if err != nil { - return err } - nodes = append(nodes, node) + bootstrapIPs = append(bootstrapIPs, node.StakingAddress) + bootstrapIDs = append(bootstrapIDs, node.NodeID.String()) } - n.Nodes = nodes - - return nil -} - -// Read network and node configuration from disk. -func (n *Network) ReadAll() error { - if err := n.ReadConfig(); err != nil { - return err - } - return n.ReadNodes() + return bootstrapIPs, bootstrapIDs, nil } -func (n *Network) AddNode(ctx context.Context, w io.Writer, node *Node, isEphemeral bool) (*Node, error) { - // Assume network configuration has been written to disk and is current in memory - - if node == nil { - // Set an empty data dir so that PopulateNodeConfig will know - // to set the default of `[network dir]/[node id]`. - node = NewNode("") - } - - // Default to a data dir of [network-dir]/[node-ID] - nodeParentDir := n.Dir - if isEphemeral { - // For an ephemeral node, default to a data dir of [network-dir]/[ephemeral-dir]/[node-ID] - // to provide a clear separation between nodes that are expected to expose stable API - // endpoints and those that will live for only a short time (e.g. a node started by a test - // and stopped on teardown). - // - // The data for an ephemeral node is still stored in the file tree rooted at the network - // dir to ensure that recursively archiving the network dir in CI will collect all node - // data used for a test run. - nodeParentDir = filepath.Join(n.Dir, defaultEphemeralDirName) - } - - if err := n.PopulateNodeConfig(node, nodeParentDir); err != nil { - return nil, err - } - - bootstrapIPs, bootstrapIDs, err := n.GetBootstrapIPsAndIDs() - if err != nil { - return nil, err - } - node.SetNetworkingConfig(bootstrapIDs, bootstrapIPs) - - if err := node.Write(); err != nil { - return nil, err - } - - err = node.Start(w) +// Retrieves the default root dir for storing networks and their +// configuration. +func getDefaultRootDir() (string, error) { + homeDir, err := os.UserHomeDir() if err != nil { - // Attempt to stop an unhealthy node to provide some assurance to the caller - // that an error condition will not result in a lingering process. - stopErr := node.Stop(ctx) - if stopErr != nil { - err = errors.Join(err, stopErr) - } - return nil, err + return "", err } - - return node, nil + return filepath.Join(homeDir, ".tmpnet", "networks"), nil } -func (n *Network) GetBootstrapIPsAndIDs() ([]string, []string, error) { - // Collect staking addresses of running nodes for use in bootstrapping a node - if err := n.ReadNodes(); err != nil { - return nil, nil, fmt.Errorf("failed to read network nodes: %w", err) - } +// Finds the next available network ID by attempting to create a +// directory numbered from 1000 until creation succeeds. Returns the +// network id and the full path of the created directory. +func findNextNetworkID(rootDir string) (uint32, string, error) { var ( - bootstrapIPs = make([]string, 0, len(n.Nodes)) - bootstrapIDs = make([]string, 0, len(n.Nodes)) + networkID uint32 = 1000 + dirPath string ) - for _, node := range n.Nodes { - if len(node.StakingAddress) == 0 { - // Node is not running + for { + _, reserved := constants.NetworkIDToNetworkName[networkID] + if reserved { + networkID++ continue } - bootstrapIPs = append(bootstrapIPs, node.StakingAddress) - bootstrapIDs = append(bootstrapIDs, node.NodeID.String()) - } + dirPath = filepath.Join(rootDir, strconv.FormatUint(uint64(networkID), 10)) + err := os.Mkdir(dirPath, perms.ReadWriteExecute) + if err == nil { + return networkID, dirPath, nil + } - if len(bootstrapIDs) == 0 { - return nil, nil, errMissingBootstrapNodes - } + if !errors.Is(err, fs.ErrExist) { + return 0, "", fmt.Errorf("failed to create network directory: %w", err) + } - return bootstrapIPs, bootstrapIDs, nil + // Directory already exists, keep iterating + networkID++ + } } diff --git a/tests/fixture/tmpnet/network_config.go b/tests/fixture/tmpnet/network_config.go new file mode 100644 index 000000000000..967a2b1b4ee3 --- /dev/null +++ b/tests/fixture/tmpnet/network_config.go @@ -0,0 +1,220 @@ +// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +package tmpnet + +import ( + "encoding/json" + "errors" + "fmt" + "os" + "path/filepath" + + "github.com/ava-labs/avalanchego/genesis" + "github.com/ava-labs/avalanchego/utils/crypto/secp256k1" + "github.com/ava-labs/avalanchego/utils/perms" +) + +// The Network type is defined in this file (reading/writing configuration) and network.go +// (orchestration). + +var errMissingNetworkDir = errors.New("failed to write network: missing network directory") + +// Read network and node configuration from disk. +func (n *Network) Read() error { + if err := n.readNetwork(); err != nil { + return err + } + return n.readNodes() +} + +// Write network configuration to disk. +func (n *Network) Write() error { + if len(n.Dir) == 0 { + return errMissingNetworkDir + } + if err := n.writeGenesis(); err != nil { + return err + } + if err := n.writeChainConfigs(); err != nil { + return err + } + if err := n.writeNetworkConfig(); err != nil { + return err + } + if err := n.writeEnvFile(); err != nil { + return err + } + return n.writeNodes() +} + +// Read network configuration from disk. +func (n *Network) readNetwork() error { + if err := n.readGenesis(); err != nil { + return err + } + if err := n.readChainConfigs(); err != nil { + return err + } + return n.readConfig() +} + +// Read the non-ephemeral nodes associated with the network from disk. +func (n *Network) readNodes() error { + nodes, err := ReadNodes(n.Dir, false /* includeEphemeral */) + if err != nil { + return err + } + n.Nodes = nodes + return nil +} + +func (n *Network) writeNodes() error { + for _, node := range n.Nodes { + if err := node.Write(); err != nil { + return err + } + } + return nil +} + +func (n *Network) getGenesisPath() string { + return filepath.Join(n.Dir, "genesis.json") +} + +func (n *Network) readGenesis() error { + bytes, err := os.ReadFile(n.getGenesisPath()) + if err != nil { + return fmt.Errorf("failed to read genesis: %w", err) + } + genesis := genesis.UnparsedConfig{} + if err := json.Unmarshal(bytes, &genesis); err != nil { + return fmt.Errorf("failed to unmarshal genesis: %w", err) + } + n.Genesis = &genesis + return nil +} + +func (n *Network) writeGenesis() error { + bytes, err := DefaultJSONMarshal(n.Genesis) + if err != nil { + return fmt.Errorf("failed to marshal genesis: %w", err) + } + if err := os.WriteFile(n.getGenesisPath(), bytes, perms.ReadWrite); err != nil { + return fmt.Errorf("failed to write genesis: %w", err) + } + return nil +} + +func (n *Network) getChainConfigDir() string { + return filepath.Join(n.Dir, "chains") +} + +func (n *Network) readChainConfigs() error { + baseChainConfigDir := n.getChainConfigDir() + entries, err := os.ReadDir(baseChainConfigDir) + if err != nil { + return fmt.Errorf("failed to read chain config dir: %w", err) + } + + // Clear the map of data that may end up stale (e.g. if a given + // chain is in the map but no longer exists on disk) + n.ChainConfigs = map[string]FlagsMap{} + + for _, entry := range entries { + if !entry.IsDir() { + // Chain config files are expected to be nested under a + // directory with the name of the chain alias. + continue + } + chainAlias := entry.Name() + configPath := filepath.Join(baseChainConfigDir, chainAlias, defaultConfigFilename) + if _, err := os.Stat(configPath); os.IsNotExist(err) { + // No config file present + continue + } + chainConfig, err := ReadFlagsMap(configPath, fmt.Sprintf("%s chain config", chainAlias)) + if err != nil { + return err + } + n.ChainConfigs[chainAlias] = *chainConfig + } + + return nil +} + +func (n *Network) writeChainConfigs() error { + baseChainConfigDir := n.getChainConfigDir() + + for chainAlias, chainConfig := range n.ChainConfigs { + // Create the directory + chainConfigDir := filepath.Join(baseChainConfigDir, chainAlias) + if err := os.MkdirAll(chainConfigDir, perms.ReadWriteExecute); err != nil { + return fmt.Errorf("failed to create %s chain config dir: %w", chainAlias, err) + } + + // Write the file + path := filepath.Join(chainConfigDir, defaultConfigFilename) + if err := chainConfig.Write(path, fmt.Sprintf("%s chain config", chainAlias)); err != nil { + return err + } + } + + // TODO(marun) Ensure the removal of chain aliases that aren't present in the map + + return nil +} + +func (n *Network) getConfigPath() string { + return filepath.Join(n.Dir, defaultConfigFilename) +} + +func (n *Network) readConfig() error { + bytes, err := os.ReadFile(n.getConfigPath()) + if err != nil { + return fmt.Errorf("failed to read network config: %w", err) + } + if err := json.Unmarshal(bytes, n); err != nil { + return fmt.Errorf("failed to unmarshal network config: %w", err) + } + return nil +} + +// The subset of network fields to store in the network config file. +type serializedNetworkConfig struct { + DefaultFlags FlagsMap + DefaultRuntimeConfig NodeRuntimeConfig + PreFundedKeys []*secp256k1.PrivateKey +} + +func (n *Network) writeNetworkConfig() error { + config := &serializedNetworkConfig{ + DefaultFlags: n.DefaultFlags, + DefaultRuntimeConfig: n.DefaultRuntimeConfig, + PreFundedKeys: n.PreFundedKeys, + } + bytes, err := DefaultJSONMarshal(config) + if err != nil { + return fmt.Errorf("failed to marshal network config: %w", err) + } + if err := os.WriteFile(n.getConfigPath(), bytes, perms.ReadWrite); err != nil { + return fmt.Errorf("failed to write network config: %w", err) + } + return nil +} + +func (n *Network) EnvFilePath() string { + return filepath.Join(n.Dir, "network.env") +} + +func (n *Network) EnvFileContents() string { + return fmt.Sprintf("export %s=%s", NetworkDirEnvName, n.Dir) +} + +// Write an env file that sets the network dir env when sourced. +func (n *Network) writeEnvFile() error { + if err := os.WriteFile(n.EnvFilePath(), []byte(n.EnvFileContents()), perms.ReadWrite); err != nil { + return fmt.Errorf("failed to write network env file: %w", err) + } + return nil +} diff --git a/tests/fixture/tmpnet/network_test.go b/tests/fixture/tmpnet/network_test.go index a797ff873a25..3cbbb8ffcae8 100644 --- a/tests/fixture/tmpnet/network_test.go +++ b/tests/fixture/tmpnet/network_test.go @@ -4,6 +4,7 @@ package tmpnet import ( + "bytes" "testing" "github.com/stretchr/testify/require" @@ -14,14 +15,14 @@ func TestNetworkSerialization(t *testing.T) { tmpDir := t.TempDir() - network := &Network{Dir: tmpDir} - require.NoError(network.PopulateNetworkConfig(1337, 1, 1)) - require.NoError(network.WriteAll()) + network, err := NewDefaultNetwork(&bytes.Buffer{}, "/path/to/avalanche/go", 1) + require.NoError(err) + require.NoError(network.Create(tmpDir)) // Ensure node runtime is initialized - require.NoError(network.ReadNodes()) + require.NoError(network.readNodes()) - loadedNetwork, err := ReadNetwork(tmpDir) + loadedNetwork, err := ReadNetwork(network.Dir) require.NoError(err) for _, key := range loadedNetwork.PreFundedKeys { // Address() enables comparison with the original network by diff --git a/tests/fixture/tmpnet/node.go b/tests/fixture/tmpnet/node.go index f0f800802046..8638985dd5b2 100644 --- a/tests/fixture/tmpnet/node.go +++ b/tests/fixture/tmpnet/node.go @@ -89,7 +89,7 @@ func ReadNode(dataDir string) (*Node, error) { } // Reads nodes from the specified network directory. -func ReadNodes(networkDir string) ([]*Node, error) { +func ReadNodes(networkDir string, includeEphemeral bool) ([]*Node, error) { nodes := []*Node{} // Node configuration is stored in child directories @@ -111,6 +111,10 @@ func ReadNodes(networkDir string) ([]*Node, error) { return nil, err } + if !includeEphemeral && node.IsEphemeral { + continue + } + nodes = append(nodes, node) } diff --git a/tests/upgrade/upgrade_test.go b/tests/upgrade/upgrade_test.go index 9f56c79ad910..37c2fd259e66 100644 --- a/tests/upgrade/upgrade_test.go +++ b/tests/upgrade/upgrade_test.go @@ -6,7 +6,6 @@ package upgrade import ( "flag" "fmt" - "strings" "testing" "github.com/onsi/ginkgo/v2" @@ -15,7 +14,6 @@ import ( "github.com/stretchr/testify/require" - "github.com/ava-labs/avalanchego/config" "github.com/ava-labs/avalanchego/tests/fixture/e2e" ) @@ -55,21 +53,9 @@ var _ = ginkgo.Describe("[Upgrade]", func() { ginkgo.By(fmt.Sprintf("restarting node %q with %q binary", node.NodeID, avalancheGoExecPathToUpgradeTo)) require.NoError(node.Stop(e2e.DefaultContext())) - // A node must start with sufficient bootstrap nodes to represent a quorum. Since the node's current - // bootstrap configuration may not satisfy this requirement (i.e. if on network start the node was one of - // the first validators), updating the node to bootstrap from all running validators maximizes the - // chances of a successful start. - // - // TODO(marun) Refactor node start to do this automatically - bootstrapIPs, bootstrapIDs, err := network.GetBootstrapIPsAndIDs() - require.NoError(err) - require.NotEmpty(bootstrapIDs) - node.Flags[config.BootstrapIDsKey] = strings.Join(bootstrapIDs, ",") - node.Flags[config.BootstrapIPsKey] = strings.Join(bootstrapIPs, ",") - node.RuntimeConfig.AvalancheGoPath = avalancheGoExecPath - require.NoError(node.Write()) - - require.NoError(node.Start(ginkgo.GinkgoWriter)) + node.RuntimeConfig.AvalancheGoPath = avalancheGoExecPathToUpgradeTo + + require.NoError(network.StartNode(e2e.DefaultContext(), ginkgo.GinkgoWriter, node)) ginkgo.By(fmt.Sprintf("waiting for node %q to report healthy after restart", node.NodeID)) e2e.WaitForHealthy(node) From 73c4c0ff9817cb13fdb8b205939596af0c416f1f Mon Sep 17 00:00:00 2001 From: Dan Laine Date: Sun, 7 Jan 2024 11:22:37 -0500 Subject: [PATCH 26/57] Update uintsize implementation (#2590) --- x/merkledb/codec.go | 13 +++++-------- x/merkledb/codec_test.go | 21 +++++++++++++++++---- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/x/merkledb/codec.go b/x/merkledb/codec.go index 02eb5fc3ad5a..eae205631192 100644 --- a/x/merkledb/codec.go +++ b/x/merkledb/codec.go @@ -9,6 +9,7 @@ import ( "errors" "io" "math" + "math/bits" "sync" "golang.org/x/exp/maps" @@ -101,14 +102,10 @@ func (c *codecImpl) childSize(index byte, childEntry *child) int { // based on the current implementation of codecImpl.encodeUint which uses binary.PutUvarint func (*codecImpl) uintSize(value uint64) int { - // binary.PutUvarint repeatedly divides by 128 until the value is under 128, - // so count the number of times that will occur - i := 0 - for value >= 0x80 { - value >>= 7 - i++ - } - return i + 1 + if value == 0 { + return 1 + } + return (bits.Len64(value) + 6) / 7 } func (c *codecImpl) keySize(p Key) int { diff --git a/x/merkledb/codec_test.go b/x/merkledb/codec_test.go index 5972cbb43b9d..455b75e1bed1 100644 --- a/x/merkledb/codec_test.go +++ b/x/merkledb/codec_test.go @@ -247,9 +247,22 @@ func TestCodecDecodeKeyLengthOverflowRegression(t *testing.T) { func TestUintSize(t *testing.T) { c := codec.(*codecImpl) - for i := uint64(0); i < math.MaxInt16; i++ { - expectedSize := c.uintSize(i) - actualSize := binary.PutUvarint(make([]byte, binary.MaxVarintLen64), i) - require.Equal(t, expectedSize, actualSize, i) + + // Test lower bound + expectedSize := c.uintSize(0) + actualSize := binary.PutUvarint(make([]byte, binary.MaxVarintLen64), 0) + require.Equal(t, expectedSize, actualSize) + + // Test upper bound + expectedSize = c.uintSize(math.MaxUint64) + actualSize = binary.PutUvarint(make([]byte, binary.MaxVarintLen64), math.MaxUint64) + require.Equal(t, expectedSize, actualSize) + + // Test powers of 2 + for power := 0; power < 64; power++ { + n := uint64(1) << uint(power) + expectedSize := c.uintSize(n) + actualSize := binary.PutUvarint(make([]byte, binary.MaxVarintLen64), n) + require.Equal(t, expectedSize, actualSize, power) } } From bba8e75b5bec7c7a0c8d6b00930f9872131b301d Mon Sep 17 00:00:00 2001 From: Stephen Buttolph Date: Sun, 7 Jan 2024 22:24:14 -0500 Subject: [PATCH 27/57] Optimize bloom filter (#2588) --- go.mod | 3 +- go.sum | 2 - network/p2p/gossip/bloom.go | 79 ++----- network/p2p/gossip/bloom_test.go | 7 +- network/p2p/gossip/handler.go | 14 +- proto/pb/sdk/sdk.pb.go | 38 ++-- proto/sdk/sdk.proto | 4 +- pubsub/bloom/filter.go | 51 +++++ .../bloom/filter_test.go | 8 +- {utils => pubsub}/bloom/map_filter.go | 0 pubsub/connection.go | 4 +- pubsub/filter_param.go | 2 +- pubsub/filter_test.go | 2 +- utils/bloom/bloom_filter.go | 77 ------- utils/bloom/filter.go | 151 +++++++++++++ utils/bloom/filter_test.go | 100 +++++++++ utils/bloom/hasher.go | 31 +++ utils/bloom/hasher_test.go | 34 +++ utils/bloom/optimal.go | 115 ++++++++++ utils/bloom/optimal_test.go | 203 ++++++++++++++++++ utils/bloom/read_filter.go | 48 +++++ utils/bloom/read_filter_test.go | 112 ++++++++++ vms/avm/network/config.go | 2 +- vms/avm/network/gossip.go | 2 +- vms/platformvm/network/config.go | 2 +- vms/platformvm/network/gossip.go | 2 +- 26 files changed, 907 insertions(+), 186 deletions(-) create mode 100644 pubsub/bloom/filter.go rename utils/bloom/bloom_filter_test.go => pubsub/bloom/filter_test.go (81%) rename {utils => pubsub}/bloom/map_filter.go (100%) delete mode 100644 utils/bloom/bloom_filter.go create mode 100644 utils/bloom/filter.go create mode 100644 utils/bloom/filter_test.go create mode 100644 utils/bloom/hasher.go create mode 100644 utils/bloom/hasher_test.go create mode 100644 utils/bloom/optimal.go create mode 100644 utils/bloom/optimal_test.go create mode 100644 utils/bloom/read_filter.go create mode 100644 utils/bloom/read_filter_test.go diff --git a/go.mod b/go.mod index 7e333adf6682..f557f64cca62 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,6 @@ require ( github.com/gorilla/rpc v1.2.0 github.com/gorilla/websocket v1.4.2 github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 - github.com/holiman/bloomfilter/v2 v2.0.3 github.com/huin/goupnp v1.0.3 github.com/jackpal/gateway v1.0.6 github.com/jackpal/go-nat-pmp v1.0.2 @@ -39,7 +38,6 @@ require ( github.com/prometheus/client_model v0.3.0 github.com/rs/cors v1.7.0 github.com/shirou/gopsutil v3.21.11+incompatible - github.com/spaolacci/murmur3 v1.1.0 github.com/spf13/cast v1.5.0 github.com/spf13/cobra v1.0.0 github.com/spf13/pflag v1.0.5 @@ -110,6 +108,7 @@ require ( github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/holiman/big v0.0.0-20221017200358-a027dc42d04e // indirect + github.com/holiman/bloomfilter/v2 v2.0.3 // indirect github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/klauspost/compress v1.15.15 // indirect diff --git a/go.sum b/go.sum index df800dfefb61..743661fe7ee6 100644 --- a/go.sum +++ b/go.sum @@ -554,8 +554,6 @@ github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1 github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= -github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= diff --git a/network/p2p/gossip/bloom.go b/network/p2p/gossip/bloom.go index 12fca6bfcad4..9553c22c3692 100644 --- a/network/p2p/gossip/bloom.go +++ b/network/p2p/gossip/bloom.go @@ -5,27 +5,25 @@ package gossip import ( "crypto/rand" - "encoding/binary" - "hash" - - bloomfilter "github.com/holiman/bloomfilter/v2" "github.com/ava-labs/avalanchego/ids" + "github.com/ava-labs/avalanchego/utils/bloom" ) -var _ hash.Hash64 = (*hasher)(nil) - // NewBloomFilter returns a new instance of a bloom filter with at most // [maxExpectedElements] elements anticipated at any moment, and a false // positive probability of [falsePositiveProbability]. +// +// Invariant: The returned bloom filter is not safe to reset concurrently with +// other operations. However, it is otherwise safe to access concurrently. func NewBloomFilter( - maxExpectedElements uint64, + maxExpectedElements int, falsePositiveProbability float64, ) (*BloomFilter, error) { - bloom, err := bloomfilter.NewOptimal( + bloom, err := bloom.New(bloom.OptimalParameters( maxExpectedElements, falsePositiveProbability, - ) + )) if err != nil { return nil, err } @@ -38,7 +36,7 @@ func NewBloomFilter( } type BloomFilter struct { - bloom *bloomfilter.Filter + bloom *bloom.Filter // salt is provided to eventually unblock collisions in Bloom. It's possible // that conflicting Gossipable items collide in the bloom filter, so a salt // is generated to eventually resolve collisions. @@ -47,28 +45,21 @@ type BloomFilter struct { func (b *BloomFilter) Add(gossipable Gossipable) { h := gossipable.GossipID() - salted := &hasher{ - hash: h[:], - salt: b.salt, - } - b.bloom.Add(salted) + bloom.Add(b.bloom, h[:], b.salt[:]) } func (b *BloomFilter) Has(gossipable Gossipable) bool { h := gossipable.GossipID() - salted := &hasher{ - hash: h[:], - salt: b.salt, - } - return b.bloom.Contains(salted) + return bloom.Contains(b.bloom, h[:], b.salt[:]) } +// TODO: Remove error from the return func (b *BloomFilter) Marshal() ([]byte, []byte, error) { - bloomBytes, err := b.bloom.MarshalBinary() + bloomBytes := b.bloom.Marshal() // salt must be copied here to ensure the bytes aren't overwritten if salt // is later modified. salt := b.salt - return bloomBytes, salt[:], err + return bloomBytes, salt[:], nil } // ResetBloomFilterIfNeeded resets a bloom filter if it breaches a target false @@ -77,11 +68,15 @@ func ResetBloomFilterIfNeeded( bloomFilter *BloomFilter, falsePositiveProbability float64, ) (bool, error) { - if bloomFilter.bloom.FalsePosititveProbability() < falsePositiveProbability { + numHashes, numEntries := bloomFilter.bloom.Parameters() + // TODO: Precalculate maxCount, as it is independent of the current state + // of the bloom filter. + maxCount := bloom.EstimateCount(numHashes, numEntries, falsePositiveProbability) + if bloomFilter.bloom.Count() < maxCount { return false, nil } - newBloom, err := bloomfilter.New(bloomFilter.bloom.M(), bloomFilter.bloom.K()) + newBloom, err := bloom.New(numHashes, numEntries) if err != nil { return false, err } @@ -100,39 +95,3 @@ func randomSalt() (ids.ID, error) { _, err := rand.Read(salt[:]) return salt, err } - -type hasher struct { - hash []byte - salt ids.ID -} - -func (h *hasher) Write(p []byte) (n int, err error) { - h.hash = append(h.hash, p...) - return len(p), nil -} - -func (h *hasher) Sum(b []byte) []byte { - h.hash = append(h.hash, b...) - return h.hash -} - -func (h *hasher) Reset() { - h.hash = ids.Empty[:] -} - -func (*hasher) BlockSize() int { - return ids.IDLen -} - -func (h *hasher) Sum64() uint64 { - salted := ids.ID{} - for i := 0; i < len(h.hash) && i < ids.IDLen; i++ { - salted[i] = h.hash[i] ^ h.salt[i] - } - - return binary.BigEndian.Uint64(salted[:]) -} - -func (h *hasher) Size() int { - return len(h.hash) -} diff --git a/network/p2p/gossip/bloom_test.go b/network/p2p/gossip/bloom_test.go index 9eb06a6a2458..097fbecb608e 100644 --- a/network/p2p/gossip/bloom_test.go +++ b/network/p2p/gossip/bloom_test.go @@ -6,13 +6,12 @@ package gossip import ( "testing" - bloomfilter "github.com/holiman/bloomfilter/v2" - "github.com/stretchr/testify/require" "golang.org/x/exp/slices" "github.com/ava-labs/avalanchego/ids" + "github.com/ava-labs/avalanchego/utils/bloom" ) func TestBloomFilterRefresh(t *testing.T) { @@ -48,7 +47,7 @@ func TestBloomFilterRefresh(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { require := require.New(t) - b, err := bloomfilter.New(10, 1) + b, err := bloom.New(1, 10) require.NoError(err) bloom := BloomFilter{ bloom: b, @@ -69,8 +68,6 @@ func TestBloomFilterRefresh(t *testing.T) { require.Equal(initialSaltBytes, saltBytes) } - require.Equal(uint64(len(tt.expected)), bloom.bloom.N()) - for _, expected := range tt.expected { require.True(bloom.Has(expected)) } diff --git a/network/p2p/gossip/handler.go b/network/p2p/gossip/handler.go index 380b67ad2dc3..15ef1fe16684 100644 --- a/network/p2p/gossip/handler.go +++ b/network/p2p/gossip/handler.go @@ -8,8 +8,6 @@ import ( "fmt" "time" - bloomfilter "github.com/holiman/bloomfilter/v2" - "go.uber.org/zap" "google.golang.org/protobuf/proto" @@ -17,6 +15,7 @@ import ( "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/network/p2p" "github.com/ava-labs/avalanchego/proto/pb/sdk" + "github.com/ava-labs/avalanchego/utils/bloom" "github.com/ava-labs/avalanchego/utils/logging" ) @@ -62,19 +61,18 @@ func (h Handler[T]) AppRequest(_ context.Context, _ ids.NodeID, _ time.Time, req return nil, err } - filter := &BloomFilter{ - bloom: &bloomfilter.Filter{}, - salt: salt, - } - if err := filter.bloom.UnmarshalBinary(request.Filter); err != nil { + filter, err := bloom.Parse(request.Filter) + if err != nil { return nil, err } responseSize := 0 gossipBytes := make([][]byte, 0) h.set.Iterate(func(gossipable T) bool { + gossipID := gossipable.GossipID() + // filter out what the requesting peer already knows about - if filter.Has(gossipable) { + if bloom.Contains(filter, gossipID[:], salt[:]) { return true } diff --git a/proto/pb/sdk/sdk.pb.go b/proto/pb/sdk/sdk.pb.go index b828c4026d96..b90c23450270 100644 --- a/proto/pb/sdk/sdk.pb.go +++ b/proto/pb/sdk/sdk.pb.go @@ -25,8 +25,8 @@ type PullGossipRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Filter []byte `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"` Salt []byte `protobuf:"bytes,2,opt,name=salt,proto3" json:"salt,omitempty"` + Filter []byte `protobuf:"bytes,3,opt,name=filter,proto3" json:"filter,omitempty"` } func (x *PullGossipRequest) Reset() { @@ -61,16 +61,16 @@ func (*PullGossipRequest) Descriptor() ([]byte, []int) { return file_sdk_sdk_proto_rawDescGZIP(), []int{0} } -func (x *PullGossipRequest) GetFilter() []byte { +func (x *PullGossipRequest) GetSalt() []byte { if x != nil { - return x.Filter + return x.Salt } return nil } -func (x *PullGossipRequest) GetSalt() []byte { +func (x *PullGossipRequest) GetFilter() []byte { if x != nil { - return x.Salt + return x.Filter } return nil } @@ -173,20 +173,20 @@ var File_sdk_sdk_proto protoreflect.FileDescriptor var file_sdk_sdk_proto_rawDesc = []byte{ 0x0a, 0x0d, 0x73, 0x64, 0x6b, 0x2f, 0x73, 0x64, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x03, 0x73, 0x64, 0x6b, 0x22, 0x3f, 0x0a, 0x11, 0x50, 0x75, 0x6c, 0x6c, 0x47, 0x6f, 0x73, 0x73, - 0x69, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, - 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, - 0x72, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x61, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x04, 0x73, 0x61, 0x6c, 0x74, 0x22, 0x2c, 0x0a, 0x12, 0x50, 0x75, 0x6c, 0x6c, 0x47, 0x6f, 0x73, - 0x73, 0x69, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x67, - 0x6f, 0x73, 0x73, 0x69, 0x70, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x06, 0x67, 0x6f, 0x73, - 0x73, 0x69, 0x70, 0x22, 0x24, 0x0a, 0x0a, 0x50, 0x75, 0x73, 0x68, 0x47, 0x6f, 0x73, 0x73, 0x69, - 0x70, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0c, 0x52, 0x06, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x42, 0x2e, 0x5a, 0x2c, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x76, 0x61, 0x2d, 0x6c, 0x61, 0x62, 0x73, - 0x2f, 0x61, 0x76, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2f, 0x70, 0x62, 0x2f, 0x73, 0x64, 0x6b, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x03, 0x73, 0x64, 0x6b, 0x22, 0x45, 0x0a, 0x11, 0x50, 0x75, 0x6c, 0x6c, 0x47, 0x6f, 0x73, 0x73, + 0x69, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x61, 0x6c, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x73, 0x61, 0x6c, 0x74, 0x12, 0x16, 0x0a, + 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x66, + 0x69, 0x6c, 0x74, 0x65, 0x72, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x22, 0x2c, 0x0a, 0x12, 0x50, + 0x75, 0x6c, 0x6c, 0x47, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0c, 0x52, 0x06, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x22, 0x24, 0x0a, 0x0a, 0x50, 0x75, 0x73, + 0x68, 0x47, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x6f, 0x73, 0x73, 0x69, + 0x70, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x06, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x42, + 0x2e, 0x5a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x76, + 0x61, 0x2d, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x61, 0x76, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x68, 0x65, + 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x62, 0x2f, 0x73, 0x64, 0x6b, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/sdk/sdk.proto b/proto/sdk/sdk.proto index 6841cfb8b020..f42912391fe7 100644 --- a/proto/sdk/sdk.proto +++ b/proto/sdk/sdk.proto @@ -5,8 +5,10 @@ package sdk; option go_package = "github.com/ava-labs/avalanchego/proto/pb/sdk"; message PullGossipRequest { - bytes filter = 1; + // TODO: Remove reservation after v1.11.x activates. + reserved 1; bytes salt = 2; + bytes filter = 3; } message PullGossipResponse { diff --git a/pubsub/bloom/filter.go b/pubsub/bloom/filter.go new file mode 100644 index 000000000000..b0d023b51f19 --- /dev/null +++ b/pubsub/bloom/filter.go @@ -0,0 +1,51 @@ +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +package bloom + +import ( + "errors" + + "github.com/ava-labs/avalanchego/utils/bloom" +) + +const bytesPerHash = 8 + +var ( + _ Filter = (*filter)(nil) + + errMaxBytes = errors.New("too large") +) + +type Filter interface { + // Add adds to filter, assumed thread safe + Add(...[]byte) + + // Check checks filter, assumed thread safe + Check([]byte) bool +} + +func New(maxN int, p float64, maxBytes int) (Filter, error) { + numHashes, numEntries := bloom.OptimalParameters(maxN, p) + if neededBytes := 1 + numHashes*bytesPerHash + numEntries; neededBytes > maxBytes { + return nil, errMaxBytes + } + f, err := bloom.New(numHashes, numEntries) + return &filter{ + filter: f, + }, err +} + +type filter struct { + filter *bloom.Filter +} + +func (f *filter) Add(bl ...[]byte) { + for _, b := range bl { + bloom.Add(f.filter, b, nil) + } +} + +func (f *filter) Check(b []byte) bool { + return bloom.Contains(f.filter, b, nil) +} diff --git a/utils/bloom/bloom_filter_test.go b/pubsub/bloom/filter_test.go similarity index 81% rename from utils/bloom/bloom_filter_test.go rename to pubsub/bloom/filter_test.go index c28443d99912..3b2c4b71a59d 100644 --- a/utils/bloom/bloom_filter_test.go +++ b/pubsub/bloom/filter_test.go @@ -13,10 +13,10 @@ import ( func TestNew(t *testing.T) { var ( - require = require.New(t) - maxN uint64 = 10000 - p = 0.1 - maxBytes uint64 = 1 * units.MiB // 1 MiB + require = require.New(t) + maxN = 10000 + p = 0.1 + maxBytes = 1 * units.MiB // 1 MiB ) f, err := New(maxN, p, maxBytes) require.NoError(err) diff --git a/utils/bloom/map_filter.go b/pubsub/bloom/map_filter.go similarity index 100% rename from utils/bloom/map_filter.go rename to pubsub/bloom/map_filter.go diff --git a/pubsub/connection.go b/pubsub/connection.go index f5f471c64c08..901a33a25da3 100644 --- a/pubsub/connection.go +++ b/pubsub/connection.go @@ -14,7 +14,7 @@ import ( "go.uber.org/zap" - "github.com/ava-labs/avalanchego/utils/bloom" + "github.com/ava-labs/avalanchego/pubsub/bloom" ) var ( @@ -190,7 +190,7 @@ func (c *connection) handleNewBloom(cmd *NewBloom) error { if !cmd.IsParamsValid() { return ErrInvalidFilterParam } - filter, err := bloom.New(uint64(cmd.MaxElements), float64(cmd.CollisionProb), MaxBytes) + filter, err := bloom.New(int(cmd.MaxElements), float64(cmd.CollisionProb), MaxBytes) if err != nil { return fmt.Errorf("bloom filter creation failed %w", err) } diff --git a/pubsub/filter_param.go b/pubsub/filter_param.go index 1a1306c8d10d..5fd80a2ad706 100644 --- a/pubsub/filter_param.go +++ b/pubsub/filter_param.go @@ -6,7 +6,7 @@ package pubsub import ( "sync" - "github.com/ava-labs/avalanchego/utils/bloom" + "github.com/ava-labs/avalanchego/pubsub/bloom" "github.com/ava-labs/avalanchego/utils/set" ) diff --git a/pubsub/filter_test.go b/pubsub/filter_test.go index d32c3e87bdfd..3b47a38e0237 100644 --- a/pubsub/filter_test.go +++ b/pubsub/filter_test.go @@ -10,7 +10,7 @@ import ( "github.com/ava-labs/avalanchego/api" "github.com/ava-labs/avalanchego/ids" - "github.com/ava-labs/avalanchego/utils/bloom" + "github.com/ava-labs/avalanchego/pubsub/bloom" "github.com/ava-labs/avalanchego/utils/constants" "github.com/ava-labs/avalanchego/utils/formatting/address" ) diff --git a/utils/bloom/bloom_filter.go b/utils/bloom/bloom_filter.go deleted file mode 100644 index c4a0ff4c4ae8..000000000000 --- a/utils/bloom/bloom_filter.go +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - -package bloom - -import ( - "errors" - "sync" - - "github.com/spaolacci/murmur3" - - streakKnife "github.com/holiman/bloomfilter/v2" -) - -var errMaxBytes = errors.New("too large") - -type Filter interface { - // Add adds to filter, assumed thread safe - Add(...[]byte) - - // Check checks filter, assumed thread safe - Check([]byte) bool -} - -func New(maxN uint64, p float64, maxBytes uint64) (Filter, error) { - neededBytes := bytesSteakKnifeFilter(maxN, p) - if neededBytes > maxBytes { - return nil, errMaxBytes - } - return newSteakKnifeFilter(maxN, p) -} - -type steakKnifeFilter struct { - lock sync.RWMutex - filter *streakKnife.Filter -} - -func bytesSteakKnifeFilter(maxN uint64, p float64) uint64 { - m := streakKnife.OptimalM(maxN, p) - k := streakKnife.OptimalK(m, maxN) - - // This is pulled from bloomFilter.newBits and bloomfilter.newRandKeys. The - // calculation is the size of the bitset which would be created from this - // filter. - mSize := (m + 63) / 64 - totalSize := mSize + k - - return totalSize * 8 // 8 == sizeof(uint64)) -} - -func newSteakKnifeFilter(maxN uint64, p float64) (Filter, error) { - m := streakKnife.OptimalM(maxN, p) - k := streakKnife.OptimalK(m, maxN) - - filter, err := streakKnife.New(m, k) - return &steakKnifeFilter{filter: filter}, err -} - -func (f *steakKnifeFilter) Add(bl ...[]byte) { - f.lock.Lock() - defer f.lock.Unlock() - - for _, b := range bl { - h := murmur3.New64() - _, _ = h.Write(b) - f.filter.Add(h) - } -} - -func (f *steakKnifeFilter) Check(b []byte) bool { - f.lock.RLock() - defer f.lock.RUnlock() - - h := murmur3.New64() - _, _ = h.Write(b) - return f.filter.Contains(h) -} diff --git a/utils/bloom/filter.go b/utils/bloom/filter.go new file mode 100644 index 000000000000..569de80f1d1b --- /dev/null +++ b/utils/bloom/filter.go @@ -0,0 +1,151 @@ +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +package bloom + +import ( + "crypto/rand" + "encoding/binary" + "errors" + "fmt" + "math/bits" + "sync" +) + +const ( + minHashes = 1 + maxHashes = 16 // Supports a false positive probability of 2^-16 when using optimal size values + minEntries = 1 + + bitsPerByte = 8 + bytesPerUint64 = 8 + hashRotation = 17 +) + +var ( + errInvalidNumHashes = errors.New("invalid num hashes") + errTooFewHashes = errors.New("too few hashes") + errTooManyHashes = errors.New("too many hashes") + errTooFewEntries = errors.New("too few entries") +) + +type Filter struct { + // numBits is always equal to [bitsPerByte * len(entries)] + numBits uint64 + + lock sync.RWMutex + hashSeeds []uint64 + entries []byte + count int +} + +// New creates a new Filter with the specified number of hashes and bytes for +// entries. The returned bloom filter is safe for concurrent usage. +func New(numHashes, numEntries int) (*Filter, error) { + if numEntries < minEntries { + return nil, errTooFewEntries + } + + hashSeeds, err := newHashSeeds(numHashes) + if err != nil { + return nil, err + } + + return &Filter{ + numBits: uint64(numEntries * bitsPerByte), + hashSeeds: hashSeeds, + entries: make([]byte, numEntries), + count: 0, + }, nil +} + +// Parameters returns the [numHashes] and [numEntries] that were used when +// creating this filter. +func (f *Filter) Parameters() (int, int) { + return len(f.hashSeeds), len(f.entries) +} + +func (f *Filter) Add(hash uint64) { + f.lock.Lock() + defer f.lock.Unlock() + + for _, seed := range f.hashSeeds { + hash = bits.RotateLeft64(hash, hashRotation) ^ seed + index := hash % f.numBits + byteIndex := index / bitsPerByte + bitIndex := index % bitsPerByte + f.entries[byteIndex] |= 1 << bitIndex + } + f.count++ +} + +// Count returns the number of elements that have been added to the bloom +// filter. +func (f *Filter) Count() int { + f.lock.RLock() + defer f.lock.RUnlock() + + return f.count +} + +func (f *Filter) Contains(hash uint64) bool { + f.lock.RLock() + defer f.lock.RUnlock() + + return contains(f.hashSeeds, f.entries, hash) +} + +func (f *Filter) Marshal() []byte { + f.lock.RLock() + defer f.lock.RUnlock() + + return marshal(f.hashSeeds, f.entries) +} + +func newHashSeeds(count int) ([]uint64, error) { + switch { + case count < minHashes: + return nil, fmt.Errorf("%w: %d < %d", errTooFewHashes, count, minHashes) + case count > maxHashes: + return nil, fmt.Errorf("%w: %d > %d", errTooManyHashes, count, maxHashes) + } + + bytes := make([]byte, count*bytesPerUint64) + if _, err := rand.Reader.Read(bytes); err != nil { + return nil, err + } + + seeds := make([]uint64, count) + for i := range seeds { + seeds[i] = binary.BigEndian.Uint64(bytes[i*bytesPerUint64:]) + } + return seeds, nil +} + +func contains(hashSeeds []uint64, entries []byte, hash uint64) bool { + var ( + numBits = bitsPerByte * uint64(len(entries)) + accumulator byte = 1 + ) + for seedIndex := 0; seedIndex < len(hashSeeds) && accumulator != 0; seedIndex++ { + hash = bits.RotateLeft64(hash, hashRotation) ^ hashSeeds[seedIndex] + index := hash % numBits + byteIndex := index / bitsPerByte + bitIndex := index % bitsPerByte + accumulator &= entries[byteIndex] >> bitIndex + } + return accumulator != 0 +} + +func marshal(hashSeeds []uint64, entries []byte) []byte { + numHashes := len(hashSeeds) + entriesOffset := 1 + numHashes*bytesPerUint64 + + bytes := make([]byte, entriesOffset+len(entries)) + bytes[0] = byte(numHashes) + for i, seed := range hashSeeds { + binary.BigEndian.PutUint64(bytes[1+i*bytesPerUint64:], seed) + } + copy(bytes[entriesOffset:], entries) + return bytes +} diff --git a/utils/bloom/filter_test.go b/utils/bloom/filter_test.go new file mode 100644 index 000000000000..94e4b29d9bce --- /dev/null +++ b/utils/bloom/filter_test.go @@ -0,0 +1,100 @@ +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +package bloom + +import ( + "math/rand" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/ava-labs/avalanchego/utils/units" +) + +func TestNewErrors(t *testing.T) { + tests := []struct { + numHashes int + numEntries int + err error + }{ + { + numHashes: 0, + numEntries: 1, + err: errTooFewHashes, + }, + { + numHashes: 17, + numEntries: 1, + err: errTooManyHashes, + }, + { + numHashes: 8, + numEntries: 0, + err: errTooFewEntries, + }, + } + for _, test := range tests { + t.Run(test.err.Error(), func(t *testing.T) { + _, err := New(test.numHashes, test.numEntries) + require.ErrorIs(t, err, test.err) + }) + } +} + +func TestNormalUsage(t *testing.T) { + require := require.New(t) + + toAdd := make([]uint64, 1024) + for i := range toAdd { + toAdd[i] = rand.Uint64() //#nosec G404 + } + + initialNumHashes, initialNumBytes := OptimalParameters(1024, 0.01) + filter, err := New(initialNumHashes, initialNumBytes) + require.NoError(err) + + for i, elem := range toAdd { + filter.Add(elem) + for _, elem := range toAdd[:i] { + require.True(filter.Contains(elem)) + } + } + + require.Equal(len(toAdd), filter.Count()) + + numHashes, numEntries := filter.Parameters() + require.Equal(initialNumHashes, numHashes) + require.Equal(initialNumBytes, numEntries) + + filterBytes := filter.Marshal() + parsedFilter, err := Parse(filterBytes) + require.NoError(err) + + for _, elem := range toAdd { + require.True(parsedFilter.Contains(elem)) + } + + parsedFilterBytes := parsedFilter.Marshal() + require.Equal(filterBytes, parsedFilterBytes) +} + +func BenchmarkAdd(b *testing.B) { + f, err := New(8, 16*units.KiB) + require.NoError(b, err) + + b.ResetTimer() + for i := 0; i < b.N; i++ { + f.Add(1) + } +} + +func BenchmarkMarshal(b *testing.B) { + f, err := New(OptimalParameters(10_000, .01)) + require.NoError(b, err) + + b.ResetTimer() + for i := 0; i < b.N; i++ { + f.Marshal() + } +} diff --git a/utils/bloom/hasher.go b/utils/bloom/hasher.go new file mode 100644 index 000000000000..d5e3f5a6f5ec --- /dev/null +++ b/utils/bloom/hasher.go @@ -0,0 +1,31 @@ +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +package bloom + +import ( + "crypto/sha256" + "encoding/binary" +) + +func Add(f *Filter, key, salt []byte) { + f.Add(Hash(key, salt)) +} + +func Contains(c Checker, key, salt []byte) bool { + return c.Contains(Hash(key, salt)) +} + +type Checker interface { + Contains(hash uint64) bool +} + +func Hash(key, salt []byte) uint64 { + hash := sha256.New() + // sha256.Write never returns errors + _, _ = hash.Write(key) + _, _ = hash.Write(salt) + + output := make([]byte, 0, sha256.Size) + return binary.BigEndian.Uint64(hash.Sum(output)) +} diff --git a/utils/bloom/hasher_test.go b/utils/bloom/hasher_test.go new file mode 100644 index 000000000000..b262f1dbb5dc --- /dev/null +++ b/utils/bloom/hasher_test.go @@ -0,0 +1,34 @@ +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +package bloom + +import ( + "testing" + + "github.com/stretchr/testify/require" + + "github.com/ava-labs/avalanchego/ids" + "github.com/ava-labs/avalanchego/utils/units" +) + +func TestCollisionResistance(t *testing.T) { + require := require.New(t) + + f, err := New(8, 16*units.KiB) + require.NoError(err) + + Add(f, []byte("hello world?"), []byte("so salty")) + collision := Contains(f, []byte("hello world!"), []byte("so salty")) + require.False(collision) +} + +func BenchmarkHash(b *testing.B) { + key := ids.GenerateTestID() + salt := ids.GenerateTestID() + + b.ResetTimer() + for i := 0; i < b.N; i++ { + Hash(key[:], salt[:]) + } +} diff --git a/utils/bloom/optimal.go b/utils/bloom/optimal.go new file mode 100644 index 000000000000..fc434ca57987 --- /dev/null +++ b/utils/bloom/optimal.go @@ -0,0 +1,115 @@ +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +package bloom + +import ( + "math" + + safemath "github.com/ava-labs/avalanchego/utils/math" +) + +const ln2Squared = math.Ln2 * math.Ln2 + +// OptimalParameters calculates the optimal [numHashes] and [numEntries] that +// should be allocated for a bloom filter which will contain [count] and target +// [falsePositiveProbability]. +func OptimalParameters(count int, falsePositiveProbability float64) (int, int) { + numEntries := OptimalEntries(count, falsePositiveProbability) + numHashes := OptimalHashes(numEntries, count) + return numHashes, numEntries +} + +// OptimalHashes calculates the number of hashes which will minimize the false +// positive probability of a bloom filter with [numEntries] after [count] +// additions. +// +// It is guaranteed to return a value in the range [minHashes, maxHashes]. +// +// ref: https://en.wikipedia.org/wiki/Bloom_filter +func OptimalHashes(numEntries, count int) int { + switch { + case numEntries < minEntries: + return minHashes + case count <= 0: + return maxHashes + } + + numHashes := math.Ceil(float64(numEntries) * bitsPerByte * math.Ln2 / float64(count)) + // Converting a floating-point value to an int produces an undefined value + // if the floating-point value cannot be represented as an int. To avoid + // this undefined behavior, we explicitly check against MaxInt here. + // + // ref: https://go.dev/ref/spec#Conversions + if numHashes >= maxHashes { + return maxHashes + } + return safemath.Max(int(numHashes), minHashes) +} + +// OptimalEntries calculates the optimal number of entries to use when creating +// a new Bloom filter when targenting a size of [count] with +// [falsePositiveProbability] assuming that the optimal number of hashes is +// used. +// +// It is guaranteed to return a value in the range [minEntries, MaxInt]. +// +// ref: https://en.wikipedia.org/wiki/Bloom_filter +func OptimalEntries(count int, falsePositiveProbability float64) int { + switch { + case count <= 0: + return minEntries + case falsePositiveProbability >= 1: + return minEntries + case falsePositiveProbability <= 0: + return math.MaxInt + } + + entriesInBits := -float64(count) * math.Log(falsePositiveProbability) / ln2Squared + entries := (entriesInBits + bitsPerByte - 1) / bitsPerByte + // Converting a floating-point value to an int produces an undefined value + // if the floating-point value cannot be represented as an int. To avoid + // this undefined behavior, we explicitly check against MaxInt here. + // + // ref: https://go.dev/ref/spec#Conversions + if entries >= math.MaxInt { + return math.MaxInt + } + return safemath.Max(int(entries), minEntries) +} + +// EstimateCount estimates the number of additions a bloom filter with +// [numHashes] and [numEntries] must have to reach [falsePositiveProbability]. +// This is derived by inversing a lower-bound on the probability of false +// positives. For values where numBits >> numHashes, the predicted probability +// is fairly accurate. +// +// It is guaranteed to return a value in the range [0, MaxInt]. +// +// ref: https://tsapps.nist.gov/publication/get_pdf.cfm?pub_id=903775 +func EstimateCount(numHashes, numEntries int, falsePositiveProbability float64) int { + switch { + case numHashes < minHashes: + return 0 + case numEntries < minEntries: + return 0 + case falsePositiveProbability <= 0: + return 0 + case falsePositiveProbability >= 1: + return math.MaxInt + } + + invNumHashes := 1 / float64(numHashes) + numBits := float64(numEntries * 8) + exp := 1 - math.Pow(falsePositiveProbability, invNumHashes) + count := math.Ceil(-math.Log(exp) * numBits * invNumHashes) + // Converting a floating-point value to an int produces an undefined value + // if the floating-point value cannot be represented as an int. To avoid + // this undefined behavior, we explicitly check against MaxInt here. + // + // ref: https://go.dev/ref/spec#Conversions + if count >= math.MaxInt { + return math.MaxInt + } + return int(count) +} diff --git a/utils/bloom/optimal_test.go b/utils/bloom/optimal_test.go new file mode 100644 index 000000000000..b52356d5b307 --- /dev/null +++ b/utils/bloom/optimal_test.go @@ -0,0 +1,203 @@ +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +package bloom + +import ( + "fmt" + "math" + "testing" + + "github.com/stretchr/testify/require" +) + +const largestFloat64LessThan1 float64 = 1 - 1e-16 + +func TestOptimalHashes(t *testing.T) { + tests := []struct { + numEntries int + count int + expectedHashes int + }{ + { // invalid params + numEntries: 0, + count: 1024, + expectedHashes: minHashes, + }, + { // invalid params + numEntries: 1024, + count: 0, + expectedHashes: maxHashes, + }, + { + numEntries: math.MaxInt, + count: 1, + expectedHashes: maxHashes, + }, + { + numEntries: 1, + count: math.MaxInt, + expectedHashes: minHashes, + }, + { + numEntries: 1024, + count: 1024, + expectedHashes: 6, + }, + } + for _, test := range tests { + t.Run(fmt.Sprintf("%d_%d", test.numEntries, test.count), func(t *testing.T) { + hashes := OptimalHashes(test.numEntries, test.count) + require.Equal(t, test.expectedHashes, hashes) + }) + } +} + +func TestOptimalEntries(t *testing.T) { + tests := []struct { + count int + falsePositiveProbability float64 + expectedEntries int + }{ + { // invalid params + count: 0, + falsePositiveProbability: .5, + expectedEntries: minEntries, + }, + { // invalid params + count: 1, + falsePositiveProbability: 0, + expectedEntries: math.MaxInt, + }, + { // invalid params + count: 1, + falsePositiveProbability: 1, + expectedEntries: minEntries, + }, + { + count: math.MaxInt, + falsePositiveProbability: math.SmallestNonzeroFloat64, + expectedEntries: math.MaxInt, + }, + { + count: 1024, + falsePositiveProbability: largestFloat64LessThan1, + expectedEntries: minEntries, + }, + { + count: 1024, + falsePositiveProbability: .01, + expectedEntries: 1227, + }, + } + for _, test := range tests { + t.Run(fmt.Sprintf("%d_%f", test.count, test.falsePositiveProbability), func(t *testing.T) { + entries := OptimalEntries(test.count, test.falsePositiveProbability) + require.Equal(t, test.expectedEntries, entries) + }) + } +} + +func TestEstimateEntries(t *testing.T) { + tests := []struct { + numHashes int + numEntries int + falsePositiveProbability float64 + expectedEntries int + }{ + { // invalid params + numHashes: 0, + numEntries: 2_048, + falsePositiveProbability: .5, + expectedEntries: 0, + }, + { // invalid params + numHashes: 1, + numEntries: 0, + falsePositiveProbability: .5, + expectedEntries: 0, + }, + { // invalid params + numHashes: 1, + numEntries: 1, + falsePositiveProbability: 2, + expectedEntries: math.MaxInt, + }, + { // invalid params + numHashes: 1, + numEntries: 1, + falsePositiveProbability: -1, + expectedEntries: 0, + }, + { + numHashes: 8, + numEntries: 2_048, + falsePositiveProbability: 0, + expectedEntries: 0, + }, + { // params from OptimalParameters(10_000, .01) + numHashes: 7, + numEntries: 11_982, + falsePositiveProbability: .01, + expectedEntries: 9_993, + }, + { // params from OptimalParameters(100_000, .001) + numHashes: 10, + numEntries: 179_720, + falsePositiveProbability: .001, + expectedEntries: 100_000, + }, + { // params from OptimalParameters(10_000, .01) + numHashes: 7, + numEntries: 11_982, + falsePositiveProbability: .05, + expectedEntries: 14_449, + }, + { // params from OptimalParameters(10_000, .01) + numHashes: 7, + numEntries: 11_982, + falsePositiveProbability: 1, + expectedEntries: math.MaxInt, + }, + { // params from OptimalParameters(10_000, .01) + numHashes: 7, + numEntries: 11_982, + falsePositiveProbability: math.SmallestNonzeroFloat64, + expectedEntries: 0, + }, + { // params from OptimalParameters(10_000, .01) + numHashes: 7, + numEntries: 11_982, + falsePositiveProbability: largestFloat64LessThan1, + expectedEntries: math.MaxInt, + }, + } + for _, test := range tests { + t.Run(fmt.Sprintf("%d_%d_%f", test.numHashes, test.numEntries, test.falsePositiveProbability), func(t *testing.T) { + entries := EstimateCount(test.numHashes, test.numEntries, test.falsePositiveProbability) + require.Equal(t, test.expectedEntries, entries) + }) + } +} + +func FuzzOptimalHashes(f *testing.F) { + f.Fuzz(func(t *testing.T, numEntries, count int) { + hashes := OptimalHashes(numEntries, count) + require.GreaterOrEqual(t, hashes, minHashes) + require.LessOrEqual(t, hashes, maxHashes) + }) +} + +func FuzzOptimalEntries(f *testing.F) { + f.Fuzz(func(t *testing.T, count int, falsePositiveProbability float64) { + entries := OptimalEntries(count, falsePositiveProbability) + require.GreaterOrEqual(t, entries, minEntries) + }) +} + +func FuzzEstimateEntries(f *testing.F) { + f.Fuzz(func(t *testing.T, numHashes, numEntries int, falsePositiveProbability float64) { + entries := EstimateCount(numHashes, numEntries, falsePositiveProbability) + require.GreaterOrEqual(t, entries, 0) + }) +} diff --git a/utils/bloom/read_filter.go b/utils/bloom/read_filter.go new file mode 100644 index 000000000000..8c32e143b1c4 --- /dev/null +++ b/utils/bloom/read_filter.go @@ -0,0 +1,48 @@ +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +package bloom + +import ( + "encoding/binary" + "fmt" +) + +type ReadFilter struct { + hashSeeds []uint64 + entries []byte +} + +// Parse [bytes] into a read-only bloom filter. +func Parse(bytes []byte) (*ReadFilter, error) { + if len(bytes) == 0 { + return nil, errInvalidNumHashes + } + numHashes := bytes[0] + entriesOffset := 1 + int(numHashes)*bytesPerUint64 + switch { + case numHashes < minHashes: + return nil, fmt.Errorf("%w: %d < %d", errTooFewHashes, numHashes, minHashes) + case numHashes > maxHashes: + return nil, fmt.Errorf("%w: %d > %d", errTooManyHashes, numHashes, maxHashes) + case len(bytes) < entriesOffset+minEntries: // numEntries = len(bytes) - entriesOffset + return nil, errTooFewEntries + } + + f := &ReadFilter{ + hashSeeds: make([]uint64, numHashes), + entries: bytes[entriesOffset:], + } + for i := range f.hashSeeds { + f.hashSeeds[i] = binary.BigEndian.Uint64(bytes[1+i*bytesPerUint64:]) + } + return f, nil +} + +func (f *ReadFilter) Contains(hash uint64) bool { + return contains(f.hashSeeds, f.entries, hash) +} + +func (f *ReadFilter) Marshal() []byte { + return marshal(f.hashSeeds, f.entries) +} diff --git a/utils/bloom/read_filter_test.go b/utils/bloom/read_filter_test.go new file mode 100644 index 000000000000..8ea83db092ca --- /dev/null +++ b/utils/bloom/read_filter_test.go @@ -0,0 +1,112 @@ +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +package bloom + +import ( + "math" + "testing" + + "github.com/stretchr/testify/require" +) + +func NewMaliciousFilter(numHashes, numEntries int) *Filter { + f := &Filter{ + numBits: uint64(numEntries * bitsPerByte), + hashSeeds: make([]uint64, numHashes), + entries: make([]byte, numEntries), + count: 0, + } + for i := range f.entries { + f.entries[i] = math.MaxUint8 + } + return f +} + +func TestParseErrors(t *testing.T) { + tests := []struct { + bytes []byte + err error + }{ + { + bytes: nil, + err: errInvalidNumHashes, + }, + { + bytes: NewMaliciousFilter(0, 1).Marshal(), + err: errTooFewHashes, + }, + { + bytes: NewMaliciousFilter(17, 1).Marshal(), + err: errTooManyHashes, + }, + { + bytes: NewMaliciousFilter(1, 0).Marshal(), + err: errTooFewEntries, + }, + { + bytes: []byte{ + 0x01, // num hashes = 1 + }, + err: errTooFewEntries, + }, + } + for _, test := range tests { + t.Run(test.err.Error(), func(t *testing.T) { + _, err := Parse(test.bytes) + require.ErrorIs(t, err, test.err) + }) + } +} + +func BenchmarkParse(b *testing.B) { + f, err := New(OptimalParameters(10_000, .01)) + require.NoError(b, err) + bytes := f.Marshal() + + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, _ = Parse(bytes) + } +} + +func BenchmarkContains(b *testing.B) { + f := NewMaliciousFilter(maxHashes, 1) + + b.ResetTimer() + for i := 0; i < b.N; i++ { + f.Contains(1) + } +} + +func FuzzParseThenMarshal(f *testing.F) { + f.Fuzz(func(t *testing.T, bytes []byte) { + f, err := Parse(bytes) + if err != nil { + return + } + + marshalledBytes := marshal(f.hashSeeds, f.entries) + require.Equal(t, bytes, marshalledBytes) + }) +} + +func FuzzMarshalThenParse(f *testing.F) { + f.Fuzz(func(t *testing.T, numHashes int, entries []byte) { + require := require.New(t) + + hashSeeds, err := newHashSeeds(numHashes) + if err != nil { + return + } + if len(entries) < minEntries { + return + } + + marshalledBytes := marshal(hashSeeds, entries) + rf, err := Parse(marshalledBytes) + require.NoError(err) + require.Equal(hashSeeds, rf.hashSeeds) + require.Equal(entries, rf.entries) + }) +} diff --git a/vms/avm/network/config.go b/vms/avm/network/config.go index 8f54a20baf8a..8536504d8383 100644 --- a/vms/avm/network/config.go +++ b/vms/avm/network/config.go @@ -45,7 +45,7 @@ type Config struct { // ExpectedBloomFilterElements is the number of elements to expect when // creating a new bloom filter. The larger this number is, the larger the // bloom filter will be. - ExpectedBloomFilterElements uint64 `json:"expected-bloom-filter-elements"` + ExpectedBloomFilterElements int `json:"expected-bloom-filter-elements"` // ExpectedBloomFilterFalsePositiveProbability is the expected probability // of a false positive after having inserted ExpectedBloomFilterElements // into a bloom filter. The smaller this number is, the larger the bloom diff --git a/vms/avm/network/gossip.go b/vms/avm/network/gossip.go index ef3b53d039ec..c36195ff8870 100644 --- a/vms/avm/network/gossip.go +++ b/vms/avm/network/gossip.go @@ -64,7 +64,7 @@ func newGossipMempool( log logging.Logger, txVerifier TxVerifier, parser txs.Parser, - maxExpectedElements uint64, + maxExpectedElements int, falsePositiveProbability, maxFalsePositiveProbability float64, ) (*gossipMempool, error) { diff --git a/vms/platformvm/network/config.go b/vms/platformvm/network/config.go index 8f54a20baf8a..8536504d8383 100644 --- a/vms/platformvm/network/config.go +++ b/vms/platformvm/network/config.go @@ -45,7 +45,7 @@ type Config struct { // ExpectedBloomFilterElements is the number of elements to expect when // creating a new bloom filter. The larger this number is, the larger the // bloom filter will be. - ExpectedBloomFilterElements uint64 `json:"expected-bloom-filter-elements"` + ExpectedBloomFilterElements int `json:"expected-bloom-filter-elements"` // ExpectedBloomFilterFalsePositiveProbability is the expected probability // of a false positive after having inserted ExpectedBloomFilterElements // into a bloom filter. The smaller this number is, the larger the bloom diff --git a/vms/platformvm/network/gossip.go b/vms/platformvm/network/gossip.go index b2f409c75626..0bfc705bfd5a 100644 --- a/vms/platformvm/network/gossip.go +++ b/vms/platformvm/network/gossip.go @@ -61,7 +61,7 @@ func newGossipMempool( mempool mempool.Mempool, log logging.Logger, txVerifier TxVerifier, - maxExpectedElements uint64, + maxExpectedElements int, falsePositiveProbability float64, maxFalsePositiveProbability float64, ) (*gossipMempool, error) { From 718e306433d571fa7ebc7d99850ed993c7791d42 Mon Sep 17 00:00:00 2001 From: Stephen Buttolph Date: Tue, 9 Jan 2024 13:07:16 -0500 Subject: [PATCH 28/57] Remove TLS key gen from networking tests (#2596) --- network/certs_test.go | 39 +++++++++++++++++++++++++++++-- network/test_cert_1.crt | 27 +++++++++++++++++++++ network/test_cert_2.crt | 27 +++++++++++++++++++++ network/test_cert_3.crt | 27 +++++++++++++++++++++ network/test_key_1.key | 52 +++++++++++++++++++++++++++++++++++++++++ network/test_key_2.key | 52 +++++++++++++++++++++++++++++++++++++++++ network/test_key_3.key | 52 +++++++++++++++++++++++++++++++++++++++++ 7 files changed, 274 insertions(+), 2 deletions(-) create mode 100644 network/test_cert_1.crt create mode 100644 network/test_cert_2.crt create mode 100644 network/test_cert_3.crt create mode 100644 network/test_key_1.key create mode 100644 network/test_key_2.key create mode 100644 network/test_key_3.key diff --git a/network/certs_test.go b/network/certs_test.go index 483d6ea4eeee..7b59e11d800c 100644 --- a/network/certs_test.go +++ b/network/certs_test.go @@ -8,6 +8,8 @@ import ( "sync" "testing" + _ "embed" + "github.com/stretchr/testify/require" "github.com/ava-labs/avalanchego/ids" @@ -16,11 +18,42 @@ import ( ) var ( + //go:embed test_cert_1.crt + testCertBytes1 []byte + //go:embed test_key_1.key + testKeyBytes1 []byte + //go:embed test_cert_2.crt + testCertBytes2 []byte + //go:embed test_key_2.key + testKeyBytes2 []byte + //go:embed test_cert_3.crt + testCertBytes3 []byte + //go:embed test_key_3.key + testKeyBytes3 []byte + certLock sync.Mutex tlsCerts []*tls.Certificate tlsConfigs []*tls.Config ) +func init() { + cert1, err := staking.LoadTLSCertFromBytes(testKeyBytes1, testCertBytes1) + if err != nil { + panic(err) + } + cert2, err := staking.LoadTLSCertFromBytes(testKeyBytes2, testCertBytes2) + if err != nil { + panic(err) + } + cert3, err := staking.LoadTLSCertFromBytes(testKeyBytes3, testCertBytes3) + if err != nil { + panic(err) + } + tlsCerts = []*tls.Certificate{ + cert1, cert2, cert3, + } +} + func getTLS(t *testing.T, index int) (ids.NodeID, *tls.Certificate, *tls.Config) { certLock.Lock() defer certLock.Unlock() @@ -28,9 +61,11 @@ func getTLS(t *testing.T, index int) (ids.NodeID, *tls.Certificate, *tls.Config) for len(tlsCerts) <= index { cert, err := staking.NewTLSCert() require.NoError(t, err) - tlsConfig := peer.TLSConfig(*cert, nil) - tlsCerts = append(tlsCerts, cert) + } + for len(tlsConfigs) <= index { + cert := tlsCerts[len(tlsConfigs)] + tlsConfig := peer.TLSConfig(*cert, nil) tlsConfigs = append(tlsConfigs, tlsConfig) } diff --git a/network/test_cert_1.crt b/network/test_cert_1.crt new file mode 100644 index 000000000000..2f2b95e658ad --- /dev/null +++ b/network/test_cert_1.crt @@ -0,0 +1,27 @@ +-----BEGIN CERTIFICATE----- +MIIEnTCCAoWgAwIBAgIBADANBgkqhkiG9w0BAQsFADAAMCAXDTk5MTIzMTAwMDAw +MFoYDzIxMjQwMTA5MTQ0NTU4WjAAMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC +CgKCAgEAqCOUESK8b5N894dVCSIs4mTfNTdhaL5cnw3ZXSbZlfquBRJOxhqHXutG +An9++OTWvevrssaXBxGT4oOT3N11dm4iKh7ewi3to+1Sfqq71blCVZtBDOeWpZx0 +WwhPO37Us26fCR7T2gStiTHY9qE0QV/9p15OCAFsRb94JuhF0OR0d6tRm0yQ6b7Y +NRzpaBw4MBxZD9h84+QDdhsTyxI0xk/NnbG74pykjsau0/YA9mNqHHSnL4DyD5qu +IKqRfD5HQHemx66I3jEXUB/GxTHhxz5uskIpS9AV3oclvVi14BjSEWgNkJX+nMi+ +tjuSKouAFpzJZzZme2DvmyAecxbNVBdajOTe2QRiG7HKh1OdMZabd2dUNv5S9/gd +bI53s4R++z/H4llsBfk6B2+/DmqDRauh4Mz9HTf0Pud7Nz2b7r77PnPTjHExgN3R +i+Yo6LskRCQTzzTVwW/RY+rNVux9UE6ZPLarDbXnSyetKMUS7qlz8NUerWjtkC6i +om570LfTGs3GxIqVgoGg0mXuji+EoG+XpYR3PRaeo8cAmfEu7T+SxgSfJAv7DyZv ++a2VTZcOPDI1KTLrM8Xovy17t5rd9cy1/75vxnKLiGDEhzWJmNl4IvIYbtihWWl5 +ksdFYbe9Dpvuh/wBCGoK+kmCirUM1DiizWn5TxJeS1qYI8I2sYMCAwEAAaMgMB4w +DgYDVR0PAQH/BAQDAgSwMAwGA1UdEwEB/wQCMAAwDQYJKoZIhvcNAQELBQADggIB +AABzczRjzfhlmV+bFDzAs7nszQlZREcoRuWe5qHy7VKLvZvIAaYlcApB34hH7nDq +T/8fS8g8rC+Tzw0iCPF21Z4AzSe76V6EU4VGWWe8l00nDszfvavE5BF24z8dCuVC +1gScC1tvG6FPT23koZ0BVmyueCIa7sdqFlDz8rrRpLWfUcLj38gxwWM2JVBHQUvV +j87lzpTNH+2nPiwrKISqUPFi4YvbWKe8T4bY2Elw7THiNLZGfgqOXVkeIVi4fs97 +Tc5uscZ4OpSTlrfJqMJEV8cMRvrDmhD/VWbJvnk7lyELPoHx6MUinBswBT51yvmY +bZh4AZ43GSvSyo/V7p9scytQP3zM1MeHpsFa0RHwGVFp2BmO1abvydAxX0NMWasv +WUzXCKliXsVD/qUeCU/CFnaBqpzBvm4AFBgwHzprwzP9Be/mz/TjTcsfrmoiyxlr +QjXNk9TnP9d+aeOJsRz+JSYyHETACO5PkCg+XCDyEOf+kQAzVb9Dp0oWaCovXciU +A5z0DSDzyKVBOQo0syb5NFsLZ2DeJemNbP+3kCNzBBASQ4VWAvRbLjPh3Oe8A5PZ +xezCvzRE05O6tYkz5C5hcKbpAjfP8G8RV6ERjLBICBfb7XI7T0hixhiNHlIKknkJ +F82B/zDt+qBFARw8A/qr44RF+vy3Ql4IS2ZcflAv2pTO +-----END CERTIFICATE----- diff --git a/network/test_cert_2.crt b/network/test_cert_2.crt new file mode 100644 index 000000000000..283e286be446 --- /dev/null +++ b/network/test_cert_2.crt @@ -0,0 +1,27 @@ +-----BEGIN CERTIFICATE----- +MIIEnTCCAoWgAwIBAgIBADANBgkqhkiG9w0BAQsFADAAMCAXDTk5MTIzMTAwMDAw +MFoYDzIxMjQwMTA5MTQ0NTQ3WjAAMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC +CgKCAgEArT7afarml6cvCmAySAO8GQka1mcQIMACyEWy6KsqiccX+DoGh5ECyQSa +WFKWKGdQ32dAWGVlSkmmgJ1jtW749hSguysav3EPMaxe/ad5CV1MwyyccGS9U99M +z0UVuFEXVjN5W6UlcULp1oJDj07NzZP6ByRiDvnjzgeYb3jHwjqOBNwex1jLW6vp +oWD03zTanVQXZaaGcEISCI2CgDP3uXfd0NQpoGVpf9gMi0cdGu8gpqbLqBjzjzr8 +GDBQYGaWKFnlqe6X9nBUad/qNE3Zeb3ehSg+M2ecQzTZFWirfa6cGTtovu04RMML +9OLflQy3rTRST2HQ6z0gpVCP3V2Mg/LmAuWyhOLVYNkhEwkRHvddzFksRzQ+ghpP +cGfvI0dwxQV0CbEMVjd9zVEA6dOrMLI3st2922hqF23Al1+Hwcu1G/T3ybfSTwjd +YZ23IgkQF4r+RIXevzgOBBXfEwE8XERW2zNwUG5Sv5dxx+FgDjX0EGbrzgY6OeKT +D1SP/7WQLjwmGgwyNJYkAklvEKwU+dlGD5NpgvJ9fg8R1wUhp2HhSZ1l1OUVmRYw +YqUm7dTLK1CJU2BH2sRyZcUkwstjvgi688zfHNttGYmAnx6wGS12jWf+W4df+QNI +Ng6AdcJ5Ee0z0JAbTpZW/zX3CTSroow7igHnd4AwvKEVQFcyO/MCAwEAAaMgMB4w +DgYDVR0PAQH/BAQDAgSwMAwGA1UdEwEB/wQCMAAwDQYJKoZIhvcNAQELBQADggIB +ACePaZvjw2KiheheWNjzOv2B+7uLVe7oEbThEUQypEmTFK8wKaHwI4BGdBGEOr/N +LZ1M2wAYgwzMTEDJE+GEB2ZHIdH9cH5lu7ITsOMVcBSJttEJVhhEtbMwVJ9JC62j +AsW4VmHFpEik+xvinxedKczXOa21YJo4sv2TiFWFaSHqPeRo7HA1dxQYOwiLsS6e +JKIupMrn8IZz2YN5gFhbvQTBp2J3u6kxMIzN0a+BPARR4fwMn5lVMVvye/+8Kwtw +dZHSN1FYUcFqHagmhNlNkAOaGQklSFWtsVVQxQCFS2bxEImLj5kG16fCAsQoRC0J +ZS2OaRncrtB0r0Qu1JB5XJP9FLflSb57KIxBNVrl+iWdWikgBFE6cMthMwgLfQ99 +k8AMp6KrCjcxqegN+P30ct/JwahKPq2+SwtdHG3yrZ2TJEjhOtersrTnRK9zqm9v +lqS7JsiztjgqnhMs2eTdXygfEe0AoZihGTaaLYj37A9+2RECkuijkjBghG2NBnv6 +264lTghZyZcZgZNCgYglYC1bhifEorJpYf6TOOcDAi5UH8R7vi4x70vI6sIDrhga +d9E63EVe11QdIjceceMlNm42UTrhl0epMbL6FIzU+d91qBgd9qT6YqoYPFZSiYFy +2hArgLxH2fxTXatCAit5g1MEk0w1MiHVrPZ8lTU3U/ET +-----END CERTIFICATE----- diff --git a/network/test_cert_3.crt b/network/test_cert_3.crt new file mode 100644 index 000000000000..c0977191ec7b --- /dev/null +++ b/network/test_cert_3.crt @@ -0,0 +1,27 @@ +-----BEGIN CERTIFICATE----- +MIIEnTCCAoWgAwIBAgIBADANBgkqhkiG9w0BAQsFADAAMCAXDTk5MTIzMTAwMDAw +MFoYDzIxMjQwMTA5MTQ0NTM0WjAAMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC +CgKCAgEA5aV76ivIZ1iWmW0OzGMCrmFQBnej9JntQ1jP9yiacKu7j5Z/bD/eqoyc +jRwoSiesErfnThAGy7H80glVw/XmC0fYNPVDPyzAEdNk46M3yEI8hAKI6aSkl1s1 +KVAHpQuNcG+3xIB39OOMx0XuycZ6gqzyMmjqeT0cThNDXTwGbodMVDAf0q220QAq +zB/lz0sjHPXlYh25LJ1yPtl+vlcfGrP+q+2ODR9rnI79PE7AZB4Xc6wUIca5XXkH +PS7zQ1Ida1xrf446MYCVuazLFhpzq8/nhkxNMzxdZsJaWavL+xkpjGxAySvj0jlu +QFGsmsxOIU/XgJD/VRqqyISXpl2wg0l8mpsU9fV7bEW1y6MIc7AARRgbbEPiDz8m +/O8mjEW3C16untLHB7LzPCCitTssGR65Shkj+Lw+aM4X5ZI+Xm8eHTRCek8T5Cl3 +Sm2UFkLk2mun6cwoyWWhwi6+EfW6ks0c7qSHtJTP8DgLrWxYmBuD9PKSHclpa4/5 +toj52YnT6fIBJWz5ggIdntRCaH8+0eWvwuvDsdPUL7JQFjJmfQOdMenlNqW2aEvx ++JZiYLJBWj9cjpI33P5CAfFEVM3IFlDHmMHRTQ/kKLcfvSDfuofEBoMt4tjf01Um +dfi8kFKWl9ba9I7CoQ13U4J1wkk6KxatZP7eGCmKRoq8w+Y38NsCAwEAAaMgMB4w +DgYDVR0PAQH/BAQDAgSwMAwGA1UdEwEB/wQCMAAwDQYJKoZIhvcNAQELBQADggIB +AKsvbN5/r4YPguetl+jIhqpr4TZM8GNZRGTqkKC8clRspBeihJqkNQWsnZiFkJTH +NhNAx+7tlJHqeGdojc2XjBAkc+//qYqXKHgihsO54bVG9oN9IPO+mpPumRRhGneH +jTUE/hLFqwA4ZPw5L1HtJ0m1yqg/HXf4aBXcVQ/YO8YN17ZgLpueYt+Chi1pP/Ku +TzHuoKuHst2T6uuZQZxcD+XJoXwdOt7mfPTh5y9/Psjn+qx833DNWSwF3O/lEghA +2yOb+5CFta2LLUHH894oj5SvgJ/5cvn4+NbyDCUv5ebvE98BMh72PLNRuIRV0gfO +XalMIZ+9Jm2TGXD0dWt9GeZ5z3h+nCEB6s3x0sqluaWG3lTUx+4T/aIxdGuvPFi6 +7DWm7TG7yxFGfbECyyXXL+B/gyHhE1Q93nE3wK9flSG+ljqFJS+8wytht52XhgwE +lV1AwHgxkbkFzNIwB0s7etR9+wBcQvFKqeCZrDeG1twKNcY1dv1D/OCUlBYJvL/X +YADeT2ZjFzHhWhv6TLVEAtqytT1o4qXh6VWeIrwfMG0VcQSiJyNxwO/aW5BOTM44 +EelDzvSjo/pRxqN/m44Iuf0Ran86DO7LmjNYh/04FN3oaL9cFIaT9BWXt/Xx2Fdw ++dg5bPSJ62ExVnnNRlY9lQECkSoRZK2epcICs+3YmmGX +-----END CERTIFICATE----- diff --git a/network/test_key_1.key b/network/test_key_1.key new file mode 100644 index 000000000000..c49775114d66 --- /dev/null +++ b/network/test_key_1.key @@ -0,0 +1,52 @@ +-----BEGIN PRIVATE KEY----- +MIIJQwIBADANBgkqhkiG9w0BAQEFAASCCS0wggkpAgEAAoICAQCoI5QRIrxvk3z3 +h1UJIiziZN81N2FovlyfDdldJtmV+q4FEk7GGode60YCf3745Na96+uyxpcHEZPi +g5Pc3XV2biIqHt7CLe2j7VJ+qrvVuUJVm0EM55alnHRbCE87ftSzbp8JHtPaBK2J +Mdj2oTRBX/2nXk4IAWxFv3gm6EXQ5HR3q1GbTJDpvtg1HOloHDgwHFkP2Hzj5AN2 +GxPLEjTGT82dsbvinKSOxq7T9gD2Y2ocdKcvgPIPmq4gqpF8PkdAd6bHrojeMRdQ +H8bFMeHHPm6yQilL0BXehyW9WLXgGNIRaA2Qlf6cyL62O5Iqi4AWnMlnNmZ7YO+b +IB5zFs1UF1qM5N7ZBGIbscqHU50xlpt3Z1Q2/lL3+B1sjnezhH77P8fiWWwF+ToH +b78OaoNFq6HgzP0dN/Q+53s3PZvuvvs+c9OMcTGA3dGL5ijouyREJBPPNNXBb9Fj +6s1W7H1QTpk8tqsNtedLJ60oxRLuqXPw1R6taO2QLqKibnvQt9MazcbEipWCgaDS +Ze6OL4Sgb5elhHc9Fp6jxwCZ8S7tP5LGBJ8kC/sPJm/5rZVNlw48MjUpMuszxei/ +LXu3mt31zLX/vm/GcouIYMSHNYmY2Xgi8hhu2KFZaXmSx0Vht70Om+6H/AEIagr6 +SYKKtQzUOKLNaflPEl5LWpgjwjaxgwIDAQABAoICAHGe8U0PGyWPFlCzLDyq0of+ +wHNWxEWi9jYphqyTN1BJgVU+BOuMO9RhywKfI6+P/KmFBtbdqmuFblkQr1f+c4Uf +cYjjKYcwwDkZg7jDKYGI2pG9A51z1nJ9oodtuxUqZRQH+gKQyXq31Ik0nTg0wXo4 +ItH6QWLZi1AqzkgEiEFcUHQZ2mDGwdqjM7nYmsXW5AVm8qxpkCP0Dn6+V4bP+8fT +X9BjreK6Fd3B15y2zfmyPp+SGPRZ/7mZvnemq/+4mi+va43enPEBXY6wmoLhbYBV +6ToeyYdIy65/x3oHu4f/Xd2TYi9FnTRX18CPyvtjH6CoPNW5hlFztRcwAkOlsgQ7 +sZ+9FGAnRvz1lrBg80DeCHeSKVkDHmMQSINhPcPnlMJpxn6iiZjdvz/Bd+9RRqZl +xUI/lV3/Wueh8SeCQlFOj3fHBZEaq6QoC/VmmaeIiLEm1hj+ymuFxwOtA6AKWLb3 +59XnEkONeTfv9d2eQ7NOPU86n/zhWHUKodmBUEaxLDaUwRkS1Adb4rLuRwrMfn3a +2KkknYWzvyrlk8lDqKAMeQneFmpresGAXeIn0vt434eaGcK4a/IZ8PebuhZxGq1Z +bVbxVm0AsLmd9X3htR6MOiZswnVmA3JCw1AMKZpLMDRSbjV0uYuhBJQsN4Y/kyOK +l52JtymFNvbuRF+836+RAoIBAQDZ9wyihmgsEPLl7PHzfYo4pnTs1puoT5PS7GjO +iVm7UtOKaawsJxKX3cxzSFVXONs9hbPPzmsQEL3Xz+lUsgrSeXReF00KLRbfE2LM +dv9hlJVMQXEKnEkFYNNgETyZIJE3ZDDqdd2PDzNM8aKHlvLYREiETCwVn7r4x5QE +jIHC0gUjRJHqUgSdAMa+qvranPLxVV9mpJmL2RXjjb/OtJosFef9h5augSNI9tPS +EDLm4wMjyXr25Vu20/cusmTlOhCzi2d23hNHx8nPE0nCEVtZ2rnnWyH/ozqRnpXX +EPh0IeZQmebBhHWzkjIPaOa05Ua5rkVAQau8/FUUubjXytyZAoIBAQDFerIQwodP +V46WVC0LtSq4ju88x1vgDfT0NFE3H6hIX7Mc91zt0NGOhzv4crfjnoj+romNfQwD +0ymtudnnoaGPFBRrRF8T+26jfFpes7Ve5q/PpY78zJH1ZLwyKKX4dzgeY0Aj9FbO +q4dzh21oD7wyknRm0NTqOvgLAuxoBFZ4FTgudKNDzGymgIaQVT1+h0226og289WT +iptkpOZ/HcxQts2U3j3a87pJB0IFjIrBTtVqIyphdwRVDa929WGDITUPHa3aqykx +Ma/zvXvocAlIDITVwxXlS16DkSS+5jdN/CUj5h0O6FefGaJmk6/bFQIeXM4fRhRF +M0cs1mxXkNR7AoIBAQCFxYftn4wDr4tD7f44sE3Kou6UBMqXq+9PvmQ8jjOSMi0+ +f8h5eKmCp0+5WSV3WJ/FzG8lFMzEmWHKOAI+Rt85ee0fajGQE0g8NMuoLUhjfSt8 +F5XnKy/tqxVPmoSUflZhpo4W96u5B1021f4oNU5pyM6w04ci5lt8IBEKEan6Bae9 +k3HyW9AVA8r2bj1zOmwoDXt1pYPPPraeZ/rWRCVy9SbihPrHst4TA9nQzLxQ0/az +Wg6rxOxa8xB7imU+AjsJ1n7zhyxSG54SBwZ3outr5D/AbEAbgvSJNslDq1iw/bU6 +tpnXHxKV2R38MyeU0jpr7zb1Tti2Li+RfsKhPhHRAoIBAHfbpXH4r6mfaeKiCokd +l2VXE6tfEMtnjTIfAuAjLb9nnk3JcTTCVj5cpDCCaEwV7+4sPz6KFB3KL3TK5Y/q +ESXHOTF12QNGyvsdQbhS+JU2DKVKRgP3oetADd2fwESTD5OaB9cKuRlNELQ1EVlk +m4RSUaYJwAC+c8gzKQtk/pp5vpSrpGBFFfjk70dxBRbjxm5r4OsBibK4IOKwF1o1 +2sluek6NqRtYbMtgRVka2SjE0VFPMKzhUNbSrJnWCy5MnGilSdz7n8/E6ZdVfXwx +a+C4AHPBqWt3GFFgad4X2p9Rl7U3OJHQwUXGiEQcBVNCZ/vHti9TGIB7xApZxn5L +YDsCggEBAJ8RhrfEzm2YkyODFKFwgOszHQ3TNSvbC4+yLOUMSdzdKIyroOq0t53A +PSs046TINd+EDs9Pi6E69C+RYLim1NYMHeHFMzmKnQPXPwJVnYYUKInbIMURcuE9 +8FNBSKg3SUGz31SwG4bRIkJluMUp5oSAEUxWaxbUzLYkZex2uxnUGSd6TjddWKk1 ++SuoiZ3+W6yPWWh7TDKAR/oukBCmLIJI7dXSwv2DhagRpppdoMfqcnsCAgs/omB8 +Ku4y/jEkGbxLgo3Qd6U1o/QZlZG+9Q0iaxQS4dIpMxA3LwrL5txy00bm3JeWMB4H +MUZqfFgfj8ESxFBEeToOwr3Jq46vOwQ= +-----END PRIVATE KEY----- diff --git a/network/test_key_2.key b/network/test_key_2.key new file mode 100644 index 000000000000..bcc0a192b2b4 --- /dev/null +++ b/network/test_key_2.key @@ -0,0 +1,52 @@ +-----BEGIN PRIVATE KEY----- +MIIJQwIBADANBgkqhkiG9w0BAQEFAASCCS0wggkpAgEAAoICAQCtPtp9quaXpy8K +YDJIA7wZCRrWZxAgwALIRbLoqyqJxxf4OgaHkQLJBJpYUpYoZ1DfZ0BYZWVKSaaA +nWO1bvj2FKC7Kxq/cQ8xrF79p3kJXUzDLJxwZL1T30zPRRW4URdWM3lbpSVxQunW +gkOPTs3Nk/oHJGIO+ePOB5hveMfCOo4E3B7HWMtbq+mhYPTfNNqdVBdlpoZwQhII +jYKAM/e5d93Q1CmgZWl/2AyLRx0a7yCmpsuoGPOPOvwYMFBgZpYoWeWp7pf2cFRp +3+o0Tdl5vd6FKD4zZ5xDNNkVaKt9rpwZO2i+7ThEwwv04t+VDLetNFJPYdDrPSCl +UI/dXYyD8uYC5bKE4tVg2SETCREe913MWSxHND6CGk9wZ+8jR3DFBXQJsQxWN33N +UQDp06swsjey3b3baGoXbcCXX4fBy7Ub9PfJt9JPCN1hnbciCRAXiv5Ehd6/OA4E +Fd8TATxcRFbbM3BQblK/l3HH4WAONfQQZuvOBjo54pMPVI//tZAuPCYaDDI0liQC +SW8QrBT52UYPk2mC8n1+DxHXBSGnYeFJnWXU5RWZFjBipSbt1MsrUIlTYEfaxHJl +xSTCy2O+CLrzzN8c220ZiYCfHrAZLXaNZ/5bh1/5A0g2DoB1wnkR7TPQkBtOllb/ +NfcJNKuijDuKAed3gDC8oRVAVzI78wIDAQABAoICAQCIgPu7BMuINoyUClPT9k1h +FJF22eIVS/VlQ7XCKgvsX1j9lwrKCnI9XUkXyorR7wYD4OEMRWhX7kwpDtoffP7h +NkOm9kGvEjA8nWqDRk/SFxeCuUXSMS4URd/JeM+yWQKgQxKeKTOlWGnTQPRmmFsE +XlIlCn/Q+QiLr+RmAK601VpNbfs6azZgVsZRB4opzQVr7XQ5/cnz7bszzfxDc67/ +DflSr7jUztMfjmXj3/aI4F3DsazKGE7gTkOP85GBQ5OQ27Rf/sTxwnRgr7Nj3us6 +R2ZrWNgZvMudEKjze3OUJd6M6wiPV258j4p+O7ybPlgDOzSXo6TvlUyBtUaFz04E +5S7bgimNUxEjFzTxkn9W/FTUeauvJcgDk+JmMZ+I9dFdMIuyksndywN9KdXBVxZH +1ZtO1P6JeFpxF7zQUmkH+/6RZd9PbQGlpNI06nAj98LVwqSDCO1aejLqoXYs9zqG +DOU4JdRm3qK0eshIghkvVOWIYhqKPkskQfbTFY+hasg82cGGFyzxqOsSiuW+CVIy +3iF3WyfKgvLMABoK/38zutsMT+/mOtA7rjErh1NJuwwWkkglmuwQMDqaWdOASs+v +MK8JjSi6zDpnbp70Prw5pUlHvvsD1iYWo7SOcpFos+U5zw1jHJJvnAatzcXWixuu +Xzbn2BtCqSFigW7waMy14QKCAQEAx/Nwy2xH9lVGfz8aO2CB0FGL9Ra3Jcv4HFJT +nw6/yvVLvRAwr87+/c+qbIzwLKbQXV/4vmNsqPrIJiazY+Tk739DjcW8YaMbejfr +ASPHtYbeF0FmVbxBHNZ/JSDSYUXdFZ7JlBiDSs3zhPlFBZYG2tU3JJZCR8+9J/Ss +JEIwL9UlapMznMwljFkLbvZ2oFstKkfdY61WxROOIwuGaKr0yRnNvMMp135JiB/O +dwh/NfROt4JzQ5O4ipMg6Wc73+OvBsOSQHYZQHl9NOaK1uomu5bUY7H8pLwGU7sw +LmPRzrGiu8dB+UUEyFkNI2xzwkjet+0UGupDyOfsCMf9hlzWmwKCAQEA3c8FeHkl +Il4GEB0VEw1NtC5x6i+s3NiPOlUmH+nOHgdaI7/BfljfTokQBGo+GkXkJ36yTEMh +L9Vtya3HtW4VEHNfPMjntPztn4XQvMZdSpu/k8rM44m+CB0DDLhFfwRr2cyUAwHz +xebXw8KhceqaWRp6ygJGx5Sk0gr7s7nhmIByjdx4tddEH/MahLklGdV7Vnp+yb3o +zNLVx/aDueknArgUb/zvZRcYWuNoGs9ac4pl0m6jan/x0ZcdBF0SU2bI6ltvF3WT +qwcvVnbJbBwq5PRuL4ZUqrqmXBbBAkpLJTx+kfPKD4bgcZTBnV2TxDbzze9CeieT +YCtg4u+khW7ZiQKCAQBrMIEuPD0TvEFPo8dvP1w4Dg9Gc0f5li/LFwNHCIQezIMu +togzJ3ehHvuQt7llZoPbGsDhZ7FvoQk9EpAmpCVqksHnNbK4cNUhHur3sHO2R7e1 +pdSzb3lEeWStxbuic+6CUZ5kqwNvTZsXlP3Acd344EZwcbDUiHQyAENsKKNmcRBe +4szPaM1UQMQVV0De1CIRQXdYoSsb+VDATsReRg9140Rcxg8fO881jz+CpmZzySWN +0PvzpTRP7XG+Th5V9tv0d1FnByigXMCXZGPXtKzQ8ZmoXFlBAp8tsfKxW8e005uW +qMogVDStJrgZXmFsLN5goVKe3yk5gcMSLgwmRIyzAoIBAQCoE6CkmsAd27uiaDc4 ++aLA/1TIzZmiu+NEo5NBKY1LyexvHHZGBJgqTcg6YDtw8zchCmuXSGMUeRk5cxrb +C3Cgx5wKVn7l8acqc18qPPIigATavBkn7o92XG2cLOJUjogfQVuDL+6GLxeeupRV +2x1cmakj/DegMq32j+YNWbRuOB8WClPaDyYLQ877dcR8X/2XGTmMLAEFfFoMrWtB +7D/oWo76EWNiae7FqH6RmkCDPwNLQxVHtW4LkQOm89PYKRHkLKbw0uKz/bzMOzUE +XA/Q8Lux/YuY19kJ/SACWUO6Eq4icObTfzQCPWO9mFRJog57JWttXyHZBOXk8Qzt +I4NpAoIBACurK0zJxaGUdTjmzaVipauyOZYFBsbzvCWsdSNodtZ/mw6n/qkj2N33 +vNCRLrsQAkDKATzWrscRg+xvl5/wIa4B3s8TZNIp3hL7bvI/NoR5bi5M0vcjdXEd +DeKeZsSBzEs5zivM3aWEF5MSR2zpJPNYyD0PnT6EvZOkMoq6LM3FJcouS1ChePLQ +wHEY5ZMqPODOcQ+EixNXl6FGdywaJYxKnG4liG9zdJ0lGNIivTA7gyM+JCbG4fs8 +73uGsbCpts5Y2xKFp3uK8HjWKbOCR3dE4mOZM8M/NlsUGNjSydXZMIJYWR8nvVmo +i3mHicYaTQxj0ruIz7JHOtFNVGi1sME= +-----END PRIVATE KEY----- diff --git a/network/test_key_3.key b/network/test_key_3.key new file mode 100644 index 000000000000..2cef238b67a9 --- /dev/null +++ b/network/test_key_3.key @@ -0,0 +1,52 @@ +-----BEGIN PRIVATE KEY----- +MIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQDlpXvqK8hnWJaZ +bQ7MYwKuYVAGd6P0me1DWM/3KJpwq7uPln9sP96qjJyNHChKJ6wSt+dOEAbLsfzS +CVXD9eYLR9g09UM/LMAR02TjozfIQjyEAojppKSXWzUpUAelC41wb7fEgHf044zH +Re7JxnqCrPIyaOp5PRxOE0NdPAZuh0xUMB/SrbbRACrMH+XPSyMc9eViHbksnXI+ +2X6+Vx8as/6r7Y4NH2ucjv08TsBkHhdzrBQhxrldeQc9LvNDUh1rXGt/jjoxgJW5 +rMsWGnOrz+eGTE0zPF1mwlpZq8v7GSmMbEDJK+PSOW5AUayazE4hT9eAkP9VGqrI +hJemXbCDSXyamxT19XtsRbXLowhzsABFGBtsQ+IPPyb87yaMRbcLXq6e0scHsvM8 +IKK1OywZHrlKGSP4vD5ozhflkj5ebx4dNEJ6TxPkKXdKbZQWQuTaa6fpzCjJZaHC +Lr4R9bqSzRzupIe0lM/wOAutbFiYG4P08pIdyWlrj/m2iPnZidPp8gElbPmCAh2e +1EJofz7R5a/C68Ox09QvslAWMmZ9A50x6eU2pbZoS/H4lmJgskFaP1yOkjfc/kIB +8URUzcgWUMeYwdFND+Qotx+9IN+6h8QGgy3i2N/TVSZ1+LyQUpaX1tr0jsKhDXdT +gnXCSTorFq1k/t4YKYpGirzD5jfw2wIDAQABAoICAQC/Rt32h29NvTj7JB5OWS2z +h3R7Xo2ev9Mi5EecSyKQNEpuZ+FMjcpubd47nrdkRLULhkhP+gNfCKpXW9Um+psY +zEemnJ7dcO2uK1B+VsWwtJLpNZ9KVIuPUjXuai1j6EJv423Ca2r++8WXeYVSZVJH +o7u8By09vIvl8B+M+eE1kNYfzVHETlLWtHfxO6RTy/a8OYhM+ArzwVSWStxJuBE9 +Ua0PETffcEtWxLbi04lmGrZX7315QKfG1ncUHBYc/blpYjpbrWCFON/9HpKtn2y3 +L91dPBKVWXNGkx1kUTb+t8+mmchAh6Ejyhgt1Jma+g8dqf4KpTs3bJXRnLcfqCvL +Kq+wCUGv7iVWlTmhlzLpneajLDdBxGfbkAgwPFOyZoJNrnh6hU60TPc1IV6YSLlB +GsxesK9QWUrg3BAN4iKD3FvDt0qeUPbPztxEZi1OzSYQDZUQBrBL+WHuD9NxeAYe +2yx1OlPMo73gK5GW/MHBCz77+NX2kVURlTvYW4TsmInCRvOTsVNkRPUJtiHYT7Ss +Y8SzS5F/u9sfjFAVowGgwtNfq8Rm6Q1QdPZltiUNBgiTekFNQEy7WhzVg6MlT5Ca +BRqUhN3+CFwxLZ9rSQL6gxfAHk9umb0ee4JU9JgcYjtb5AtyE6DmmcSZPSejjxit +HwZ/g5MDK7kk5fKMcnL7kQKCAQEA895z7T0c6y3rhWfEUMDdTlsPgAoxYNf+jXyJ +aQmtfnDP9tf8BdPpobfHp29e7JRaGGa9QWPaaemBPHXMmD+IegG9/E+PQdHQwFSG +OpI13uCBULt8a+MMUbTCg1V4uXqf2j1BUo9SFQ6aXh/Rg1gVBgsq1M6eyvel93io +0X+/cinsDEpB5HENZwBuRb0SP0RfCgQR9Yh+jIy2TwJDDNw3sG1TvIo9aK7blSwB +z/gwSDx1UUa2KReD4ChYcqgLFUj3F/uF2f20P/JuaUn7tU3HoCsbG0C+Cci/XSJ9 +gu8xYl64Vg16bO3CflqjucPTFXgyBOt0lIug77YYa9CgCUJvEwKCAQEA8RHqGghV +meDnRXvPmAEwtoT7IKBe+eYjGN6wc2o+QZzjeUFkyfOtaB8rqriUXqvihD2GD6XQ +O/cSNCqp5g6yUhBLo3b9BmCsQsvxkhMpwB/hdi5aYjn+CFQVD4rAso9yGwRBWoA0 +gQdGMKenOUhU/PtVKyTTUuY7rFD8RhYq0ZLqEgO7chn8QXCNPo7MfE/qF9vQBosP +ktiS0FG442PJp2B/lYKK6N2w77ZeCoLhQowaNN0/N36kX/n4bjBE2XFLNpSuHtlg +C7bV/RMR5i/3yB0eRVUDVlqC077qlC1w0tCNZvvi6kbWwIu/4pQTdcA8mAz5B7Lc +OwOMbA2GT4OIGQKCAQABoyS0Gwzup0hFhQTUZfcWZ5YbDfZ25/xVhtiFVANOLgO3 +bIvMnjebVliIzz6b6AMS1t2+aqU0wNSVS1UsUIDiENDtuLsFfhsgr3CXRBQIgwlb +OWcEcmnKwqPrrc85r5ETLgYaP8wVSBvRNfV6JEU/3SNUem6mfjMnDjBT97+ZTJ7B +Fl6K4hds8ZvL7BELS7I3pv9X3qq61tcCgMlidLgK/zDouyTeZw4iWkFI3Cm20nEX +MppWfEnuX1b4rhgk9HB0QMQNSp7DLyV+n3iJJxSIBsIP1Mdx2V8viOO+1UxHlMs4 +CK8hvBbqMkGXJbFtG3l6fvoxZR6XfWl8j9IDPebxAoIBAF07cnBy/LgwdQE4awb8 +ntxX/c+WdmTrjnNV3KQmWMGDba49jj9UkKIOPBMgo7EhhM9kA+8VT72BRncKcP7a +fDikuLwVjrHivXxv55N4+dKmAcp1DtuiVg7ehe6m2PO16olsUeIwZx3ntEuo61GK +GeRlR4ESEvCivj1cbNSmShUXXpNtAheU2Sxt3RJuo8MIHR7xEjkVmwZN4CnVEU5Q +D3M+LNmjzRlWc9GhlCk4iOn1yUTctFBAGE5OHLhwzo/R8ya+xcCEjVK6eXQQ5gFC +V+/64vQpdsr04lgGJC7+i/3cTnOfwxicIP4CjkmQvx3xJP4hNka189qW+r3nVSR3 +WDECggEAAQCCqF4J8C2keY+o/kYQBq0tHhrC28HgiVQuCGc4XruYQtDh4di/I72F +RsvgVHS29ApAlh29i29ws7K2bU6WIc+JR3nmwAHUtiJmxRZhn/c722AvRXF5YMH/ +u46bEURHF5sGz8vr5chX/R4LiF579xyNsB9KC3mPqdjW/L6ACQdrBJVAS9cwplO0 +D+YWxmCE1Ps2tQtz6ZN+LUC7WO6M24k8KW2y4Scue0/23uCllWFgS3/vxDdQDZWn ++7AvMYPh4Wrfdd0t0cU+c9rirFYVz+uo/QBUIZOIw64AvIUjZpHTbhcjz1mAqcgJ +eAOQk+OFUTNKeI9uJwoNYOguHsxt2w== +-----END PRIVATE KEY----- From b25c2472dbf1c23eda92d9adffd12cf6596d2ff8 Mon Sep 17 00:00:00 2001 From: Patrick O'Grady Date: Wed, 10 Jan 2024 12:08:00 +0100 Subject: [PATCH 29/57] [utils/bloom] Optionally Update Bloom Filter Size on Reset (#2591) Co-authored-by: Stephen Buttolph --- go.mod | 3 +- go.sum | 6 +- network/p2p/gossip/bloom.go | 64 ++++++++++++++-------- network/p2p/gossip/bloom_test.go | 55 ++++++++++++++----- network/p2p/gossip/gossip.go | 6 +- network/p2p/gossip/gossip_test.go | 6 +- network/p2p/gossip/gossipable.go | 2 +- network/p2p/gossip/test_gossip.go | 2 +- utils/bloom/filter.go | 6 -- utils/bloom/filter_test.go | 4 -- vms/avm/network/gossip.go | 34 ++++++------ vms/avm/network/network_test.go | 3 + vms/avm/txs/mempool/mempool.go | 10 ++++ vms/avm/txs/mempool/mock_mempool.go | 14 +++++ vms/platformvm/network/gossip.go | 30 +++++----- vms/platformvm/network/gossip_test.go | 1 + vms/platformvm/network/network_test.go | 2 + vms/platformvm/txs/mempool/mempool.go | 10 ++++ vms/platformvm/txs/mempool/mock_mempool.go | 14 +++++ 19 files changed, 177 insertions(+), 95 deletions(-) diff --git a/go.mod b/go.mod index f557f64cca62..5f2bea429f7b 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/DataDog/zstd v1.5.2 github.com/Microsoft/go-winio v0.5.2 github.com/NYTimes/gziphandler v1.1.1 - github.com/ava-labs/coreth v0.12.10-rc.4 + github.com/ava-labs/coreth v0.12.10-rc.5 github.com/ava-labs/ledger-avalanche/go v0.0.0-20231102202641-ae2ebdaeac34 github.com/btcsuite/btcd/btcutil v1.1.3 github.com/cockroachdb/pebble v0.0.0-20230209160836-829675f94811 @@ -107,7 +107,6 @@ require ( github.com/hashicorp/go-bexpr v0.1.10 // indirect github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect github.com/hashicorp/hcl v1.0.0 // indirect - github.com/holiman/big v0.0.0-20221017200358-a027dc42d04e // indirect github.com/holiman/bloomfilter/v2 v2.0.3 // indirect github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect diff --git a/go.sum b/go.sum index 743661fe7ee6..489a6ee12e1d 100644 --- a/go.sum +++ b/go.sum @@ -66,8 +66,8 @@ github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/ava-labs/coreth v0.12.10-rc.4 h1:+Ll3cpi3tZbw37lTa+1a/VnPa7xZktpbAFiuKtDKnIE= -github.com/ava-labs/coreth v0.12.10-rc.4/go.mod h1:8pt5LW6MP/luIdhQA+gvs8LobKE8tP/5APXUiFbfb2c= +github.com/ava-labs/coreth v0.12.10-rc.5 h1:FMVvXHssvMQ3Eade7i85Wsx9tuD3kUOFMG8ktHeDTp8= +github.com/ava-labs/coreth v0.12.10-rc.5/go.mod h1:a58HbIBc9jscGc3aL8e7JuG8RfhBBOm63waq1q0YM+U= github.com/ava-labs/ledger-avalanche/go v0.0.0-20231102202641-ae2ebdaeac34 h1:mg9Uw6oZFJKytJxgxnl3uxZOs/SB8CVHg6Io4Tf99Zc= github.com/ava-labs/ledger-avalanche/go v0.0.0-20231102202641-ae2ebdaeac34/go.mod h1:pJxaT9bUgeRNVmNRgtCHb7sFDIRKy7CzTQVi8gGNT6g= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= @@ -353,8 +353,6 @@ github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuW github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/holiman/big v0.0.0-20221017200358-a027dc42d04e h1:pIYdhNkDh+YENVNi3gto8n9hAmRxKxoar0iE6BLucjw= -github.com/holiman/big v0.0.0-20221017200358-a027dc42d04e/go.mod h1:j9cQbcqHQujT0oKJ38PylVfqohClLr3CvDC+Qcg+lhU= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c h1:DZfsyhDK1hnSS5lH8l+JggqzEleHteTYfutAiVlSUM8= diff --git a/network/p2p/gossip/bloom.go b/network/p2p/gossip/bloom.go index 9553c22c3692..5c477826c9b6 100644 --- a/network/p2p/gossip/bloom.go +++ b/network/p2p/gossip/bloom.go @@ -8,35 +8,48 @@ import ( "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/utils/bloom" + "github.com/ava-labs/avalanchego/utils/math" ) -// NewBloomFilter returns a new instance of a bloom filter with at most -// [maxExpectedElements] elements anticipated at any moment, and a false -// positive probability of [falsePositiveProbability]. +// NewBloomFilter returns a new instance of a bloom filter with at least [minTargetElements] elements +// anticipated at any moment, and a false positive probability of [targetFalsePositiveProbability]. If the +// false positive probability exceeds [resetFalsePositiveProbability], the bloom filter will be reset. // // Invariant: The returned bloom filter is not safe to reset concurrently with // other operations. However, it is otherwise safe to access concurrently. func NewBloomFilter( - maxExpectedElements int, - falsePositiveProbability float64, + minTargetElements int, + targetFalsePositiveProbability, + resetFalsePositiveProbability float64, ) (*BloomFilter, error) { - bloom, err := bloom.New(bloom.OptimalParameters( - maxExpectedElements, - falsePositiveProbability, - )) + numHashes, numEntries := bloom.OptimalParameters( + minTargetElements, + targetFalsePositiveProbability, + ) + b, err := bloom.New(numHashes, numEntries) if err != nil { return nil, err } salt, err := randomSalt() return &BloomFilter{ - bloom: bloom, - salt: salt, + minTargetElements: minTargetElements, + targetFalsePositiveProbability: targetFalsePositiveProbability, + resetFalsePositiveProbability: resetFalsePositiveProbability, + + maxCount: bloom.EstimateCount(numHashes, numEntries, resetFalsePositiveProbability), + bloom: b, + salt: salt, }, err } type BloomFilter struct { - bloom *bloom.Filter + minTargetElements int + targetFalsePositiveProbability float64 + resetFalsePositiveProbability float64 + + maxCount int + bloom *bloom.Filter // salt is provided to eventually unblock collisions in Bloom. It's possible // that conflicting Gossipable items collide in the bloom filter, so a salt // is generated to eventually resolve collisions. @@ -53,29 +66,32 @@ func (b *BloomFilter) Has(gossipable Gossipable) bool { return bloom.Contains(b.bloom, h[:], b.salt[:]) } -// TODO: Remove error from the return -func (b *BloomFilter) Marshal() ([]byte, []byte, error) { +func (b *BloomFilter) Marshal() ([]byte, []byte) { bloomBytes := b.bloom.Marshal() // salt must be copied here to ensure the bytes aren't overwritten if salt // is later modified. salt := b.salt - return bloomBytes, salt[:], nil + return bloomBytes, salt[:] } -// ResetBloomFilterIfNeeded resets a bloom filter if it breaches a target false -// positive probability. Returns true if the bloom filter was reset. +// ResetBloomFilterIfNeeded resets a bloom filter if it breaches [targetFalsePositiveProbability]. +// +// If [targetElements] exceeds [minTargetElements], the size of the bloom filter will grow to maintain +// the same [targetFalsePositiveProbability]. +// +// Returns true if the bloom filter was reset. func ResetBloomFilterIfNeeded( bloomFilter *BloomFilter, - falsePositiveProbability float64, + targetElements int, ) (bool, error) { - numHashes, numEntries := bloomFilter.bloom.Parameters() - // TODO: Precalculate maxCount, as it is independent of the current state - // of the bloom filter. - maxCount := bloom.EstimateCount(numHashes, numEntries, falsePositiveProbability) - if bloomFilter.bloom.Count() < maxCount { + if bloomFilter.bloom.Count() <= bloomFilter.maxCount { return false, nil } + numHashes, numEntries := bloom.OptimalParameters( + math.Max(bloomFilter.minTargetElements, targetElements), + bloomFilter.targetFalsePositiveProbability, + ) newBloom, err := bloom.New(numHashes, numEntries) if err != nil { return false, err @@ -84,7 +100,7 @@ func ResetBloomFilterIfNeeded( if err != nil { return false, err } - + bloomFilter.maxCount = bloom.EstimateCount(numHashes, numEntries, bloomFilter.resetFalsePositiveProbability) bloomFilter.bloom = newBloom bloomFilter.salt = salt return true, nil diff --git a/network/p2p/gossip/bloom_test.go b/network/p2p/gossip/bloom_test.go index 097fbecb608e..128ea97824c0 100644 --- a/network/p2p/gossip/bloom_test.go +++ b/network/p2p/gossip/bloom_test.go @@ -16,30 +16,44 @@ import ( func TestBloomFilterRefresh(t *testing.T) { tests := []struct { - name string - falsePositiveProbability float64 - add []*testTx - expected []*testTx + name string + minTargetElements int + targetFalsePositiveProbability float64 + resetFalsePositiveProbability float64 + reset bool + add []*testTx + expected []*testTx }{ { - name: "no refresh", - falsePositiveProbability: 1, + name: "no refresh", + minTargetElements: 1, + targetFalsePositiveProbability: 0.01, + resetFalsePositiveProbability: 1, + reset: false, // maxCount = 9223372036854775807 add: []*testTx{ {id: ids.ID{0}}, + {id: ids.ID{1}}, + {id: ids.ID{2}}, }, expected: []*testTx{ {id: ids.ID{0}}, + {id: ids.ID{1}}, + {id: ids.ID{2}}, }, }, { - name: "refresh", - falsePositiveProbability: 0.1, + name: "refresh", + minTargetElements: 1, + targetFalsePositiveProbability: 0.01, + resetFalsePositiveProbability: 0.0000000000000001, // maxCount = 1 + reset: true, add: []*testTx{ {id: ids.ID{0}}, {id: ids.ID{1}}, + {id: ids.ID{2}}, }, expected: []*testTx{ - {id: ids.ID{1}}, + {id: ids.ID{2}}, }, }, } @@ -47,27 +61,38 @@ func TestBloomFilterRefresh(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { require := require.New(t) - b, err := bloom.New(1, 10) + numHashes, numEntries := bloom.OptimalParameters( + tt.minTargetElements, + tt.targetFalsePositiveProbability, + ) + b, err := bloom.New(numHashes, numEntries) require.NoError(err) bloom := BloomFilter{ - bloom: b, + bloom: b, + maxCount: bloom.EstimateCount(numHashes, numEntries, tt.resetFalsePositiveProbability), + minTargetElements: tt.minTargetElements, + targetFalsePositiveProbability: tt.targetFalsePositiveProbability, + resetFalsePositiveProbability: tt.resetFalsePositiveProbability, } + var didReset bool for _, item := range tt.add { - bloomBytes, saltBytes, err := bloom.Marshal() - require.NoError(err) - + bloomBytes, saltBytes := bloom.Marshal() initialBloomBytes := slices.Clone(bloomBytes) initialSaltBytes := slices.Clone(saltBytes) - _, err = ResetBloomFilterIfNeeded(&bloom, tt.falsePositiveProbability) + reset, err := ResetBloomFilterIfNeeded(&bloom, len(tt.add)) require.NoError(err) + if reset { + didReset = reset + } bloom.Add(item) require.Equal(initialBloomBytes, bloomBytes) require.Equal(initialSaltBytes, saltBytes) } + require.Equal(tt.reset, didReset) for _, expected := range tt.expected { require.True(bloom.Has(expected)) } diff --git a/network/p2p/gossip/gossip.go b/network/p2p/gossip/gossip.go index dfeb50d201a1..97e90e6e99af 100644 --- a/network/p2p/gossip/gossip.go +++ b/network/p2p/gossip/gossip.go @@ -151,11 +151,7 @@ type PullGossiper[T Gossipable] struct { } func (p *PullGossiper[_]) Gossip(ctx context.Context) error { - bloom, salt, err := p.set.GetFilter() - if err != nil { - return err - } - + bloom, salt := p.set.GetFilter() request := &sdk.PullGossipRequest{ Filter: bloom, Salt: salt, diff --git a/network/p2p/gossip/gossip_test.go b/network/p2p/gossip/gossip_test.go index 94387ebd9420..1c0941bd7eba 100644 --- a/network/p2p/gossip/gossip_test.go +++ b/network/p2p/gossip/gossip_test.go @@ -111,7 +111,7 @@ func TestGossiperGossip(t *testing.T) { responseNetwork, err := p2p.NewNetwork(logging.NoLog{}, responseSender, prometheus.NewRegistry(), "") require.NoError(err) - responseBloom, err := NewBloomFilter(1000, 0.01) + responseBloom, err := NewBloomFilter(1000, 0.01, 0.05) require.NoError(err) responseSet := &testSet{ txs: make(map[ids.ID]*testTx), @@ -143,7 +143,7 @@ func TestGossiperGossip(t *testing.T) { require.NoError(err) require.NoError(requestNetwork.Connected(context.Background(), ids.EmptyNodeID, nil)) - bloom, err := NewBloomFilter(1000, 0.01) + bloom, err := NewBloomFilter(1000, 0.01, 0.05) require.NoError(err) requestSet := &testSet{ txs: make(map[ids.ID]*testTx), @@ -365,7 +365,7 @@ func TestPushGossipE2E(t *testing.T) { knownTx := &testTx{id: ids.GenerateTestID()} log := logging.NoLog{} - bloom, err := NewBloomFilter(100, 0.01) + bloom, err := NewBloomFilter(100, 0.01, 0.05) require.NoError(err) set := &testSet{ txs: make(map[ids.ID]*testTx), diff --git a/network/p2p/gossip/gossipable.go b/network/p2p/gossip/gossipable.go index a204c465720d..238c62b4641c 100644 --- a/network/p2p/gossip/gossipable.go +++ b/network/p2p/gossip/gossipable.go @@ -25,5 +25,5 @@ type Set[T Gossipable] interface { Iterate(f func(gossipable T) bool) // GetFilter returns the byte representation of bloom filter and its // corresponding salt. - GetFilter() (bloom []byte, salt []byte, err error) + GetFilter() (bloom []byte, salt []byte) } diff --git a/network/p2p/gossip/test_gossip.go b/network/p2p/gossip/test_gossip.go index f903693c8054..03098399462e 100644 --- a/network/p2p/gossip/test_gossip.go +++ b/network/p2p/gossip/test_gossip.go @@ -64,6 +64,6 @@ func (t *testSet) Iterate(f func(gossipable *testTx) bool) { } } -func (t *testSet) GetFilter() ([]byte, []byte, error) { +func (t *testSet) GetFilter() ([]byte, []byte) { return t.bloom.Marshal() } diff --git a/utils/bloom/filter.go b/utils/bloom/filter.go index 569de80f1d1b..761ebfad12e1 100644 --- a/utils/bloom/filter.go +++ b/utils/bloom/filter.go @@ -59,12 +59,6 @@ func New(numHashes, numEntries int) (*Filter, error) { }, nil } -// Parameters returns the [numHashes] and [numEntries] that were used when -// creating this filter. -func (f *Filter) Parameters() (int, int) { - return len(f.hashSeeds), len(f.entries) -} - func (f *Filter) Add(hash uint64) { f.lock.Lock() defer f.lock.Unlock() diff --git a/utils/bloom/filter_test.go b/utils/bloom/filter_test.go index 94e4b29d9bce..856797f8ab50 100644 --- a/utils/bloom/filter_test.go +++ b/utils/bloom/filter_test.go @@ -63,10 +63,6 @@ func TestNormalUsage(t *testing.T) { require.Equal(len(toAdd), filter.Count()) - numHashes, numEntries := filter.Parameters() - require.Equal(initialNumHashes, numHashes) - require.Equal(initialNumBytes, numEntries) - filterBytes := filter.Marshal() parsedFilter, err := Parse(filterBytes) require.NoError(err) diff --git a/vms/avm/network/gossip.go b/vms/avm/network/gossip.go index c36195ff8870..adfe9aa6831f 100644 --- a/vms/avm/network/gossip.go +++ b/vms/avm/network/gossip.go @@ -23,6 +23,10 @@ var ( _ gossip.Marshaller[*txs.Tx] = (*txParser)(nil) ) +// bloomChurnMultiplier is the number used to multiply the size of the mempool +// to determine how large of a bloom filter to create. +const bloomChurnMultiplier = 3 + // txGossipHandler is the handler called when serving gossip messages type txGossipHandler struct { p2p.NoOpHandler @@ -64,27 +68,25 @@ func newGossipMempool( log logging.Logger, txVerifier TxVerifier, parser txs.Parser, - maxExpectedElements int, - falsePositiveProbability, - maxFalsePositiveProbability float64, + minTargetElements int, + targetFalsePositiveProbability, + resetFalsePositiveProbability float64, ) (*gossipMempool, error) { - bloom, err := gossip.NewBloomFilter(maxExpectedElements, falsePositiveProbability) + bloom, err := gossip.NewBloomFilter(minTargetElements, targetFalsePositiveProbability, resetFalsePositiveProbability) return &gossipMempool{ - Mempool: mempool, - log: log, - txVerifier: txVerifier, - parser: parser, - maxFalsePositiveProbability: maxFalsePositiveProbability, - bloom: bloom, + Mempool: mempool, + log: log, + txVerifier: txVerifier, + parser: parser, + bloom: bloom, }, err } type gossipMempool struct { mempool.Mempool - log logging.Logger - txVerifier TxVerifier - parser txs.Parser - maxFalsePositiveProbability float64 + log logging.Logger + txVerifier TxVerifier + parser txs.Parser lock sync.RWMutex bloom *gossip.BloomFilter @@ -127,7 +129,7 @@ func (g *gossipMempool) AddVerified(tx *txs.Tx) error { defer g.lock.Unlock() g.bloom.Add(tx) - reset, err := gossip.ResetBloomFilterIfNeeded(g.bloom, g.maxFalsePositiveProbability) + reset, err := gossip.ResetBloomFilterIfNeeded(g.bloom, g.Mempool.Len()*bloomChurnMultiplier) if err != nil { return err } @@ -148,7 +150,7 @@ func (g *gossipMempool) Iterate(f func(*txs.Tx) bool) { g.Mempool.Iterate(f) } -func (g *gossipMempool) GetFilter() (bloom []byte, salt []byte, err error) { +func (g *gossipMempool) GetFilter() (bloom []byte, salt []byte) { g.lock.RLock() defer g.lock.RUnlock() diff --git a/vms/avm/network/network_test.go b/vms/avm/network/network_test.go index f5b45f8a6aae..da66dff9b2ac 100644 --- a/vms/avm/network/network_test.go +++ b/vms/avm/network/network_test.go @@ -165,6 +165,7 @@ func TestNetworkAppGossip(t *testing.T) { mempool.EXPECT().Get(gomock.Any()).Return(nil, false) mempool.EXPECT().GetDropReason(gomock.Any()).Return(nil) mempool.EXPECT().Add(gomock.Any()).Return(nil) + mempool.EXPECT().Len().Return(0) mempool.EXPECT().RequestBuildBlock() return mempool }, @@ -303,6 +304,7 @@ func TestNetworkIssueTx(t *testing.T) { mempool.EXPECT().Get(gomock.Any()).Return(nil, false) mempool.EXPECT().GetDropReason(gomock.Any()).Return(nil) mempool.EXPECT().Add(gomock.Any()).Return(nil) + mempool.EXPECT().Len().Return(0) mempool.EXPECT().RequestBuildBlock() return mempool }, @@ -398,6 +400,7 @@ func TestNetworkIssueVerifiedTx(t *testing.T) { mempoolFunc: func(ctrl *gomock.Controller) mempool.Mempool { mempool := mempool.NewMockMempool(ctrl) mempool.EXPECT().Add(gomock.Any()).Return(nil) + mempool.EXPECT().Len().Return(0) mempool.EXPECT().RequestBuildBlock() return mempool }, diff --git a/vms/avm/txs/mempool/mempool.go b/vms/avm/txs/mempool/mempool.go index d5030cbce648..4ac275a21305 100644 --- a/vms/avm/txs/mempool/mempool.go +++ b/vms/avm/txs/mempool/mempool.go @@ -63,6 +63,9 @@ type Mempool interface { // unissued. This allows previously dropped txs to be possibly reissued. MarkDropped(txID ids.ID, reason error) GetDropReason(txID ids.ID) error + + // Len returns the number of txs in the mempool. + Len() int } type mempool struct { @@ -233,3 +236,10 @@ func (m *mempool) GetDropReason(txID ids.ID) error { err, _ := m.droppedTxIDs.Get(txID) return err } + +func (m *mempool) Len() int { + m.lock.RLock() + defer m.lock.RUnlock() + + return m.unissuedTxs.Len() +} diff --git a/vms/avm/txs/mempool/mock_mempool.go b/vms/avm/txs/mempool/mock_mempool.go index b94d2db095bf..c82758bac51f 100644 --- a/vms/avm/txs/mempool/mock_mempool.go +++ b/vms/avm/txs/mempool/mock_mempool.go @@ -90,6 +90,20 @@ func (mr *MockMempoolMockRecorder) Iterate(arg0 interface{}) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Iterate", reflect.TypeOf((*MockMempool)(nil).Iterate), arg0) } +// Len mocks base method. +func (m *MockMempool) Len() int { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Len") + ret0, _ := ret[0].(int) + return ret0 +} + +// Len indicates an expected call of Len. +func (mr *MockMempoolMockRecorder) Len() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Len", reflect.TypeOf((*MockMempool)(nil).Len)) +} + // MarkDropped mocks base method. func (m *MockMempool) MarkDropped(arg0 ids.ID, arg1 error) { m.ctrl.T.Helper() diff --git a/vms/platformvm/network/gossip.go b/vms/platformvm/network/gossip.go index 0bfc705bfd5a..fa40567430f7 100644 --- a/vms/platformvm/network/gossip.go +++ b/vms/platformvm/network/gossip.go @@ -23,6 +23,10 @@ var ( _ gossip.Gossipable = (*txs.Tx)(nil) ) +// bloomChurnMultiplier is the number used to multiply the size of the mempool +// to determine how large of a bloom filter to create. +const bloomChurnMultiplier = 3 + // txGossipHandler is the handler called when serving gossip messages type txGossipHandler struct { p2p.NoOpHandler @@ -61,25 +65,23 @@ func newGossipMempool( mempool mempool.Mempool, log logging.Logger, txVerifier TxVerifier, - maxExpectedElements int, - falsePositiveProbability float64, - maxFalsePositiveProbability float64, + minTargetElements int, + targetFalsePositiveProbability, + resetFalsePositiveProbability float64, ) (*gossipMempool, error) { - bloom, err := gossip.NewBloomFilter(maxExpectedElements, falsePositiveProbability) + bloom, err := gossip.NewBloomFilter(minTargetElements, targetFalsePositiveProbability, resetFalsePositiveProbability) return &gossipMempool{ - Mempool: mempool, - log: log, - txVerifier: txVerifier, - bloom: bloom, - maxFalsePositiveProbability: maxFalsePositiveProbability, + Mempool: mempool, + log: log, + txVerifier: txVerifier, + bloom: bloom, }, err } type gossipMempool struct { mempool.Mempool - log logging.Logger - txVerifier TxVerifier - maxFalsePositiveProbability float64 + log logging.Logger + txVerifier TxVerifier lock sync.RWMutex bloom *gossip.BloomFilter @@ -113,7 +115,7 @@ func (g *gossipMempool) Add(tx *txs.Tx) error { defer g.lock.Unlock() g.bloom.Add(tx) - reset, err := gossip.ResetBloomFilterIfNeeded(g.bloom, g.maxFalsePositiveProbability) + reset, err := gossip.ResetBloomFilterIfNeeded(g.bloom, g.Mempool.Len()*bloomChurnMultiplier) if err != nil { return err } @@ -130,7 +132,7 @@ func (g *gossipMempool) Add(tx *txs.Tx) error { return nil } -func (g *gossipMempool) GetFilter() (bloom []byte, salt []byte, err error) { +func (g *gossipMempool) GetFilter() (bloom []byte, salt []byte) { g.lock.RLock() defer g.lock.RUnlock() diff --git a/vms/platformvm/network/gossip_test.go b/vms/platformvm/network/gossip_test.go index a51c86872297..dcfca4ed2eed 100644 --- a/vms/platformvm/network/gossip_test.go +++ b/vms/platformvm/network/gossip_test.go @@ -130,6 +130,7 @@ func TestGossipAddBloomFilter(t *testing.T) { mempool.EXPECT().Get(txID).Return(nil, false) mempool.EXPECT().GetDropReason(txID).Return(nil) mempool.EXPECT().Add(tx).Return(nil) + mempool.EXPECT().Len().Return(0) mempool.EXPECT().RequestBuildBlock(false) gossipMempool, err := newGossipMempool( diff --git a/vms/platformvm/network/network_test.go b/vms/platformvm/network/network_test.go index 5bb735395767..181fbc163cea 100644 --- a/vms/platformvm/network/network_test.go +++ b/vms/platformvm/network/network_test.go @@ -124,6 +124,7 @@ func TestNetworkAppGossip(t *testing.T) { mempool.EXPECT().Get(gomock.Any()).Return(nil, false) mempool.EXPECT().GetDropReason(gomock.Any()).Return(nil) mempool.EXPECT().Add(gomock.Any()).Return(nil) + mempool.EXPECT().Len().Return(0) mempool.EXPECT().RequestBuildBlock(false) return mempool }, @@ -300,6 +301,7 @@ func TestNetworkIssueTx(t *testing.T) { mempool.EXPECT().Get(gomock.Any()).Return(nil, false) mempool.EXPECT().GetDropReason(gomock.Any()).Return(nil) mempool.EXPECT().Add(gomock.Any()).Return(nil) + mempool.EXPECT().Len().Return(0) mempool.EXPECT().RequestBuildBlock(false) return mempool }, diff --git a/vms/platformvm/txs/mempool/mempool.go b/vms/platformvm/txs/mempool/mempool.go index 3f202cc3940d..34ee9c283745 100644 --- a/vms/platformvm/txs/mempool/mempool.go +++ b/vms/platformvm/txs/mempool/mempool.go @@ -67,6 +67,9 @@ type Mempool interface { // possibly reissued. MarkDropped(txID ids.ID, reason error) GetDropReason(txID ids.ID) error + + // Len returns the number of txs in the mempool. + Len() int } // Transactions from clients that have not yet been put into blocks and added to @@ -246,3 +249,10 @@ func (m *mempool) RequestBuildBlock(emptyBlockPermitted bool) { default: } } + +func (m *mempool) Len() int { + m.lock.RLock() + defer m.lock.RUnlock() + + return m.unissuedTxs.Len() +} diff --git a/vms/platformvm/txs/mempool/mock_mempool.go b/vms/platformvm/txs/mempool/mock_mempool.go index 0cfd9b141def..d88f0592571a 100644 --- a/vms/platformvm/txs/mempool/mock_mempool.go +++ b/vms/platformvm/txs/mempool/mock_mempool.go @@ -90,6 +90,20 @@ func (mr *MockMempoolMockRecorder) Iterate(arg0 interface{}) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Iterate", reflect.TypeOf((*MockMempool)(nil).Iterate), arg0) } +// Len mocks base method. +func (m *MockMempool) Len() int { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Len") + ret0, _ := ret[0].(int) + return ret0 +} + +// Len indicates an expected call of Len. +func (mr *MockMempoolMockRecorder) Len() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Len", reflect.TypeOf((*MockMempool)(nil).Len)) +} + // MarkDropped mocks base method. func (m *MockMempool) MarkDropped(arg0 ids.ID, arg1 error) { m.ctrl.T.Helper() From 310b77e221b8d0c5fcee3254900079b1987466f5 Mon Sep 17 00:00:00 2001 From: Patrick O'Grady Date: Wed, 10 Jan 2024 16:29:17 +0100 Subject: [PATCH 30/57] [ci] Increase Fuzz Time in Periodic Runs (#2599) --- .github/workflows/fuzz.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fuzz.yml b/.github/workflows/fuzz.yml index b0ede2b349b7..fdca7ab41b8b 100644 --- a/.github/workflows/fuzz.yml +++ b/.github/workflows/fuzz.yml @@ -22,4 +22,4 @@ jobs: check-latest: true - name: Run fuzz tests shell: bash - run: ./scripts/build_fuzz.sh 30 # Run each fuzz test 30 seconds + run: ./scripts/build_fuzz.sh 180 # Run each fuzz test 180 seconds From 9b4a01ca5f96ee3f9b07da80c373d8010684aaa6 Mon Sep 17 00:00:00 2001 From: marun Date: Thu, 11 Jan 2024 13:50:02 +0100 Subject: [PATCH 31/57] `tmpnet`: Save metrics snapshot to disk before node shutdown (#2601) --- tests/fixture/tmpnet/network.go | 2 +- tests/fixture/tmpnet/node.go | 31 +++++++++++++++++++++++++++-- tests/fixture/tmpnet/node_config.go | 14 +++++++++++++ 3 files changed, 44 insertions(+), 3 deletions(-) diff --git a/tests/fixture/tmpnet/network.go b/tests/fixture/tmpnet/network.go index da18b59c0c58..3352f7dcb1cf 100644 --- a/tests/fixture/tmpnet/network.go +++ b/tests/fixture/tmpnet/network.go @@ -299,7 +299,7 @@ func (n *Network) Stop(ctx context.Context) error { // Initiate stop on all nodes for _, node := range nodes { - if err := node.InitiateStop(); err != nil { + if err := node.InitiateStop(ctx); err != nil { errs = append(errs, fmt.Errorf("failed to stop node %s: %w", node.NodeID, err)) } } diff --git a/tests/fixture/tmpnet/node.go b/tests/fixture/tmpnet/node.go index 8638985dd5b2..d1f97c7ead9c 100644 --- a/tests/fixture/tmpnet/node.go +++ b/tests/fixture/tmpnet/node.go @@ -9,6 +9,7 @@ import ( "errors" "fmt" "io" + "net/http" "os" "path/filepath" "strings" @@ -141,7 +142,10 @@ func (n *Node) Start(w io.Writer) error { return n.getRuntime().Start(w) } -func (n *Node) InitiateStop() error { +func (n *Node) InitiateStop(ctx context.Context) error { + if err := n.SaveMetricsSnapshot(ctx); err != nil { + return err + } return n.getRuntime().InitiateStop() } @@ -157,9 +161,32 @@ func (n *Node) getDataDir() string { return cast.ToString(n.Flags[config.DataDirKey]) } +// Writes the current state of the metrics endpoint to disk +func (n *Node) SaveMetricsSnapshot(ctx context.Context) error { + if len(n.URI) == 0 { + // No URI to request metrics from + return nil + } + uri := n.URI + "/ext/metrics" + req, err := http.NewRequestWithContext(ctx, http.MethodGet, uri, nil) + if err != nil { + return err + } + resp, err := http.DefaultClient.Do(req) + if err != nil { + return err + } + defer resp.Body.Close() + body, err := io.ReadAll(resp.Body) + if err != nil { + return err + } + return n.writeMetricsSnapshot(body) +} + // Initiates node shutdown and waits for the node to stop. func (n *Node) Stop(ctx context.Context) error { - if err := n.InitiateStop(); err != nil { + if err := n.InitiateStop(ctx); err != nil { return err } return n.WaitForStopped(ctx) diff --git a/tests/fixture/tmpnet/node_config.go b/tests/fixture/tmpnet/node_config.go index 15000ae279fb..3ebbc01b6c32 100644 --- a/tests/fixture/tmpnet/node_config.go +++ b/tests/fixture/tmpnet/node_config.go @@ -8,6 +8,8 @@ import ( "fmt" "os" "path/filepath" + "strings" + "time" "github.com/ava-labs/avalanchego/utils/perms" ) @@ -98,3 +100,15 @@ func (n *Node) Write() error { } return n.writeConfig() } + +func (n *Node) writeMetricsSnapshot(data []byte) error { + metricsDir := filepath.Join(n.getDataDir(), "metrics") + if err := os.MkdirAll(metricsDir, perms.ReadWriteExecute); err != nil { + return fmt.Errorf("failed to create metrics dir: %w", err) + } + // Create a compatible filesystem from the current timestamp + ts := time.Now().UTC().Format(time.RFC3339) + ts = strings.ReplaceAll(strings.ReplaceAll(ts, ":", ""), "-", "") + metricsPath := filepath.Join(metricsDir, ts) + return os.WriteFile(metricsPath, data, perms.ReadWrite) +} From d3595e5cec301c08891cb864f03d372cd338ad3e Mon Sep 17 00:00:00 2001 From: hugo-syn <61210734+hugo-syn@users.noreply.github.com> Date: Thu, 11 Jan 2024 20:25:06 +0100 Subject: [PATCH 32/57] chore: Fix typo s/useage/usage (#2602) --- RELEASES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASES.md b/RELEASES.md index a7c232d7674b..743df32d471d 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -36,7 +36,7 @@ The plugin version is unchanged at `30` and is compatible with versions `v1.10.1 ### Fixes - Fixed `duplicated operation on provided value` error when executing atomic operations after state syncing the C-chain -- Removed useage of atomic trie after commitment +- Removed usage of atomic trie after commitment - Fixed atomic trie root overwrite during state sync - Prevented closure of `stdout` and `stderr` when shutting down the logger From 31e5b3e6655e2e2a1e5c1653ab8ea48e228bba3e Mon Sep 17 00:00:00 2001 From: Dhruba Basu <7675102+dhrubabasu@users.noreply.github.com> Date: Thu, 11 Jan 2024 17:22:59 -0500 Subject: [PATCH 33/57] Deprecate `SnowRogueCommitThresholdKey` and `SnowVirtuousCommitThresholdKey` (#2600) --- config/config.go | 23 ++++++++++++----------- config/flags.go | 6 ++++-- config/keys.go | 1 + snow/consensus/snowball/parameters.go | 2 +- 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/config/config.go b/config/config.go index 0c53f46837a4..297d46255077 100644 --- a/config/config.go +++ b/config/config.go @@ -79,6 +79,9 @@ var ( ConsensusGossipOnAcceptValidatorSizeKey: acceptedFrontierGossipDeprecationMsg, ConsensusGossipOnAcceptNonValidatorSizeKey: acceptedFrontierGossipDeprecationMsg, ConsensusGossipOnAcceptPeerSizeKey: acceptedFrontierGossipDeprecationMsg, + + SnowRogueCommitThresholdKey: fmt.Sprintf("use --%s instead", SnowCommitThresholdKey), + SnowVirtuousCommitThresholdKey: fmt.Sprintf("use --%s instead", SnowCommitThresholdKey), } errConflictingACPOpinion = errors.New("supporting and objecting to the same ACP") @@ -106,17 +109,11 @@ var ( func getConsensusConfig(v *viper.Viper) snowball.Parameters { p := snowball.Parameters{ - K: v.GetInt(SnowSampleSizeKey), - AlphaPreference: v.GetInt(SnowPreferenceQuorumSizeKey), - AlphaConfidence: v.GetInt(SnowConfidenceQuorumSizeKey), - // During the X-chain linearization we require BetaVirtuous and - // BetaRogue to be equal. Therefore we use the more conservative - // BetaRogue value for both BetaVirtuous and BetaRogue. - // - // TODO: After the X-chain linearization use the - // SnowVirtuousCommitThresholdKey as before. - BetaVirtuous: v.GetInt(SnowRogueCommitThresholdKey), - BetaRogue: v.GetInt(SnowRogueCommitThresholdKey), + K: v.GetInt(SnowSampleSizeKey), + AlphaPreference: v.GetInt(SnowPreferenceQuorumSizeKey), + AlphaConfidence: v.GetInt(SnowConfidenceQuorumSizeKey), + BetaVirtuous: v.GetInt(SnowCommitThresholdKey), + BetaRogue: v.GetInt(SnowCommitThresholdKey), ConcurrentRepolls: v.GetInt(SnowConcurrentRepollsKey), OptimalProcessing: v.GetInt(SnowOptimalProcessingKey), MaxOutstandingItems: v.GetInt(SnowMaxProcessingKey), @@ -126,6 +123,10 @@ func getConsensusConfig(v *viper.Viper) snowball.Parameters { p.AlphaPreference = v.GetInt(SnowQuorumSizeKey) p.AlphaConfidence = p.AlphaPreference } + if v.IsSet(SnowRogueCommitThresholdKey) { + p.BetaVirtuous = v.GetInt(SnowRogueCommitThresholdKey) + p.BetaRogue = v.GetInt(SnowRogueCommitThresholdKey) + } return p } diff --git a/config/flags.go b/config/flags.go index acf965aea3a2..d8b013edc4a6 100644 --- a/config/flags.go +++ b/config/flags.go @@ -306,10 +306,12 @@ func addNodeFlags(fs *pflag.FlagSet) { fs.Int(SnowQuorumSizeKey, snowball.DefaultParameters.AlphaConfidence, "Threshold of nodes required to update this node's preference and increase its confidence in a network poll") fs.Int(SnowPreferenceQuorumSizeKey, snowball.DefaultParameters.AlphaPreference, fmt.Sprintf("Threshold of nodes required to update this node's preference in a network poll. Ignored if %s is provided", SnowQuorumSizeKey)) fs.Int(SnowConfidenceQuorumSizeKey, snowball.DefaultParameters.AlphaConfidence, fmt.Sprintf("Threshold of nodes required to increase this node's confidence in a network poll. Ignored if %s is provided", SnowQuorumSizeKey)) - // TODO: Replace this temporary flag description after the X-chain - // linearization with "Beta value to use for virtuous transactions" + + fs.Int(SnowCommitThresholdKey, snowball.DefaultParameters.BetaRogue, "Beta value to use for transactions") + // TODO: Remove these once enough time has passed with SnowCommitThresholdKey fs.Int(SnowVirtuousCommitThresholdKey, snowball.DefaultParameters.BetaVirtuous, "This flag is temporarily ignored due to the X-chain linearization") fs.Int(SnowRogueCommitThresholdKey, snowball.DefaultParameters.BetaRogue, "Beta value to use for rogue transactions") + fs.Int(SnowConcurrentRepollsKey, snowball.DefaultParameters.ConcurrentRepolls, "Minimum number of concurrent polls for finalizing consensus") fs.Int(SnowOptimalProcessingKey, snowball.DefaultParameters.OptimalProcessing, "Optimal number of processing containers in consensus") fs.Int(SnowMaxProcessingKey, snowball.DefaultParameters.MaxOutstandingItems, "Maximum number of processing items to be considered healthy") diff --git a/config/keys.go b/config/keys.go index 45ccdf0a9d83..cdd90bf2b7f8 100644 --- a/config/keys.go +++ b/config/keys.go @@ -130,6 +130,7 @@ const ( SnowConfidenceQuorumSizeKey = "snow-confidence-quorum-size" SnowVirtuousCommitThresholdKey = "snow-virtuous-commit-threshold" SnowRogueCommitThresholdKey = "snow-rogue-commit-threshold" + SnowCommitThresholdKey = "snow-commit-threshold" SnowConcurrentRepollsKey = "snow-concurrent-repolls" SnowOptimalProcessingKey = "snow-optimal-processing" SnowMaxProcessingKey = "snow-max-processing" diff --git a/snow/consensus/snowball/parameters.go b/snow/consensus/snowball/parameters.go index 640b8702817e..bf458fbf9f40 100644 --- a/snow/consensus/snowball/parameters.go +++ b/snow/consensus/snowball/parameters.go @@ -39,7 +39,7 @@ var ( K: 20, AlphaPreference: 15, AlphaConfidence: 15, - BetaVirtuous: 15, + BetaVirtuous: 20, BetaRogue: 20, ConcurrentRepolls: 4, OptimalProcessing: 10, From 74e6afcfeb47d293bcd5680b5dd18e505c4da65f Mon Sep 17 00:00:00 2001 From: Stephen Buttolph Date: Thu, 11 Jan 2024 18:10:43 -0500 Subject: [PATCH 34/57] Fix networking invalid field log (#2604) --- network/peer/peer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network/peer/peer.go b/network/peer/peer.go index 5b6f38c6f19f..013b9d8ec3ea 100644 --- a/network/peer/peer.go +++ b/network/peer/peer.go @@ -1079,7 +1079,7 @@ func (p *peer) handlePeerList(msg *p2p.PeerList) { if ipLen := len(claimedIPPort.IpAddr); ipLen != net.IPv6len { p.Log.Debug("message with invalid field", zap.Stringer("nodeID", p.id), - zap.Stringer("messageOp", message.HandshakeOp), + zap.Stringer("messageOp", message.PeerListOp), zap.String("field", "IP"), zap.Int("ipLen", ipLen), ) From 62fe36de319852be10604f81e6d0d06d7ee417cc Mon Sep 17 00:00:00 2001 From: hugo-syn <61210734+hugo-syn@users.noreply.github.com> Date: Fri, 12 Jan 2024 18:56:43 +0100 Subject: [PATCH 35/57] chore: Fix typo s/seperate/separate/ (#2605) --- proto/pb/vm/vm_grpc.pb.go | 4 ++-- proto/vm/vm.proto | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/proto/pb/vm/vm_grpc.pb.go b/proto/pb/vm/vm_grpc.pb.go index 5250af11f86f..917e04d25e96 100644 --- a/proto/pb/vm/vm_grpc.pb.go +++ b/proto/pb/vm/vm_grpc.pb.go @@ -73,7 +73,7 @@ type VMClient interface { // Creates the HTTP handlers for custom VM network calls. // // Note: RPC Chain VM Factory will start a new instance of the VM in a - // seperate process which will populate the static handlers. After this + // separate process which will populate the static handlers. After this // process is created other processes will be created to populate blockchains, // but they will not have the static handlers be called again. CreateStaticHandlers(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*CreateStaticHandlersResponse, error) @@ -464,7 +464,7 @@ type VMServer interface { // Creates the HTTP handlers for custom VM network calls. // // Note: RPC Chain VM Factory will start a new instance of the VM in a - // seperate process which will populate the static handlers. After this + // separate process which will populate the static handlers. After this // process is created other processes will be created to populate blockchains, // but they will not have the static handlers be called again. CreateStaticHandlers(context.Context, *emptypb.Empty) (*CreateStaticHandlersResponse, error) diff --git a/proto/vm/vm.proto b/proto/vm/vm.proto index fb93455105df..ff50de1eb6cb 100644 --- a/proto/vm/vm.proto +++ b/proto/vm/vm.proto @@ -24,7 +24,7 @@ service VM { // Creates the HTTP handlers for custom VM network calls. // // Note: RPC Chain VM Factory will start a new instance of the VM in a - // seperate process which will populate the static handlers. After this + // separate process which will populate the static handlers. After this // process is created other processes will be created to populate blockchains, // but they will not have the static handlers be called again. rpc CreateStaticHandlers(google.protobuf.Empty) returns (CreateStaticHandlersResponse); From a6ee97878fe831148bfa044e063f39d092955c42 Mon Sep 17 00:00:00 2001 From: Stephen Buttolph Date: Sat, 13 Jan 2024 17:27:22 -0500 Subject: [PATCH 36/57] Support dynamic port peerlist gossip (#2603) --- .github/workflows/ci.yml | 21 +++--- app/app.go | 101 +------------------------ config/config.go | 68 +++-------------- config/flags.go | 5 +- nat/nat.go | 4 +- network/dialer_test.go | 10 +-- network/network.go | 15 +++- network/peer/peer.go | 27 +++++++ network/peer/peer_test.go | 4 +- network/peer/test_peer.go | 2 +- network/test_network.go | 4 +- node/config.go | 13 +--- node/node.go | 153 +++++++++++++++++++++++++++++++++----- 13 files changed, 214 insertions(+), 213 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a9e0501d677f..b08cb01068d5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -109,16 +109,17 @@ jobs: - name: Build AvalancheGo Binary shell: bash run: ./scripts/build.sh - - name: Run e2e tests - shell: bash - run: ./scripts/tests.upgrade.sh - - name: Upload tmpnet network dir - uses: actions/upload-artifact@v3 - if: always() - with: - name: upgrade-tmpnet-data - path: ${{ env.tmpnet_data_path }} - if-no-files-found: error + # TODO: re-activate this test after there is a compatible tag to use + # - name: Run e2e tests + # shell: bash + # run: ./scripts/tests.upgrade.sh + # - name: Upload tmpnet network dir + # uses: actions/upload-artifact@v3 + # if: always() + # with: + # name: upgrade-tmpnet-data + # path: ${{ env.tmpnet_data_path }} + # if-no-files-found: error Lint: runs-on: ubuntu-latest steps: diff --git a/app/app.go b/app/app.go index c2da07b416a8..26043ff449da 100644 --- a/app/app.go +++ b/app/app.go @@ -14,30 +14,20 @@ import ( "golang.org/x/sync/errgroup" - "github.com/ava-labs/avalanchego/nat" "github.com/ava-labs/avalanchego/node" - "github.com/ava-labs/avalanchego/utils/constants" - "github.com/ava-labs/avalanchego/utils/ips" "github.com/ava-labs/avalanchego/utils/logging" "github.com/ava-labs/avalanchego/utils/perms" "github.com/ava-labs/avalanchego/utils/ulimit" ) -const ( - Header = ` _____ .__ .__ +const Header = ` _____ .__ .__ / _ \___ _______ | | _____ ____ ____ | |__ ____ ,_ o / /_\ \ \/ /\__ \ | | \__ \ / \_/ ___\| | \_/ __ \ / //\, / | \ / / __ \| |__/ __ \| | \ \___| Y \ ___/ \>> | \____|__ /\_/ (____ /____(____ /___| /\___ >___| /\___ > \\ \/ \/ \/ \/ \/ \/ \/` -) - -var ( - stakingPortName = fmt.Sprintf("%s-staking", constants.AppName) - httpPortName = fmt.Sprintf("%s-http", constants.AppName) - _ App = (*app)(nil) -) +var _ App = (*app)(nil) type App interface { // Start kicks off the application and returns immediately. @@ -88,7 +78,6 @@ func New(config node.Config) (App, error) { } return &app{ - config: config, node: n, log: log, logFactory: logFactory, @@ -133,7 +122,6 @@ func Run(app App) int { // app is a wrapper around a node that runs in this process type app struct { - config node.Config node *node.Node log logging.Logger logFactory logging.Factory @@ -144,88 +132,6 @@ type app struct { // Does not block until the node is done. Errors returned from this method // are not logged. func (a *app) Start() error { - // Track if sybil control is enforced - if !a.config.SybilProtectionEnabled { - a.log.Warn("sybil control is not enforced") - } - - // TODO move this to config - // SupportsNAT() for NoRouter is false. - // Which means we tried to perform a NAT activity but we were not successful. - if a.config.AttemptedNATTraversal && !a.config.Nat.SupportsNAT() { - a.log.Warn("UPnP and NAT-PMP router attach failed, " + - "you may not be listening publicly. " + - "Please confirm the settings in your router") - } - - if ip := a.config.IPPort.IPPort().IP; ip.IsLoopback() || ip.IsPrivate() { - a.log.Warn("P2P IP is private, you will not be publicly discoverable", - zap.Stringer("ip", ip), - ) - } - - // An empty host is treated as a wildcard to match all addresses, so it is - // considered public. - hostIsPublic := a.config.HTTPHost == "" - if !hostIsPublic { - ip, err := ips.Lookup(a.config.HTTPHost) - if err != nil { - a.log.Fatal("failed to lookup HTTP host", - zap.String("host", a.config.HTTPHost), - zap.Error(err), - ) - a.logFactory.Close() - return err - } - hostIsPublic = !ip.IsLoopback() && !ip.IsPrivate() - - a.log.Debug("finished HTTP host lookup", - zap.String("host", a.config.HTTPHost), - zap.Stringer("ip", ip), - zap.Bool("isPublic", hostIsPublic), - ) - } - - mapper := nat.NewPortMapper(a.log, a.config.Nat) - - // Open staking port we want for NAT traversal to have the external port - // (config.IP.Port) to connect to our internal listening port - // (config.InternalStakingPort) which should be the same in most cases. - if port := a.config.IPPort.IPPort().Port; port != 0 { - mapper.Map( - port, - port, - stakingPortName, - a.config.IPPort, - a.config.IPResolutionFreq, - ) - } - - // Don't open the HTTP port if the HTTP server is private - if hostIsPublic { - a.log.Warn("HTTP server is binding to a potentially public host. "+ - "You may be vulnerable to a DoS attack if your HTTP port is publicly accessible", - zap.String("host", a.config.HTTPHost), - ) - - // For NAT traversal we want to route from the external port - // (config.ExternalHTTPPort) to our internal port (config.HTTPPort). - if a.config.HTTPPort != 0 { - mapper.Map( - a.config.HTTPPort, - a.config.HTTPPort, - httpPortName, - nil, - a.config.IPResolutionFreq, - ) - } - } - - // Regularly update our public IP. - // Note that if the node config said to not dynamically resolve and - // update our public IP, [p.config.IPUdater] is a no-op implementation. - go a.config.IPUpdater.Dispatch(a.log) - // [p.ExitCode] will block until [p.exitWG.Done] is called a.exitWG.Add(1) go func() { @@ -238,9 +144,6 @@ func (a *app) Start() error { a.exitWG.Done() }() defer func() { - mapper.UnmapAllPorts() - a.config.IPUpdater.Stop() - // If [p.node.Dispatch()] panics, then we should log the panic and // then re-raise the panic. This is why the above defer is broken // into two parts. diff --git a/config/config.go b/config/config.go index 297d46255077..e4ae0816c043 100644 --- a/config/config.go +++ b/config/config.go @@ -4,7 +4,6 @@ package config import ( - "context" "crypto/tls" "encoding/base64" "encoding/json" @@ -12,7 +11,6 @@ import ( "fmt" "io/fs" "math" - "net" "os" "path/filepath" "strings" @@ -25,7 +23,6 @@ import ( "github.com/ava-labs/avalanchego/genesis" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/ipcs" - "github.com/ava-labs/avalanchego/nat" "github.com/ava-labs/avalanchego/network" "github.com/ava-labs/avalanchego/network/dialer" "github.com/ava-labs/avalanchego/network/throttling" @@ -40,7 +37,6 @@ import ( "github.com/ava-labs/avalanchego/utils/compression" "github.com/ava-labs/avalanchego/utils/constants" "github.com/ava-labs/avalanchego/utils/crypto/bls" - "github.com/ava-labs/avalanchego/utils/dynamicip" "github.com/ava-labs/avalanchego/utils/ips" "github.com/ava-labs/avalanchego/utils/logging" "github.com/ava-labs/avalanchego/utils/password" @@ -58,7 +54,6 @@ const ( chainConfigFileName = "config" chainUpgradeFileName = "upgrade" subnetConfigFileExt = ".json" - ipResolutionTimeout = 30 * time.Second ipcDeprecationMsg = "IPC API is deprecated" keystoreDeprecationMsg = "keystore API is deprecated" @@ -617,64 +612,19 @@ func getBootstrapConfig(v *viper.Viper, networkID uint32) (node.BootstrapConfig, } func getIPConfig(v *viper.Viper) (node.IPConfig, error) { - ipResolutionService := v.GetString(PublicIPResolutionServiceKey) - ipResolutionFreq := v.GetDuration(PublicIPResolutionFreqKey) - if ipResolutionFreq <= 0 { - return node.IPConfig{}, fmt.Errorf("%q must be > 0", PublicIPResolutionFreqKey) - } - - stakingPort := uint16(v.GetUint(StakingPortKey)) - publicIP := v.GetString(PublicIPKey) - if publicIP != "" && ipResolutionService != "" { - return node.IPConfig{}, fmt.Errorf("only one of --%s and --%s can be given", PublicIPKey, PublicIPResolutionServiceKey) - } - - // Define default configuration ipConfig := node.IPConfig{ - IPUpdater: dynamicip.NewNoUpdater(), - IPResolutionFreq: ipResolutionFreq, - Nat: nat.NewNoRouter(), - ListenHost: v.GetString(StakingHostKey), - } - - if publicIP != "" { - // User specified a specific public IP to use. - ip := net.ParseIP(publicIP) - if ip == nil { - return node.IPConfig{}, fmt.Errorf("invalid IP Address %s", publicIP) - } - ipConfig.IPPort = ips.NewDynamicIPPort(ip, stakingPort) - return ipConfig, nil + PublicIP: v.GetString(PublicIPKey), + PublicIPResolutionService: v.GetString(PublicIPResolutionServiceKey), + PublicIPResolutionFreq: v.GetDuration(PublicIPResolutionFreqKey), + ListenHost: v.GetString(StakingHostKey), + ListenPort: uint16(v.GetUint(StakingPortKey)), } - if ipResolutionService != "" { - // User specified to use dynamic IP resolution. - resolver, err := dynamicip.NewResolver(ipResolutionService) - if err != nil { - return node.IPConfig{}, fmt.Errorf("couldn't create IP resolver: %w", err) - } - - // Use that to resolve our public IP. - ctx, cancel := context.WithTimeout(context.Background(), ipResolutionTimeout) - defer cancel() - ip, err := resolver.Resolve(ctx) - if err != nil { - return node.IPConfig{}, fmt.Errorf("couldn't resolve public IP: %w", err) - } - ipConfig.IPPort = ips.NewDynamicIPPort(ip, stakingPort) - ipConfig.IPUpdater = dynamicip.NewUpdater(ipConfig.IPPort, resolver, ipResolutionFreq) - return ipConfig, nil + if ipConfig.PublicIPResolutionFreq <= 0 { + return node.IPConfig{}, fmt.Errorf("%q must be > 0", PublicIPResolutionFreqKey) } - - // User didn't specify a public IP to use, and they didn't specify a public IP resolution - // service to use. Try to resolve public IP with NAT traversal. - nat := nat.GetRouter() - ip, err := nat.ExternalIP() - if err != nil { - return node.IPConfig{}, fmt.Errorf("public IP / IP resolution service not given and failed to resolve IP with NAT: %w", err) + if ipConfig.PublicIP != "" && ipConfig.PublicIPResolutionService != "" { + return node.IPConfig{}, fmt.Errorf("only one of --%s and --%s can be given", PublicIPKey, PublicIPResolutionServiceKey) } - ipConfig.IPPort = ips.NewDynamicIPPort(ip, stakingPort) - ipConfig.Nat = nat - ipConfig.AttemptedNATTraversal = true return ipConfig, nil } diff --git a/config/flags.go b/config/flags.go index d8b013edc4a6..e98f132da6a5 100644 --- a/config/flags.go +++ b/config/flags.go @@ -21,6 +21,7 @@ import ( "github.com/ava-labs/avalanchego/trace" "github.com/ava-labs/avalanchego/utils/compression" "github.com/ava-labs/avalanchego/utils/constants" + "github.com/ava-labs/avalanchego/utils/dynamicip" "github.com/ava-labs/avalanchego/utils/ulimit" "github.com/ava-labs/avalanchego/utils/units" ) @@ -133,9 +134,9 @@ func addNodeFlags(fs *pflag.FlagSet) { fs.Duration(NetworkPeerListGossipFreqKey, constants.DefaultNetworkPeerListGossipFreq, "Frequency to gossip peers to other nodes") // Public IP Resolution - fs.String(PublicIPKey, "", "Public IP of this node for P2P communication. If empty, try to discover with NAT") + fs.String(PublicIPKey, "", "Public IP of this node for P2P communication") fs.Duration(PublicIPResolutionFreqKey, 5*time.Minute, "Frequency at which this node resolves/updates its public IP and renew NAT mappings, if applicable") - fs.String(PublicIPResolutionServiceKey, "", fmt.Sprintf("Only acceptable values are 'ifconfigco', 'opendns' or 'ifconfigme'. When provided, the node will use that service to periodically resolve/update its public IP. Ignored if %s is set", PublicIPKey)) + fs.String(PublicIPResolutionServiceKey, "", fmt.Sprintf("Only acceptable values are %q, %q or %q. When provided, the node will use that service to periodically resolve/update its public IP", dynamicip.OpenDNSName, dynamicip.IFConfigCoName, dynamicip.IFConfigMeName)) // Inbound Connection Throttling fs.Duration(NetworkInboundConnUpgradeThrottlerCooldownKey, constants.DefaultInboundConnUpgradeThrottlerCooldown, "Upgrade an inbound connection from a given IP at most once per this duration. If 0, don't rate-limit inbound connection upgrades") diff --git a/nat/nat.go b/nat/nat.go index 20af4fe27ea9..a6e37078e7a6 100644 --- a/nat/nat.go +++ b/nat/nat.go @@ -53,8 +53,8 @@ type Mapper struct { } // NewPortMapper returns an initialized mapper -func NewPortMapper(log logging.Logger, r Router) Mapper { - return Mapper{ +func NewPortMapper(log logging.Logger, r Router) *Mapper { + return &Mapper{ log: log, r: r, closer: make(chan struct{}), diff --git a/network/dialer_test.go b/network/dialer_test.go index ecc506ba2927..7a60d056d66d 100644 --- a/network/dialer_test.go +++ b/network/dialer_test.go @@ -33,7 +33,7 @@ func (d *testDialer) NewListener() (ips.DynamicIPPort, *testListener) { // Uses a private IP to easily enable testing AllowPrivateIPs ip := ips.NewDynamicIPPort( net.IPv4(10, 0, 0, 0), - uint16(len(d.listeners)), + uint16(len(d.listeners)+1), ) staticIP := ip.IPPort() listener := newTestListener(staticIP) @@ -55,22 +55,22 @@ func (d *testDialer) Dial(ctx context.Context, ip ips.IPPort) (net.Conn, error) Conn: serverConn, localAddr: &net.TCPAddr{ IP: net.IPv6loopback, - Port: 0, + Port: 1, }, remoteAddr: &net.TCPAddr{ IP: net.IPv6loopback, - Port: 1, + Port: 2, }, } client := &testConn{ Conn: clientConn, localAddr: &net.TCPAddr{ IP: net.IPv6loopback, - Port: 2, + Port: 3, }, remoteAddr: &net.TCPAddr{ IP: net.IPv6loopback, - Port: 3, + Port: 4, }, } select { diff --git a/network/network.go b/network/network.go index 2dc6b2bbfdcb..2d178cb93488 100644 --- a/network/network.go +++ b/network/network.go @@ -1068,6 +1068,10 @@ func (n *network) peerIPStatus(nodeID ids.NodeID, ip *ips.ClaimedIPPort) (*ips.C // there is a randomized exponential backoff to avoid spamming connection // attempts. func (n *network) dial(nodeID ids.NodeID, ip *trackedIP) { + n.peerConfig.Log.Verbo("attempting to dial node", + zap.Stringer("nodeID", nodeID), + zap.Stringer("ip", ip.ip), + ) go func() { n.metrics.numTracked.Inc() defer n.metrics.numTracked.Dec() @@ -1141,7 +1145,7 @@ func (n *network) dial(nodeID ids.NodeID, ip *trackedIP) { n.peerConfig.Log.Verbo("skipping connection dial", zap.String("reason", "outbound connections to private IPs are prohibited"), zap.Stringer("nodeID", nodeID), - zap.Stringer("peerIP", ip.ip.IP), + zap.Stringer("peerIP", ip.ip), zap.Duration("delay", ip.delay), ) continue @@ -1151,7 +1155,8 @@ func (n *network) dial(nodeID ids.NodeID, ip *trackedIP) { if err != nil { n.peerConfig.Log.Verbo( "failed to reach peer, attempting again", - zap.Stringer("peerIP", ip.ip.IP), + zap.Stringer("nodeID", nodeID), + zap.Stringer("peerIP", ip.ip), zap.Duration("delay", ip.delay), ) continue @@ -1159,14 +1164,16 @@ func (n *network) dial(nodeID ids.NodeID, ip *trackedIP) { n.peerConfig.Log.Verbo("starting to upgrade connection", zap.String("direction", "outbound"), - zap.Stringer("peerIP", ip.ip.IP), + zap.Stringer("nodeID", nodeID), + zap.Stringer("peerIP", ip.ip), ) err = n.upgrade(conn, n.clientUpgrader) if err != nil { n.peerConfig.Log.Verbo( "failed to upgrade, attempting again", - zap.Stringer("peerIP", ip.ip.IP), + zap.Stringer("nodeID", nodeID), + zap.Stringer("peerIP", ip.ip), zap.Duration("delay", ip.delay), ) continue diff --git a/network/peer/peer.go b/network/peer/peer.go index 013b9d8ec3ea..16b5d3ab3090 100644 --- a/network/peer/peer.go +++ b/network/peer/peer.go @@ -500,6 +500,13 @@ func (p *peer) writeMessages() { ) return } + if mySignedIP.Port == 0 { + p.Log.Error("signed IP has invalid port", + zap.Stringer("nodeID", p.id), + zap.Uint16("port", mySignedIP.Port), + ) + return + } myVersion := p.VersionCompatibility.Version() legacyApplication := &version.Application{ @@ -996,6 +1003,16 @@ func (p *peer) handleHandshake(msg *p2p.Handshake) { p.StartClose() return } + if msg.IpPort == 0 { + p.Log.Debug("message with invalid field", + zap.Stringer("nodeID", p.id), + zap.Stringer("messageOp", message.HandshakeOp), + zap.String("field", "Port"), + zap.Uint32("port", msg.IpPort), + ) + p.StartClose() + return + } p.ip = &SignedIP{ UnsignedIP: UnsignedIP{ @@ -1086,6 +1103,16 @@ func (p *peer) handlePeerList(msg *p2p.PeerList) { p.StartClose() return } + if claimedIPPort.IpPort == 0 { + p.Log.Debug("message with invalid field", + zap.Stringer("nodeID", p.id), + zap.Stringer("messageOp", message.PeerListOp), + zap.String("field", "Port"), + zap.Uint32("port", claimedIPPort.IpPort), + ) + // TODO: After v1.11.x is activated, close the peer here. + continue + } txID, err := ids.ToID(claimedIPPort.TxId) if err != nil { diff --git a/network/peer/peer_test.go b/network/peer/peer_test.go index 77dd47e73f2c..797a9634a863 100644 --- a/network/peer/peer_test.go +++ b/network/peer/peer_test.go @@ -112,7 +112,7 @@ func makeRawTestPeers(t *testing.T, trackedSubnets set.Set[ids.ID]) (*rawTestPee peerConfig0 := sharedConfig peerConfig1 := sharedConfig - ip0 := ips.NewDynamicIPPort(net.IPv6loopback, 0) + ip0 := ips.NewDynamicIPPort(net.IPv6loopback, 1) tls0 := tlsCert0.PrivateKey.(crypto.Signer) peerConfig0.IPSigner = NewIPSigner(ip0, tls0) @@ -122,7 +122,7 @@ func makeRawTestPeers(t *testing.T, trackedSubnets set.Set[ids.ID]) (*rawTestPee inboundMsgChan0 <- msg }) - ip1 := ips.NewDynamicIPPort(net.IPv6loopback, 1) + ip1 := ips.NewDynamicIPPort(net.IPv6loopback, 2) tls1 := tlsCert1.PrivateKey.(crypto.Signer) peerConfig1.IPSigner = NewIPSigner(ip1, tls1) diff --git a/network/peer/test_peer.go b/network/peer/test_peer.go index 74627930c952..7bd58344ab86 100644 --- a/network/peer/test_peer.go +++ b/network/peer/test_peer.go @@ -102,7 +102,7 @@ func StartTestPeer( return nil, err } - signerIP := ips.NewDynamicIPPort(net.IPv6zero, 0) + signerIP := ips.NewDynamicIPPort(net.IPv6zero, 1) tls := tlsCert.PrivateKey.(crypto.Signer) peer := Start( diff --git a/network/test_network.go b/network/test_network.go index e1c76e92774a..0811875b4c43 100644 --- a/network/test_network.go +++ b/network/test_network.go @@ -66,7 +66,7 @@ func (l *noopListener) Close() error { func (*noopListener) Addr() net.Addr { return &net.TCPAddr{ IP: net.IPv4zero, - Port: 0, + Port: 1, } } @@ -225,7 +225,7 @@ func NewTestNetwork( networkConfig.ResourceTracker.DiskTracker(), ) - networkConfig.MyIPPort = ips.NewDynamicIPPort(net.IPv4zero, 0) + networkConfig.MyIPPort = ips.NewDynamicIPPort(net.IPv4zero, 1) networkConfig.GossipTracker, err = peer.NewGossipTracker(metrics, "") if err != nil { diff --git a/node/config.go b/node/config.go index 768f23cab3e9..a26ec4806fc6 100644 --- a/node/config.go +++ b/node/config.go @@ -11,7 +11,6 @@ import ( "github.com/ava-labs/avalanchego/chains" "github.com/ava-labs/avalanchego/genesis" "github.com/ava-labs/avalanchego/ids" - "github.com/ava-labs/avalanchego/nat" "github.com/ava-labs/avalanchego/network" "github.com/ava-labs/avalanchego/snow/networking/benchlist" "github.com/ava-labs/avalanchego/snow/networking/router" @@ -19,7 +18,6 @@ import ( "github.com/ava-labs/avalanchego/subnets" "github.com/ava-labs/avalanchego/trace" "github.com/ava-labs/avalanchego/utils/crypto/bls" - "github.com/ava-labs/avalanchego/utils/dynamicip" "github.com/ava-labs/avalanchego/utils/ips" "github.com/ava-labs/avalanchego/utils/logging" "github.com/ava-labs/avalanchego/utils/profiler" @@ -74,19 +72,16 @@ type APIConfig struct { } type IPConfig struct { - IPPort ips.DynamicIPPort `json:"ip"` - IPUpdater dynamicip.Updater `json:"-"` - IPResolutionFreq time.Duration `json:"ipResolutionFrequency"` - // True if we attempted NAT traversal - AttemptedNATTraversal bool `json:"attemptedNATTraversal"` - // Tries to perform network address translation - Nat nat.Router `json:"-"` + PublicIP string `json:"publicIP"` + PublicIPResolutionService string `json:"publicIPResolutionService"` + PublicIPResolutionFreq time.Duration `json:"publicIPResolutionFreq"` // The host portion of the address to listen on. The port to // listen on will be sourced from IPPort. // // - If empty, listen on all interfaces (both ipv4 and ipv6). // - If populated, listen only on the specified address. ListenHost string `json:"listenHost"` + ListenPort uint16 `json:"listenPort"` } type StakingConfig struct { diff --git a/node/node.go b/node/node.go index 45e2f6a506eb..8fce5df75550 100644 --- a/node/node.go +++ b/node/node.go @@ -48,6 +48,7 @@ import ( "github.com/ava-labs/avalanchego/indexer" "github.com/ava-labs/avalanchego/ipcs" "github.com/ava-labs/avalanchego/message" + "github.com/ava-labs/avalanchego/nat" "github.com/ava-labs/avalanchego/network" "github.com/ava-labs/avalanchego/network/dialer" "github.com/ava-labs/avalanchego/network/peer" @@ -64,6 +65,7 @@ import ( "github.com/ava-labs/avalanchego/utils" "github.com/ava-labs/avalanchego/utils/constants" "github.com/ava-labs/avalanchego/utils/crypto/bls" + "github.com/ava-labs/avalanchego/utils/dynamicip" "github.com/ava-labs/avalanchego/utils/filesystem" "github.com/ava-labs/avalanchego/utils/hashing" "github.com/ava-labs/avalanchego/utils/ips" @@ -91,6 +93,13 @@ import ( platformconfig "github.com/ava-labs/avalanchego/vms/platformvm/config" ) +const ( + stakingPortName = constants.AppName + "-staking" + httpPortName = constants.AppName + "-http" + + ipResolutionTimeout = 30 * time.Second +) + var ( genesisHashKey = []byte("genesisID") ungracefulShutdown = []byte("ungracefulShutdown") @@ -156,7 +165,7 @@ func New( } n.initMetrics() - + n.initNAT() if err := n.initAPIServer(); err != nil { // Start the API Server return nil, fmt.Errorf("couldn't initialize API server: %w", err) } @@ -193,6 +202,7 @@ func New( n.vdrs = validators.NewManager() if !n.Config.SybilProtectionEnabled { + logger.Warn("sybil control is not enforced") n.vdrs = newOverriddenManager(constants.PrimaryNetworkID, n.vdrs) } if err := n.initResourceManager(n.MetricsRegisterer); err != nil { @@ -266,6 +276,10 @@ type Node struct { // Storage for this node DB database.Database + router nat.Router + portMapper *nat.Mapper + ipUpdater dynamicip.Updater + // Profiles the process. Nil if continuous profiling is disabled. profiler profiler.ContinuousProfiler @@ -380,8 +394,6 @@ type Node struct { // Initialize the networking layer. // Assumes [n.vdrs], [n.CPUTracker], and [n.CPUTargeter] have been initialized. func (n *Node) initNetworking() error { - currentIPPort := n.Config.IPPort.IPPort() - // Providing either loopback address - `::1` for ipv6 and `127.0.0.1` for ipv4 - as the listen // host will avoid the need for a firewall exception on recent MacOS: // @@ -399,8 +411,7 @@ func (n *Node) initNetworking() error { // // 1: https://apple.stackexchange.com/questions/393715/do-you-want-the-application-main-to-accept-incoming-network-connections-pop // 2: https://github.com/golang/go/issues/56998 - listenAddress := net.JoinHostPort(n.Config.ListenHost, strconv.FormatUint(uint64(currentIPPort.Port), 10)) - + listenAddress := net.JoinHostPort(n.Config.ListenHost, strconv.FormatUint(uint64(n.Config.ListenPort), 10)) listener, err := net.Listen(constants.NetworkType, listenAddress) if err != nil { return err @@ -408,23 +419,67 @@ func (n *Node) initNetworking() error { // Wrap listener so it will only accept a certain number of incoming connections per second listener = throttling.NewThrottledListener(listener, n.Config.NetworkConfig.ThrottlerConfig.MaxInboundConnsPerSec) - ipPort, err := ips.ToIPPort(listener.Addr().String()) + // Record the bound address to enable inclusion in process context file. + n.stakingAddress = listener.Addr().String() + ipPort, err := ips.ToIPPort(n.stakingAddress) if err != nil { - n.Log.Info("initializing networking", - zap.Stringer("currentNodeIP", currentIPPort), - ) - } else { - ipPort = ips.IPPort{ - IP: currentIPPort.IP, - Port: ipPort.Port, + return err + } + + var dynamicIP ips.DynamicIPPort + switch { + case n.Config.PublicIP != "": + // Use the specified public IP. + ipPort.IP = net.ParseIP(n.Config.PublicIP) + if ipPort.IP == nil { + return fmt.Errorf("invalid IP Address: %s", n.Config.PublicIP) } - n.Log.Info("initializing networking", - zap.Stringer("currentNodeIP", ipPort), + dynamicIP = ips.NewDynamicIPPort(ipPort.IP, ipPort.Port) + n.ipUpdater = dynamicip.NewNoUpdater() + case n.Config.PublicIPResolutionService != "": + // Use dynamic IP resolution. + resolver, err := dynamicip.NewResolver(n.Config.PublicIPResolutionService) + if err != nil { + return fmt.Errorf("couldn't create IP resolver: %w", err) + } + + // Use that to resolve our public IP. + ctx, cancel := context.WithTimeout(context.Background(), ipResolutionTimeout) + ipPort.IP, err = resolver.Resolve(ctx) + cancel() + if err != nil { + return fmt.Errorf("couldn't resolve public IP: %w", err) + } + dynamicIP = ips.NewDynamicIPPort(ipPort.IP, ipPort.Port) + n.ipUpdater = dynamicip.NewUpdater(dynamicIP, resolver, n.Config.PublicIPResolutionFreq) + default: + ipPort.IP, err = n.router.ExternalIP() + if err != nil { + return fmt.Errorf("public IP / IP resolution service not given and failed to resolve IP with NAT: %w", err) + } + dynamicIP = ips.NewDynamicIPPort(ipPort.IP, ipPort.Port) + n.ipUpdater = dynamicip.NewNoUpdater() + } + + if ipPort.IP.IsLoopback() || ipPort.IP.IsPrivate() { + n.Log.Warn("P2P IP is private, you will not be publicly discoverable", + zap.Stringer("ip", ipPort), ) } - // Record the bound address to enable inclusion in process context file. - n.stakingAddress = listener.Addr().String() + // Regularly update our public IP and port mappings. + n.portMapper.Map( + ipPort.Port, + ipPort.Port, + stakingPortName, + dynamicIP, + n.Config.PublicIPResolutionFreq, + ) + go n.ipUpdater.Dispatch(n.Log) + + n.Log.Info("initializing networking", + zap.Stringer("ip", ipPort), + ) tlsKey, ok := n.Config.StakingTLSCert.PrivateKey.(crypto.Signer) if !ok { @@ -543,7 +598,7 @@ func (n *Node) initNetworking() error { // add node configs to network config n.Config.NetworkConfig.Namespace = n.networkNamespace n.Config.NetworkConfig.MyNodeID = n.ID - n.Config.NetworkConfig.MyIPPort = n.Config.IPPort + n.Config.NetworkConfig.MyIPPort = dynamicIP n.Config.NetworkConfig.NetworkID = n.Config.NetworkID n.Config.NetworkConfig.Validators = n.vdrs n.Config.NetworkConfig.Beacons = n.bootstrappers @@ -861,16 +916,76 @@ func (n *Node) initMetrics() { n.MetricsGatherer = metrics.NewMultiGatherer() } +func (n *Node) initNAT() { + n.Log.Info("initializing NAT") + + if n.Config.PublicIP == "" && n.Config.PublicIPResolutionService == "" { + n.router = nat.GetRouter() + if !n.router.SupportsNAT() { + n.Log.Warn("UPnP and NAT-PMP router attach failed, " + + "you may not be listening publicly. " + + "Please confirm the settings in your router") + } + } else { + n.router = nat.NewNoRouter() + } + + n.portMapper = nat.NewPortMapper(n.Log, n.router) +} + // initAPIServer initializes the server that handles HTTP calls func (n *Node) initAPIServer() error { n.Log.Info("initializing API server") + // An empty host is treated as a wildcard to match all addresses, so it is + // considered public. + hostIsPublic := n.Config.HTTPHost == "" + if !hostIsPublic { + ip, err := ips.Lookup(n.Config.HTTPHost) + if err != nil { + n.Log.Fatal("failed to lookup HTTP host", + zap.String("host", n.Config.HTTPHost), + zap.Error(err), + ) + return err + } + hostIsPublic = !ip.IsLoopback() && !ip.IsPrivate() + + n.Log.Debug("finished HTTP host lookup", + zap.String("host", n.Config.HTTPHost), + zap.Stringer("ip", ip), + zap.Bool("isPublic", hostIsPublic), + ) + } + listenAddress := net.JoinHostPort(n.Config.HTTPHost, strconv.FormatUint(uint64(n.Config.HTTPPort), 10)) listener, err := net.Listen("tcp", listenAddress) if err != nil { return err } + addr := listener.Addr().String() + ipPort, err := ips.ToIPPort(addr) + if err != nil { + return err + } + + // Don't open the HTTP port if the HTTP server is private + if hostIsPublic { + n.Log.Warn("HTTP server is binding to a potentially public host. "+ + "You may be vulnerable to a DoS attack if your HTTP port is publicly accessible", + zap.String("host", n.Config.HTTPHost), + ) + + n.portMapper.Map( + ipPort.Port, + ipPort.Port, + httpPortName, + nil, + n.Config.PublicIPResolutionFreq, + ) + } + protocol := "http" if n.Config.HTTPSEnabled { cert, err := tls.X509KeyPair(n.Config.HTTPSCert, n.Config.HTTPSKey) @@ -1585,6 +1700,8 @@ func (n *Node) shutdown() { zap.Error(err), ) } + n.portMapper.UnmapAllPorts() + n.ipUpdater.Stop() if err := n.indexer.Close(); err != nil { n.Log.Debug("error closing tx indexer", zap.Error(err), From 864dbec3964dd4e0cc9080f19f1b5d1efa773685 Mon Sep 17 00:00:00 2001 From: Stephen Buttolph Date: Sun, 14 Jan 2024 02:03:09 -0500 Subject: [PATCH 37/57] Replace `PeerListAck` with `GetPeerList` (#2580) --- config/config.go | 6 + config/flags.go | 2 + config/keys.go | 2 + genesis/bootstrappers.go | 9 +- message/messages_test.go | 87 ++- message/mock_outbound_message_builder.go | 40 +- message/ops.go | 22 +- message/outbound_msg_builder.go | 61 +- network/README.md | 69 +- network/certs_test.go | 24 + network/config.go | 12 +- network/ip_tracker.go | 364 +++++++++ network/ip_tracker_test.go | 690 +++++++++++++++++ network/network.go | 491 ++++-------- network/network_test.go | 92 +-- network/peer/gossip_tracker.go | 323 -------- network/peer/gossip_tracker_callback.go | 56 -- network/peer/gossip_tracker_metrics.go | 40 - network/peer/gossip_tracker_test.go | 620 --------------- network/peer/network.go | 25 +- network/peer/peer.go | 223 ++++-- network/peer/test_network.go | 16 +- network/test_network.go | 10 +- node/node.go | 13 - proto/p2p/p2p.proto | 45 +- proto/pb/p2p/p2p.pb.go | 943 ++++++++++++----------- utils/bloom/read_filter.go | 17 + utils/constants/networking.go | 2 + utils/ips/claimed_ip_port.go | 44 +- utils/ips/ip_port.go | 5 +- 30 files changed, 2142 insertions(+), 2211 deletions(-) create mode 100644 network/ip_tracker.go create mode 100644 network/ip_tracker_test.go delete mode 100644 network/peer/gossip_tracker.go delete mode 100644 network/peer/gossip_tracker_callback.go delete mode 100644 network/peer/gossip_tracker_metrics.go delete mode 100644 network/peer/gossip_tracker_test.go diff --git a/config/config.go b/config/config.go index e4ae0816c043..5de3e70777b4 100644 --- a/config/config.go +++ b/config/config.go @@ -427,6 +427,8 @@ func getNetworkConfig( PeerListNonValidatorGossipSize: v.GetUint32(NetworkPeerListNonValidatorGossipSizeKey), PeerListPeersGossipSize: v.GetUint32(NetworkPeerListPeersGossipSizeKey), PeerListGossipFreq: v.GetDuration(NetworkPeerListGossipFreqKey), + PeerListPullGossipFreq: v.GetDuration(NetworkPeerListPullGossipFreqKey), + PeerListBloomResetFreq: v.GetDuration(NetworkPeerListBloomResetFreqKey), }, DelayConfig: network.DelayConfig{ @@ -462,6 +464,10 @@ func getNetworkConfig( return network.Config{}, fmt.Errorf("%q must be >= 0", NetworkOutboundConnectionTimeoutKey) case config.PeerListGossipFreq < 0: return network.Config{}, fmt.Errorf("%s must be >= 0", NetworkPeerListGossipFreqKey) + case config.PeerListPullGossipFreq < 0: + return network.Config{}, fmt.Errorf("%s must be >= 0", NetworkPeerListPullGossipFreqKey) + case config.PeerListBloomResetFreq < 0: + return network.Config{}, fmt.Errorf("%s must be >= 0", NetworkPeerListBloomResetFreqKey) case config.ThrottlerConfig.InboundMsgThrottlerConfig.CPUThrottlerConfig.MaxRecheckDelay < constants.MinInboundThrottlerMaxRecheckDelay: return network.Config{}, fmt.Errorf("%s must be >= %d", InboundThrottlerCPUMaxRecheckDelayKey, constants.MinInboundThrottlerMaxRecheckDelay) case config.ThrottlerConfig.InboundMsgThrottlerConfig.DiskThrottlerConfig.MaxRecheckDelay < constants.MinInboundThrottlerMaxRecheckDelay: diff --git a/config/flags.go b/config/flags.go index e98f132da6a5..6f85fedfd33c 100644 --- a/config/flags.go +++ b/config/flags.go @@ -132,6 +132,8 @@ func addNodeFlags(fs *pflag.FlagSet) { fs.Uint(NetworkPeerListNonValidatorGossipSizeKey, constants.DefaultNetworkPeerListNonValidatorGossipSize, "Number of non-validators that the node will gossip peer list to") fs.Uint(NetworkPeerListPeersGossipSizeKey, constants.DefaultNetworkPeerListPeersGossipSize, "Number of total peers (including non-validators and validators) that the node will gossip peer list to") fs.Duration(NetworkPeerListGossipFreqKey, constants.DefaultNetworkPeerListGossipFreq, "Frequency to gossip peers to other nodes") + fs.Duration(NetworkPeerListPullGossipFreqKey, constants.DefaultNetworkPeerListPullGossipFreq, "Frequency to request peers from other nodes") + fs.Duration(NetworkPeerListBloomResetFreqKey, constants.DefaultNetworkPeerListBloomResetFreq, "Frequency to recalculate the bloom filter used to request new peers from other nodes") // Public IP Resolution fs.String(PublicIPKey, "", "Public IP of this node for P2P communication") diff --git a/config/keys.go b/config/keys.go index cdd90bf2b7f8..b2ccc16fc63d 100644 --- a/config/keys.go +++ b/config/keys.go @@ -94,6 +94,8 @@ const ( NetworkPeerListNonValidatorGossipSizeKey = "network-peer-list-non-validator-gossip-size" NetworkPeerListPeersGossipSizeKey = "network-peer-list-peers-gossip-size" NetworkPeerListGossipFreqKey = "network-peer-list-gossip-frequency" + NetworkPeerListPullGossipFreqKey = "network-peer-list-pull-gossip-frequency" + NetworkPeerListBloomResetFreqKey = "network-peer-list-bloom-reset-frequency" NetworkInitialReconnectDelayKey = "network-initial-reconnect-delay" NetworkReadHandshakeTimeoutKey = "network-read-handshake-timeout" NetworkPingTimeoutKey = "network-ping-timeout" diff --git a/genesis/bootstrappers.go b/genesis/bootstrappers.go index cac90bb50301..b3e3a2a24f0c 100644 --- a/genesis/bootstrappers.go +++ b/genesis/bootstrappers.go @@ -36,10 +36,15 @@ type Bootstrapper struct { IP ips.IPDesc `json:"ip"` } +// GetBootstrappers returns all default bootstrappers for the provided network. +func GetBootstrappers(networkID uint32) []Bootstrapper { + networkName := constants.NetworkIDToNetworkName[networkID] + return bootstrappersPerNetwork[networkName] +} + // SampleBootstrappers returns the some beacons this node should connect to func SampleBootstrappers(networkID uint32, count int) []Bootstrapper { - networkName := constants.NetworkIDToNetworkName[networkID] - bootstrappers := bootstrappersPerNetwork[networkName] + bootstrappers := GetBootstrappers(networkID) count = math.Min(count, len(bootstrappers)) s := sampler.NewUniform() diff --git a/message/messages_test.go b/message/messages_test.go index e164e8993007..b259cefa341e 100644 --- a/message/messages_test.go +++ b/message/messages_test.go @@ -142,12 +142,63 @@ func TestMessage(t *testing.T) { bypassThrottling: true, bytesSaved: false, }, + { + desc: "get_peer_list message with no compression", + op: GetPeerListOp, + msg: &p2p.Message{ + Message: &p2p.Message_GetPeerList{ + GetPeerList: &p2p.GetPeerList{ + KnownPeers: &p2p.BloomFilter{ + Filter: make([]byte, 2048), + Salt: make([]byte, 32), + }, + }, + }, + }, + compressionType: compression.TypeNone, + bypassThrottling: false, + bytesSaved: false, + }, + { + desc: "get_peer_list message with gzip compression", + op: GetPeerListOp, + msg: &p2p.Message{ + Message: &p2p.Message_GetPeerList{ + GetPeerList: &p2p.GetPeerList{ + KnownPeers: &p2p.BloomFilter{ + Filter: make([]byte, 2048), + Salt: make([]byte, 32), + }, + }, + }, + }, + compressionType: compression.TypeGzip, + bypassThrottling: false, + bytesSaved: true, + }, + { + desc: "get_peer_list message with zstd compression", + op: GetPeerListOp, + msg: &p2p.Message{ + Message: &p2p.Message_GetPeerList{ + GetPeerList: &p2p.GetPeerList{ + KnownPeers: &p2p.BloomFilter{ + Filter: make([]byte, 2048), + Salt: make([]byte, 32), + }, + }, + }, + }, + compressionType: compression.TypeZstd, + bypassThrottling: false, + bytesSaved: true, + }, { desc: "peer_list message with no compression", op: PeerListOp, msg: &p2p.Message{ - Message: &p2p.Message_PeerList{ - PeerList: &p2p.PeerList{ + Message: &p2p.Message_PeerList_{ + PeerList_: &p2p.PeerList{ ClaimedIpPorts: []*p2p.ClaimedIpPort{ { X509Certificate: testTLSCert.Certificate[0], @@ -168,8 +219,8 @@ func TestMessage(t *testing.T) { desc: "peer_list message with gzip compression", op: PeerListOp, msg: &p2p.Message{ - Message: &p2p.Message_PeerList{ - PeerList: &p2p.PeerList{ + Message: &p2p.Message_PeerList_{ + PeerList_: &p2p.PeerList{ ClaimedIpPorts: []*p2p.ClaimedIpPort{ { X509Certificate: testTLSCert.Certificate[0], @@ -190,8 +241,8 @@ func TestMessage(t *testing.T) { desc: "peer_list message with zstd compression", op: PeerListOp, msg: &p2p.Message{ - Message: &p2p.Message_PeerList{ - PeerList: &p2p.PeerList{ + Message: &p2p.Message_PeerList_{ + PeerList_: &p2p.PeerList{ ClaimedIpPorts: []*p2p.ClaimedIpPort{ { X509Certificate: testTLSCert.Certificate[0], @@ -208,25 +259,6 @@ func TestMessage(t *testing.T) { bypassThrottling: true, bytesSaved: true, }, - { - desc: "peer_list_ack message with no compression", - op: PeerListAckOp, - msg: &p2p.Message{ - Message: &p2p.Message_PeerListAck{ - PeerListAck: &p2p.PeerListAck{ - PeerAcks: []*p2p.PeerAck{ - { - TxId: testID[:], - Timestamp: 1, - }, - }, - }, - }, - }, - compressionType: compression.TypeNone, - bypassThrottling: false, - bytesSaved: false, - }, { desc: "get_state_summary_frontier message with no compression", op: GetStateSummaryFrontierOp, @@ -836,8 +868,9 @@ func TestMessage(t *testing.T) { require.Equal(tv.bypassThrottling, encodedMsg.BypassThrottling()) require.Equal(tv.op, encodedMsg.Op()) - bytesSaved := encodedMsg.BytesSavedCompression() - require.Equal(tv.bytesSaved, bytesSaved > 0) + if bytesSaved := encodedMsg.BytesSavedCompression(); tv.bytesSaved { + require.Greater(bytesSaved, 0) + } parsedMsg, err := mb.parseInbound(encodedMsg.Bytes(), ids.EmptyNodeID, func() {}) require.NoError(err) diff --git a/message/mock_outbound_message_builder.go b/message/mock_outbound_message_builder.go index 50af02669546..21cb518976ae 100644 --- a/message/mock_outbound_message_builder.go +++ b/message/mock_outbound_message_builder.go @@ -232,6 +232,21 @@ func (mr *MockOutboundMsgBuilderMockRecorder) GetAncestors(arg0, arg1, arg2, arg return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAncestors", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).GetAncestors), arg0, arg1, arg2, arg3, arg4) } +// GetPeerList mocks base method. +func (m *MockOutboundMsgBuilder) GetPeerList(arg0, arg1 []byte) (OutboundMessage, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetPeerList", arg0, arg1) + ret0, _ := ret[0].(OutboundMessage) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetPeerList indicates an expected call of GetPeerList. +func (mr *MockOutboundMsgBuilderMockRecorder) GetPeerList(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPeerList", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).GetPeerList), arg0, arg1) +} + // GetStateSummaryFrontier mocks base method. func (m *MockOutboundMsgBuilder) GetStateSummaryFrontier(arg0 ids.ID, arg1 uint32, arg2 time.Duration) (OutboundMessage, error) { m.ctrl.T.Helper() @@ -248,22 +263,22 @@ func (mr *MockOutboundMsgBuilderMockRecorder) GetStateSummaryFrontier(arg0, arg1 } // Handshake mocks base method. -func (m *MockOutboundMsgBuilder) Handshake(arg0 uint32, arg1 uint64, arg2 ips.IPPort, arg3, arg4 string, arg5, arg6, arg7 uint32, arg8 uint64, arg9 []byte, arg10 []ids.ID, arg11, arg12 []uint32) (OutboundMessage, error) { +func (m *MockOutboundMsgBuilder) Handshake(arg0 uint32, arg1 uint64, arg2 ips.IPPort, arg3, arg4 string, arg5, arg6, arg7 uint32, arg8 uint64, arg9 []byte, arg10 []ids.ID, arg11, arg12 []uint32, arg13, arg14 []byte) (OutboundMessage, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Handshake", arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12) + ret := m.ctrl.Call(m, "Handshake", arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14) ret0, _ := ret[0].(OutboundMessage) ret1, _ := ret[1].(error) return ret0, ret1 } // Handshake indicates an expected call of Handshake. -func (mr *MockOutboundMsgBuilderMockRecorder) Handshake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12 interface{}) *gomock.Call { +func (mr *MockOutboundMsgBuilderMockRecorder) Handshake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Handshake", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).Handshake), arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Handshake", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).Handshake), arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14) } // PeerList mocks base method. -func (m *MockOutboundMsgBuilder) PeerList(arg0 []ips.ClaimedIPPort, arg1 bool) (OutboundMessage, error) { +func (m *MockOutboundMsgBuilder) PeerList(arg0 []*ips.ClaimedIPPort, arg1 bool) (OutboundMessage, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "PeerList", arg0, arg1) ret0, _ := ret[0].(OutboundMessage) @@ -277,21 +292,6 @@ func (mr *MockOutboundMsgBuilderMockRecorder) PeerList(arg0, arg1 interface{}) * return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PeerList", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).PeerList), arg0, arg1) } -// PeerListAck mocks base method. -func (m *MockOutboundMsgBuilder) PeerListAck(arg0 []*p2p.PeerAck) (OutboundMessage, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "PeerListAck", arg0) - ret0, _ := ret[0].(OutboundMessage) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// PeerListAck indicates an expected call of PeerListAck. -func (mr *MockOutboundMsgBuilderMockRecorder) PeerListAck(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PeerListAck", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).PeerListAck), arg0) -} - // Ping mocks base method. func (m *MockOutboundMsgBuilder) Ping(arg0 uint32, arg1 []*p2p.SubnetUptime) (OutboundMessage, error) { m.ctrl.T.Helper() diff --git a/message/ops.go b/message/ops.go index 2f496713e419..0c58eb60690b 100644 --- a/message/ops.go +++ b/message/ops.go @@ -22,8 +22,8 @@ const ( PingOp Op = iota PongOp HandshakeOp + GetPeerListOp PeerListOp - PeerListAckOp // State sync: GetStateSummaryFrontierOp GetStateSummaryFrontierFailedOp @@ -72,8 +72,8 @@ var ( PingOp, PongOp, HandshakeOp, + GetPeerListOp, PeerListOp, - PeerListAckOp, } // List of all consensus request message types @@ -211,10 +211,10 @@ func (op Op) String() string { return "pong" case HandshakeOp: return "handshake" + case GetPeerListOp: + return "get_peerlist" case PeerListOp: return "peerlist" - case PeerListAckOp: - return "peerlist_ack" // State sync case GetStateSummaryFrontierOp: return "get_state_summary_frontier" @@ -305,10 +305,10 @@ func Unwrap(m *p2p.Message) (fmt.Stringer, error) { return msg.Pong, nil case *p2p.Message_Handshake: return msg.Handshake, nil - case *p2p.Message_PeerList: - return msg.PeerList, nil - case *p2p.Message_PeerListAck: - return msg.PeerListAck, nil + case *p2p.Message_GetPeerList: + return msg.GetPeerList, nil + case *p2p.Message_PeerList_: + return msg.PeerList_, nil // State sync: case *p2p.Message_GetStateSummaryFrontier: return msg.GetStateSummaryFrontier, nil @@ -364,10 +364,10 @@ func ToOp(m *p2p.Message) (Op, error) { return PongOp, nil case *p2p.Message_Handshake: return HandshakeOp, nil - case *p2p.Message_PeerList: + case *p2p.Message_GetPeerList: + return GetPeerListOp, nil + case *p2p.Message_PeerList_: return PeerListOp, nil - case *p2p.Message_PeerListAck: - return PeerListAckOp, nil case *p2p.Message_GetStateSummaryFrontier: return GetStateSummaryFrontierOp, nil case *p2p.Message_StateSummaryFrontier_: diff --git a/message/outbound_msg_builder.go b/message/outbound_msg_builder.go index f50f5cf6ae5d..150c9f4f3a65 100644 --- a/message/outbound_msg_builder.go +++ b/message/outbound_msg_builder.go @@ -32,15 +32,18 @@ type OutboundMsgBuilder interface { trackedSubnets []ids.ID, supportedACPs []uint32, objectedACPs []uint32, + knownPeersFilter []byte, + knownPeersSalt []byte, ) (OutboundMessage, error) - PeerList( - peers []ips.ClaimedIPPort, - bypassThrottling bool, + GetPeerList( + knownPeersFilter []byte, + knownPeersSalt []byte, ) (OutboundMessage, error) - PeerListAck( - peerAcks []*p2p.PeerAck, + PeerList( + peers []*ips.ClaimedIPPort, + bypassThrottling bool, ) (OutboundMessage, error) Ping( @@ -244,6 +247,8 @@ func (b *outMsgBuilder) Handshake( trackedSubnets []ids.ID, supportedACPs []uint32, objectedACPs []uint32, + knownPeersFilter []byte, + knownPeersSalt []byte, ) (OutboundMessage, error) { subnetIDBytes := make([][]byte, len(trackedSubnets)) encodeIDs(trackedSubnets, subnetIDBytes) @@ -267,6 +272,10 @@ func (b *outMsgBuilder) Handshake( }, SupportedAcps: supportedACPs, ObjectedAcps: objectedACPs, + KnownPeers: &p2p.BloomFilter{ + Filter: knownPeersFilter, + Salt: knownPeersSalt, + }, }, }, }, @@ -275,7 +284,27 @@ func (b *outMsgBuilder) Handshake( ) } -func (b *outMsgBuilder) PeerList(peers []ips.ClaimedIPPort, bypassThrottling bool) (OutboundMessage, error) { +func (b *outMsgBuilder) GetPeerList( + knownPeersFilter []byte, + knownPeersSalt []byte, +) (OutboundMessage, error) { + return b.builder.createOutbound( + &p2p.Message{ + Message: &p2p.Message_GetPeerList{ + GetPeerList: &p2p.GetPeerList{ + KnownPeers: &p2p.BloomFilter{ + Filter: knownPeersFilter, + Salt: knownPeersSalt, + }, + }, + }, + }, + b.compressionType, + false, + ) +} + +func (b *outMsgBuilder) PeerList(peers []*ips.ClaimedIPPort, bypassThrottling bool) (OutboundMessage, error) { claimIPPorts := make([]*p2p.ClaimedIpPort, len(peers)) for i, p := range peers { claimIPPorts[i] = &p2p.ClaimedIpPort{ @@ -284,13 +313,13 @@ func (b *outMsgBuilder) PeerList(peers []ips.ClaimedIPPort, bypassThrottling boo IpPort: uint32(p.IPPort.Port), Timestamp: p.Timestamp, Signature: p.Signature, - TxId: p.TxID[:], + TxId: ids.Empty[:], } } return b.builder.createOutbound( &p2p.Message{ - Message: &p2p.Message_PeerList{ - PeerList: &p2p.PeerList{ + Message: &p2p.Message_PeerList_{ + PeerList_: &p2p.PeerList{ ClaimedIpPorts: claimIPPorts, }, }, @@ -300,20 +329,6 @@ func (b *outMsgBuilder) PeerList(peers []ips.ClaimedIPPort, bypassThrottling boo ) } -func (b *outMsgBuilder) PeerListAck(peerAcks []*p2p.PeerAck) (OutboundMessage, error) { - return b.builder.createOutbound( - &p2p.Message{ - Message: &p2p.Message_PeerListAck{ - PeerListAck: &p2p.PeerListAck{ - PeerAcks: peerAcks, - }, - }, - }, - compression.TypeNone, - false, - ) -} - func (b *outMsgBuilder) GetStateSummaryFrontier( chainID ids.ID, requestID uint32, diff --git a/network/README.md b/network/README.md index 5e66e2e25f4f..303d1f56ab82 100644 --- a/network/README.md +++ b/network/README.md @@ -46,7 +46,7 @@ When starting an Avalanche node, a node needs to be able to initiate some proces In Avalanche, nodes connect to an initial set of bootstrapper nodes known as **beacons** (this is user-configurable). Once connected to a set of beacons, a node is able to discover other nodes in the network. Over time, a node eventually discovers other peers in the network through `PeerList` messages it receives through: - The handshake initiated between two peers when attempting to connect to a peer (see [Connecting](#connecting)). -- Periodic `PeerList` gossip messages that every peer sends to the peers it's connected to (see [Connected](#connected)). +- Responses to periodically sent `GetPeerList` messages requesting a `PeerList` of unknown peers (see [Connected](#connected)). #### Connecting @@ -79,7 +79,6 @@ Note right of Peer: LGTM! Note over Node,Peer: PeerList message Peer->>Node: Peer-X, Peer-Y, Peer-Z Note over Node,Peer: Handshake Complete -Node->>Peer: ACK Peer-X, Peer-Y, Peer-Z ``` Once the node attempting to join the network receives this `PeerList` message, the handshake is complete and the node is now connected to the peer. The node attempts to connect to the new peers discovered in the `PeerList` message. Each connection results in another peer handshake, which results in the node incrementally discovering more and more peers in the network as more and more `PeerList` messages are exchanged. @@ -92,71 +91,53 @@ Some peers aren't discovered through the `PeerList` messages exchanged through p sequenceDiagram Node ->> Peer-1: Handshake - v1.9.5 Peer-1 ->> Node: PeerList - Peer-2 -Node ->> Peer-1: ACK - Peer-2 Note left of Node: Node is connected to Peer-1 and now tries to connect to Peer-2. Node ->> Peer-2: Handshake - v1.9.5 Peer-2 ->> Node: PeerList - Peer-1 -Node ->> Peer-2: ACK - Peer-1 Note left of Node: Peer-3 was never sampled, so we haven't connected yet! Node --> Peer-3: No connection ``` -To guarantee that a node can discover all peers, each node periodically gossips a sample of the peers it knows about to other peers. +To guarantee that a node can discover all peers, each node periodically sends a `GetPeerList` message to a random peer. ##### PeerList Gossip ###### Messages -A `PeerList` is the message that is used to communicate the presence of peers in the network. Each `PeerList` message contains networking-level metadata about the peer that provides the necessary information to connect to it, alongside the corresponding transaction id that added that peer to the validator set. Transaction ids are unique hashes that only add a single validator, so it is guaranteed that there is a 1:1 mapping between a validator and its associated transaction id. +A `GetPeerList` message requests that the peer sends a `PeerList` message. `GetPeerList` messages contain a bloom filter of already known peers to reduce useless bandwidth on `PeerList` messages. The bloom filter reduces bandwidth by enabling the `PeerList` message to only include peers that aren't already known. -`PeerListAck` messages are sent in response to `PeerList` messages to allow a peer to confirm which peers it will actually attempt to connect to. Because nodes only gossip peers they believe another peer doesn't already know about to optimize bandwidth, `PeerListAck` messages are important to confirm that a peer will attempt to connect to someone. Without this, a node might gossip a peer to another peer and assume a connection between the two is being established, and not re-gossip the peer in future gossip cycles. If the connection was never actually wanted by the peer being gossiped to due to a transient reason, that peer would never be able to re-discover the gossiped peer and could be isolated from a subset of the network. +A `PeerList` is the message that is used to communicate the presence of peers in the network. Each `PeerList` message contains signed networking-level metadata about a peer that provides the necessary information to connect to it. -Once a `PeerListAck` message is received from a peer, the node that sent the original `PeerList` message marks the corresponding acknowledged validators as already having been transmitted to the peer, so that it's excluded from subsequent iterations of `PeerList` gossip. +Once peer metadata is received, the node will add that data to its bloom filter to prevent learning about it again. ###### Gossip Handshake messages provide a node with some knowledge of peers in the network, but offers no guarantee that learning about a subset of peers from each peer the node connects with will result in the node learning about every peer in the network. -In order to provide a probabilistic guarantee that all peers in the network will eventually learn of one another, each node periodically gossips a sample of the peers that they're aware of to a sample of the peers that they're connected to. Over time, this probabilistically guarantees that every peer will eventually learn of every other peer. +To provide an eventual guarantee that all peers learn of one another, each node periodically requests peers from a random peer. -To optimize bandwidth usage, each node tracks which peers are guaranteed to know of which peers. A node learns this information by tracking both inbound and outbound `PeerList` gossip. +To optimize bandwidth, each node tracks the most recent IPs of validators. The validator's nodeID and timestamp are inserted into a bloom filter which is used to select only necessary IPs to gossip. -- Inbound - - If a node ever receives `PeerList` from a peer, that peer _must_ have known about the peers in that `PeerList` message in order to have gossiped them. -- Outbound - - If a node sends a `PeerList` to a peer and the peer replies with an `PeerListAck` message, then all peers in the `PeerListAck` must be known by the peer. +As the number of entries increases in the bloom filter, the probability of a false positive increases. False positives can cause recent IPs not to be gossiped when they otherwise should be, slowing down the rate of `PeerList` gossip. To prevent the bloom filter from having too many false positives, a new bloom filter is periodically generated and the number of entries a validator is allowed to have in the bloom filter is capped. Generating the new bloom filter both removes stale entries and modifies the hash functions to avoid persistent hash collisions. -To efficiently track which peers know of which peers, the peers that each peer is aware of is represented in a [bit set](https://en.wikipedia.org/wiki/Bit_array). A peer is represented by either a `0` if it isn't known by the peer yet, or a `1` if it is known by the peer. - -A node follows the following steps for every cycle of `PeerList` gossip: - -1. Get a sample of peers in the network that the node is connected to -2. For each peer: - 1. Figure out which peers the node hasn't gossiped to them yet. - 2. Take a random sample of these unknown peers. - 3. Send a message describing these peers to the peer. +A node follows the following steps for of `PeerList` gossip: ```mermaid sequenceDiagram -Note left of Node: Initialize gossip bit set for Peer-123 -Note left of Node: Peer-123: [0, 0, 0] -Node->>Peer-123: PeerList - Peer-1 -Peer-123->>Node: PeerListAck - Peer-1 -Note left of Node: Peer-123: [1, 0, 0] -Node->>Peer-123: PeerList - Peer-3 -Peer-123->>Node: PeerListAck - Peer-3 -Note left of Node: Peer-123: [1, 0, 1] -Node->>Peer-123: PeerList - Peer-2 -Peer-123->>Node: PeerListAck - Peer-2 -Note left of Node: Peer-123: [1, 1, 1] -Note left of Node: No more gossip left to send to Peer-123! +Note left of Node: Initialize bloom filter +Note left of Node: Bloom: [0, 0, 0] +Node->>Peer-123: GetPeerList [0, 0, 0] +Note right of Peer-123: Any peers can be sent. +Peer-123->>Node: PeerList - Peer-1 +Note left of Node: Bloom: [1, 0, 0] +Node->>Peer-123: GetPeerList [1, 0, 0] +Note right of Peer-123: Either Peer-2 or Peer-3 can be sent. +Peer-123->>Node: PeerList - Peer-3 +Note left of Node: Bloom: [1, 0, 1] +Node->>Peer-123: GetPeerList [1, 0, 1] +Note right of Peer-123: Only Peer-2 can be sent. +Peer-123->>Node: PeerList - Peer-2 +Note left of Node: Bloom: [1, 1, 1] +Node->>Peer-123: GetPeerList [1, 1, 1] +Note right of Peer-123: There are no more peers left to send! ``` - -Because network state is generally expected to be stable (i.e nodes are not continuously flickering online/offline), as more and more gossip messages are exchanged nodes eventually realize that the peers that they are connected to have learned about every other peer. - -A node eventually stops gossiping peers when there's no more new peers to gossip about. `PeerList` gossip only resumes once: - -1. a new peer joins -2. a peer disconnects and reconnects -3. a new validator joins the network -4. a validator's IP is updated diff --git a/network/certs_test.go b/network/certs_test.go index 7b59e11d800c..d172d68650fc 100644 --- a/network/certs_test.go +++ b/network/certs_test.go @@ -5,6 +5,7 @@ package network import ( "crypto/tls" + "net" "sync" "testing" @@ -15,6 +16,7 @@ import ( "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/network/peer" "github.com/ava-labs/avalanchego/staking" + "github.com/ava-labs/avalanchego/utils/ips" ) var ( @@ -31,6 +33,9 @@ var ( //go:embed test_key_3.key testKeyBytes3 []byte + ip *ips.ClaimedIPPort + otherIP *ips.ClaimedIPPort + certLock sync.Mutex tlsCerts []*tls.Certificate tlsConfigs []*tls.Config @@ -52,6 +57,25 @@ func init() { tlsCerts = []*tls.Certificate{ cert1, cert2, cert3, } + + ip = ips.NewClaimedIPPort( + staking.CertificateFromX509(cert1.Leaf), + ips.IPPort{ + IP: net.IPv4(127, 0, 0, 1), + Port: 9651, + }, + 1, // timestamp + nil, // signature + ) + otherIP = ips.NewClaimedIPPort( + staking.CertificateFromX509(cert2.Leaf), + ips.IPPort{ + IP: net.IPv4(127, 0, 0, 1), + Port: 9651, + }, + 1, // timestamp + nil, // signature + ) } func getTLS(t *testing.T, index int) (ids.NodeID, *tls.Certificate, *tls.Config) { diff --git a/network/config.go b/network/config.go index eda7257fa62c..5cb014741f56 100644 --- a/network/config.go +++ b/network/config.go @@ -10,7 +10,6 @@ import ( "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/network/dialer" - "github.com/ava-labs/avalanchego/network/peer" "github.com/ava-labs/avalanchego/network/throttling" "github.com/ava-labs/avalanchego/snow/networking/tracker" "github.com/ava-labs/avalanchego/snow/uptime" @@ -73,6 +72,14 @@ type PeerListGossipConfig struct { // PeerListGossipFreq is the frequency that this node will attempt to gossip // signed IPs to its peers. PeerListGossipFreq time.Duration `json:"peerListGossipFreq"` + + // PeerListPullGossipFreq is the frequency that this node will attempt to + // request signed IPs from its peers. + PeerListPullGossipFreq time.Duration `json:"peerListPullGossipFreq"` + + // PeerListBloomResetFreq is how frequently this node will recalculate the + // IP tracker's bloom filter. + PeerListBloomResetFreq time.Duration `json:"peerListBloomResetFreq"` } type TimeoutConfig struct { @@ -182,7 +189,4 @@ type Config struct { // Specifies how much disk usage each peer can cause before // we rate-limit them. DiskTargeter tracker.Targeter `json:"-"` - - // Tracks which validators have been sent to which peers - GossipTracker peer.GossipTracker `json:"-"` } diff --git a/network/ip_tracker.go b/network/ip_tracker.go new file mode 100644 index 000000000000..7bc6cb293810 --- /dev/null +++ b/network/ip_tracker.go @@ -0,0 +1,364 @@ +// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +package network + +import ( + "crypto/rand" + "sync" + + "go.uber.org/zap" + + "golang.org/x/exp/maps" + + "github.com/ava-labs/avalanchego/ids" + "github.com/ava-labs/avalanchego/snow/validators" + "github.com/ava-labs/avalanchego/utils/bloom" + "github.com/ava-labs/avalanchego/utils/crypto/bls" + "github.com/ava-labs/avalanchego/utils/ips" + "github.com/ava-labs/avalanchego/utils/logging" + "github.com/ava-labs/avalanchego/utils/math" + "github.com/ava-labs/avalanchego/utils/sampler" + "github.com/ava-labs/avalanchego/utils/set" +) + +const ( + saltSize = 32 + minCountEstimate = 128 + targetFalsePositiveProbability = .001 + maxFalsePositiveProbability = .01 + // By setting maxIPEntriesPerValidator > 1, we allow validators to update + // their IP at least once per bloom filter reset. + maxIPEntriesPerValidator = 2 +) + +var _ validators.SetCallbackListener = (*ipTracker)(nil) + +func newIPTracker(log logging.Logger) (*ipTracker, error) { + tracker := &ipTracker{ + log: log, + connected: make(map[ids.NodeID]*ips.ClaimedIPPort), + mostRecentValidatorIPs: make(map[ids.NodeID]*ips.ClaimedIPPort), + gossipableIndicies: make(map[ids.NodeID]int), + bloomAdditions: make(map[ids.NodeID]int), + } + return tracker, tracker.resetBloom() +} + +type ipTracker struct { + log logging.Logger + + lock sync.RWMutex + // Manually tracked nodes are always treated like validators + manuallyTracked set.Set[ids.NodeID] + // Connected tracks the currently connected peers, including validators and + // non-validators. The IP is not necessarily the same IP as in + // mostRecentIPs. + connected map[ids.NodeID]*ips.ClaimedIPPort + mostRecentValidatorIPs map[ids.NodeID]*ips.ClaimedIPPort + validators set.Set[ids.NodeID] + + // An IP is marked as gossipable if: + // - The node is a validator + // - The node is connected + // - The IP the node connected with is its latest IP + gossipableIndicies map[ids.NodeID]int + gossipableIPs []*ips.ClaimedIPPort + + // The bloom filter contains the most recent validator IPs to avoid + // unnecessary IP gossip. + bloom *bloom.Filter + // To prevent validators from causing the bloom filter to have too many + // false positives, we limit each validator to maxIPEntriesPerValidator in + // the bloom filter. + bloomAdditions map[ids.NodeID]int // Number of IPs added to the bloom + bloomSalt []byte + maxBloomCount int +} + +func (i *ipTracker) ManuallyTrack(nodeID ids.NodeID) { + i.lock.Lock() + defer i.lock.Unlock() + + // We treat manually tracked nodes as if they were validators. + if !i.validators.Contains(nodeID) { + i.onValidatorAdded(nodeID) + } + // Now that the node is marked as a validator, freeze it's validation + // status. Future calls to OnValidatorAdded or OnValidatorRemoved will be + // treated as noops. + i.manuallyTracked.Add(nodeID) +} + +func (i *ipTracker) WantsConnection(nodeID ids.NodeID) bool { + i.lock.RLock() + defer i.lock.RUnlock() + + return i.validators.Contains(nodeID) +} + +func (i *ipTracker) ShouldVerifyIP(ip *ips.ClaimedIPPort) bool { + i.lock.RLock() + defer i.lock.RUnlock() + + if !i.validators.Contains(ip.NodeID) { + return false + } + + prevIP, ok := i.mostRecentValidatorIPs[ip.NodeID] + return !ok || // This would be the first IP + prevIP.Timestamp < ip.Timestamp // This would be a newer IP +} + +// AddIP returns true if the addition of the provided IP updated the most +// recently known IP of a validator. +func (i *ipTracker) AddIP(ip *ips.ClaimedIPPort) bool { + i.lock.Lock() + defer i.lock.Unlock() + + if !i.validators.Contains(ip.NodeID) { + return false + } + + prevIP, ok := i.mostRecentValidatorIPs[ip.NodeID] + if !ok { + // This is the first IP we've heard from the validator, so it is the + // most recent. + i.updateMostRecentValidatorIP(ip) + // Because we didn't previously have an IP, we know we aren't currently + // connected to them. + return true + } + + if prevIP.Timestamp >= ip.Timestamp { + // This IP is not newer than the previously known IP. + return false + } + + i.updateMostRecentValidatorIP(ip) + i.removeGossipableIP(ip.NodeID) + return true +} + +func (i *ipTracker) GetIP(nodeID ids.NodeID) (*ips.ClaimedIPPort, bool) { + i.lock.RLock() + defer i.lock.RUnlock() + + ip, ok := i.mostRecentValidatorIPs[nodeID] + return ip, ok +} + +func (i *ipTracker) Connected(ip *ips.ClaimedIPPort) { + i.lock.Lock() + defer i.lock.Unlock() + + i.connected[ip.NodeID] = ip + if !i.validators.Contains(ip.NodeID) { + return + } + + prevIP, ok := i.mostRecentValidatorIPs[ip.NodeID] + if !ok { + // This is the first IP we've heard from the validator, so it is the + // most recent. + i.updateMostRecentValidatorIP(ip) + i.addGossipableIP(ip) + return + } + + if prevIP.Timestamp > ip.Timestamp { + // There is a more up-to-date IP than the one that was used to connect. + return + } + + if prevIP.Timestamp < ip.Timestamp { + i.updateMostRecentValidatorIP(ip) + } + i.addGossipableIP(ip) +} + +func (i *ipTracker) Disconnected(nodeID ids.NodeID) { + i.lock.Lock() + defer i.lock.Unlock() + + delete(i.connected, nodeID) + i.removeGossipableIP(nodeID) +} + +func (i *ipTracker) OnValidatorAdded(nodeID ids.NodeID, _ *bls.PublicKey, _ ids.ID, _ uint64) { + i.lock.Lock() + defer i.lock.Unlock() + + i.onValidatorAdded(nodeID) +} + +func (i *ipTracker) onValidatorAdded(nodeID ids.NodeID) { + if i.manuallyTracked.Contains(nodeID) { + return + } + + i.validators.Add(nodeID) + ip, connected := i.connected[nodeID] + if !connected { + return + } + + // Because we only track validator IPs, the from the connection is + // guaranteed to be the most up-to-date IP that we know. + i.updateMostRecentValidatorIP(ip) + i.addGossipableIP(ip) +} + +func (*ipTracker) OnValidatorWeightChanged(ids.NodeID, uint64, uint64) {} + +func (i *ipTracker) OnValidatorRemoved(nodeID ids.NodeID, _ uint64) { + i.lock.Lock() + defer i.lock.Unlock() + + if i.manuallyTracked.Contains(nodeID) { + return + } + + delete(i.mostRecentValidatorIPs, nodeID) + i.validators.Remove(nodeID) + i.removeGossipableIP(nodeID) +} + +func (i *ipTracker) updateMostRecentValidatorIP(ip *ips.ClaimedIPPort) { + i.mostRecentValidatorIPs[ip.NodeID] = ip + oldCount := i.bloomAdditions[ip.NodeID] + if oldCount >= maxIPEntriesPerValidator { + return + } + + // If the validator set is growing rapidly, we should increase the size of + // the bloom filter. + if count := i.bloom.Count(); count >= i.maxBloomCount { + if err := i.resetBloom(); err != nil { + i.log.Error("failed to reset validator tracker bloom filter", + zap.Int("maxCount", i.maxBloomCount), + zap.Int("currentCount", count), + zap.Error(err), + ) + } else { + i.log.Info("reset validator tracker bloom filter", + zap.Int("currentCount", count), + ) + } + return + } + + i.bloomAdditions[ip.NodeID] = oldCount + 1 + bloom.Add(i.bloom, ip.GossipID[:], i.bloomSalt) +} + +func (i *ipTracker) addGossipableIP(ip *ips.ClaimedIPPort) { + i.gossipableIndicies[ip.NodeID] = len(i.gossipableIPs) + i.gossipableIPs = append(i.gossipableIPs, ip) +} + +func (i *ipTracker) removeGossipableIP(nodeID ids.NodeID) { + indexToRemove, wasGossipable := i.gossipableIndicies[nodeID] + if !wasGossipable { + return + } + + newNumGossipable := len(i.gossipableIPs) - 1 + if newNumGossipable != indexToRemove { + replacementIP := i.gossipableIPs[newNumGossipable] + i.gossipableIndicies[replacementIP.NodeID] = indexToRemove + i.gossipableIPs[indexToRemove] = replacementIP + } + + delete(i.gossipableIndicies, nodeID) + i.gossipableIPs[newNumGossipable] = nil + i.gossipableIPs = i.gossipableIPs[:newNumGossipable] +} + +// GetGossipableIPs returns the latest IPs of connected validators. The returned +// IPs will not contain [exceptNodeID] or any IPs contained in [exceptIPs]. If +// the number of eligible IPs to return low, it's possible that every IP will be +// iterated over while handling this call. +func (i *ipTracker) GetGossipableIPs( + exceptNodeID ids.NodeID, + exceptIPs *bloom.ReadFilter, + salt []byte, + maxNumIPs int, +) []*ips.ClaimedIPPort { + var ( + uniform = sampler.NewUniform() + ips = make([]*ips.ClaimedIPPort, 0, maxNumIPs) + ) + + i.lock.RLock() + defer i.lock.RUnlock() + + uniform.Initialize(uint64(len(i.gossipableIPs))) + for len(ips) < maxNumIPs { + index, err := uniform.Next() + if err != nil { + return ips + } + + ip := i.gossipableIPs[index] + if ip.NodeID == exceptNodeID { + continue + } + + if !bloom.Contains(exceptIPs, ip.GossipID[:], salt) { + ips = append(ips, ip) + } + } + return ips +} + +// ResetBloom prunes the current bloom filter. This must be called periodically +// to ensure that validators that change their IPs are updated correctly and +// that validators that left the validator set are removed. +func (i *ipTracker) ResetBloom() error { + i.lock.Lock() + defer i.lock.Unlock() + + return i.resetBloom() +} + +// Bloom returns the binary representation of the bloom filter along with the +// random salt. +func (i *ipTracker) Bloom() ([]byte, []byte) { + i.lock.RLock() + defer i.lock.RUnlock() + + return i.bloom.Marshal(), i.bloomSalt +} + +// resetBloom creates a new bloom filter with a reasonable size for the current +// validator set size. This function additionally populates the new bloom filter +// with the current most recently known IPs of validators. +func (i *ipTracker) resetBloom() error { + newSalt := make([]byte, saltSize) + _, err := rand.Reader.Read(newSalt) + if err != nil { + return err + } + + count := math.Max(maxIPEntriesPerValidator*i.validators.Len(), minCountEstimate) + numHashes, numEntries := bloom.OptimalParameters( + count, + targetFalsePositiveProbability, + ) + newFilter, err := bloom.New(numHashes, numEntries) + if err != nil { + return err + } + + i.bloom = newFilter + maps.Clear(i.bloomAdditions) + i.bloomSalt = newSalt + i.maxBloomCount = bloom.EstimateCount(numHashes, numEntries, maxFalsePositiveProbability) + + for nodeID, ip := range i.mostRecentValidatorIPs { + bloom.Add(newFilter, ip.GossipID[:], newSalt) + i.bloomAdditions[nodeID] = 1 + } + return nil +} diff --git a/network/ip_tracker_test.go b/network/ip_tracker_test.go new file mode 100644 index 000000000000..882c0a47ce8c --- /dev/null +++ b/network/ip_tracker_test.go @@ -0,0 +1,690 @@ +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +package network + +import ( + "testing" + + "github.com/stretchr/testify/require" + + "github.com/ava-labs/avalanchego/ids" + "github.com/ava-labs/avalanchego/utils/bloom" + "github.com/ava-labs/avalanchego/utils/ips" + "github.com/ava-labs/avalanchego/utils/logging" +) + +func newTestIPTracker(t *testing.T) *ipTracker { + tracker, err := newIPTracker(logging.NoLog{}) + require.NoError(t, err) + return tracker +} + +func newerTestIP(ip *ips.ClaimedIPPort) *ips.ClaimedIPPort { + return ips.NewClaimedIPPort( + ip.Cert, + ip.IPPort, + ip.Timestamp+1, + ip.Signature, + ) +} + +func requireEqual(t *testing.T, expected, actual *ipTracker) { + require := require.New(t) + require.Equal(expected.manuallyTracked, actual.manuallyTracked) + require.Equal(expected.connected, actual.connected) + require.Equal(expected.mostRecentValidatorIPs, actual.mostRecentValidatorIPs) + require.Equal(expected.validators, actual.validators) + require.Equal(expected.gossipableIndicies, actual.gossipableIndicies) + require.Equal(expected.gossipableIPs, actual.gossipableIPs) + require.Equal(expected.bloomAdditions, actual.bloomAdditions) + require.Equal(expected.maxBloomCount, actual.maxBloomCount) +} + +func TestIPTracker_ManuallyTrack(t *testing.T) { + tests := []struct { + name string + initialState *ipTracker + nodeID ids.NodeID + expectedState *ipTracker + }{ + { + name: "non-connected non-validator", + initialState: newTestIPTracker(t), + nodeID: ip.NodeID, + expectedState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.validators.Add(ip.NodeID) + tracker.manuallyTracked.Add(ip.NodeID) + return tracker + }(), + }, + { + name: "connected non-validator", + initialState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.Connected(ip) + return tracker + }(), + nodeID: ip.NodeID, + expectedState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.Connected(ip) + tracker.mostRecentValidatorIPs[ip.NodeID] = ip + tracker.bloomAdditions[ip.NodeID] = 1 + tracker.gossipableIndicies[ip.NodeID] = 0 + tracker.gossipableIPs = []*ips.ClaimedIPPort{ + ip, + } + tracker.validators.Add(ip.NodeID) + tracker.manuallyTracked.Add(ip.NodeID) + return tracker + }(), + }, + { + name: "non-connected validator", + initialState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.onValidatorAdded(ip.NodeID) + return tracker + }(), + nodeID: ip.NodeID, + expectedState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.onValidatorAdded(ip.NodeID) + tracker.manuallyTracked.Add(ip.NodeID) + return tracker + }(), + }, + { + name: "connected validator", + initialState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.Connected(ip) + tracker.onValidatorAdded(ip.NodeID) + return tracker + }(), + nodeID: ip.NodeID, + expectedState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.Connected(ip) + tracker.onValidatorAdded(ip.NodeID) + tracker.manuallyTracked.Add(ip.NodeID) + return tracker + }(), + }, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + test.initialState.ManuallyTrack(test.nodeID) + requireEqual(t, test.expectedState, test.initialState) + }) + } +} + +func TestIPTracker_AddIP(t *testing.T) { + newerIP := newerTestIP(ip) + tests := []struct { + name string + initialState *ipTracker + ip *ips.ClaimedIPPort + expectedUpdated bool + expectedState *ipTracker + }{ + { + name: "non-validator", + initialState: newTestIPTracker(t), + ip: ip, + expectedUpdated: false, + expectedState: newTestIPTracker(t), + }, + { + name: "first known IP", + initialState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.onValidatorAdded(ip.NodeID) + return tracker + }(), + ip: ip, + expectedUpdated: true, + expectedState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.onValidatorAdded(ip.NodeID) + tracker.mostRecentValidatorIPs[ip.NodeID] = ip + tracker.bloomAdditions[ip.NodeID] = 1 + return tracker + }(), + }, + { + name: "older IP", + initialState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.onValidatorAdded(newerIP.NodeID) + require.True(t, tracker.AddIP(newerIP)) + return tracker + }(), + ip: ip, + expectedUpdated: false, + expectedState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.onValidatorAdded(newerIP.NodeID) + require.True(t, tracker.AddIP(newerIP)) + return tracker + }(), + }, + { + name: "same IP", + initialState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.onValidatorAdded(ip.NodeID) + require.True(t, tracker.AddIP(ip)) + return tracker + }(), + ip: ip, + expectedUpdated: false, + expectedState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.onValidatorAdded(ip.NodeID) + require.True(t, tracker.AddIP(ip)) + return tracker + }(), + }, + { + name: "disconnected newer IP", + initialState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.onValidatorAdded(ip.NodeID) + require.True(t, tracker.AddIP(ip)) + return tracker + }(), + ip: newerIP, + expectedUpdated: true, + expectedState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.onValidatorAdded(ip.NodeID) + require.True(t, tracker.AddIP(ip)) + tracker.mostRecentValidatorIPs[newerIP.NodeID] = newerIP + tracker.bloomAdditions[newerIP.NodeID] = 2 + return tracker + }(), + }, + { + name: "connected newer IP", + initialState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.onValidatorAdded(ip.NodeID) + tracker.Connected(ip) + return tracker + }(), + ip: newerIP, + expectedUpdated: true, + expectedState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.onValidatorAdded(ip.NodeID) + tracker.Connected(ip) + tracker.mostRecentValidatorIPs[newerIP.NodeID] = newerIP + tracker.bloomAdditions[newerIP.NodeID] = 2 + delete(tracker.gossipableIndicies, newerIP.NodeID) + tracker.gossipableIPs = tracker.gossipableIPs[:0] + return tracker + }(), + }, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + updated := test.initialState.AddIP(test.ip) + require.Equal(t, test.expectedUpdated, updated) + requireEqual(t, test.expectedState, test.initialState) + }) + } +} + +func TestIPTracker_Connected(t *testing.T) { + newerIP := newerTestIP(ip) + tests := []struct { + name string + initialState *ipTracker + ip *ips.ClaimedIPPort + expectedState *ipTracker + }{ + { + name: "non-validator", + initialState: newTestIPTracker(t), + ip: ip, + expectedState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.connected[ip.NodeID] = ip + return tracker + }(), + }, + { + name: "first known IP", + initialState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.onValidatorAdded(ip.NodeID) + return tracker + }(), + ip: ip, + expectedState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.onValidatorAdded(ip.NodeID) + tracker.connected[ip.NodeID] = ip + tracker.mostRecentValidatorIPs[ip.NodeID] = ip + tracker.bloomAdditions[ip.NodeID] = 1 + tracker.gossipableIndicies[ip.NodeID] = 0 + tracker.gossipableIPs = []*ips.ClaimedIPPort{ + ip, + } + return tracker + }(), + }, + { + name: "connected with older IP", + initialState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.onValidatorAdded(newerIP.NodeID) + require.True(t, tracker.AddIP(newerIP)) + return tracker + }(), + ip: ip, + expectedState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.onValidatorAdded(newerIP.NodeID) + require.True(t, tracker.AddIP(newerIP)) + tracker.connected[ip.NodeID] = ip + return tracker + }(), + }, + { + name: "connected with newer IP", + initialState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.onValidatorAdded(ip.NodeID) + require.True(t, tracker.AddIP(ip)) + return tracker + }(), + ip: newerIP, + expectedState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.onValidatorAdded(ip.NodeID) + require.True(t, tracker.AddIP(ip)) + tracker.connected[newerIP.NodeID] = newerIP + tracker.mostRecentValidatorIPs[newerIP.NodeID] = newerIP + tracker.bloomAdditions[newerIP.NodeID] = 2 + tracker.gossipableIndicies[newerIP.NodeID] = 0 + tracker.gossipableIPs = []*ips.ClaimedIPPort{ + newerIP, + } + return tracker + }(), + }, + { + name: "connected with same IP", + initialState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.onValidatorAdded(ip.NodeID) + require.True(t, tracker.AddIP(ip)) + return tracker + }(), + ip: ip, + expectedState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.onValidatorAdded(ip.NodeID) + require.True(t, tracker.AddIP(ip)) + tracker.connected[ip.NodeID] = ip + tracker.gossipableIndicies[ip.NodeID] = 0 + tracker.gossipableIPs = []*ips.ClaimedIPPort{ + ip, + } + return tracker + }(), + }, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + test.initialState.Connected(test.ip) + requireEqual(t, test.expectedState, test.initialState) + }) + } +} + +func TestIPTracker_Disconnected(t *testing.T) { + tests := []struct { + name string + initialState *ipTracker + nodeID ids.NodeID + expectedState *ipTracker + }{ + { + name: "not gossipable", + initialState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.Connected(ip) + return tracker + }(), + nodeID: ip.NodeID, + expectedState: newTestIPTracker(t), + }, + { + name: "latest gossipable", + initialState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.onValidatorAdded(ip.NodeID) + tracker.Connected(ip) + return tracker + }(), + nodeID: ip.NodeID, + expectedState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.onValidatorAdded(ip.NodeID) + tracker.Connected(ip) + delete(tracker.connected, ip.NodeID) + delete(tracker.gossipableIndicies, ip.NodeID) + tracker.gossipableIPs = tracker.gossipableIPs[:0] + return tracker + }(), + }, + { + name: "non-latest gossipable", + initialState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.onValidatorAdded(ip.NodeID) + tracker.Connected(ip) + tracker.onValidatorAdded(otherIP.NodeID) + tracker.Connected(otherIP) + return tracker + }(), + nodeID: ip.NodeID, + expectedState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.onValidatorAdded(ip.NodeID) + tracker.Connected(ip) + tracker.onValidatorAdded(otherIP.NodeID) + tracker.Connected(otherIP) + delete(tracker.connected, ip.NodeID) + tracker.gossipableIndicies = map[ids.NodeID]int{ + otherIP.NodeID: 0, + } + tracker.gossipableIPs = []*ips.ClaimedIPPort{ + otherIP, + } + return tracker + }(), + }, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + test.initialState.Disconnected(test.nodeID) + requireEqual(t, test.expectedState, test.initialState) + }) + } +} + +func TestIPTracker_OnValidatorAdded(t *testing.T) { + tests := []struct { + name string + initialState *ipTracker + nodeID ids.NodeID + expectedState *ipTracker + }{ + { + name: "manually tracked", + initialState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.ManuallyTrack(ip.NodeID) + return tracker + }(), + nodeID: ip.NodeID, + expectedState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.ManuallyTrack(ip.NodeID) + return tracker + }(), + }, + { + name: "disconnected", + initialState: newTestIPTracker(t), + nodeID: ip.NodeID, + expectedState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.validators.Add(ip.NodeID) + return tracker + }(), + }, + { + name: "connected", + initialState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.Connected(ip) + return tracker + }(), + nodeID: ip.NodeID, + expectedState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.Connected(ip) + tracker.validators.Add(ip.NodeID) + tracker.mostRecentValidatorIPs[ip.NodeID] = ip + tracker.bloomAdditions[ip.NodeID] = 1 + tracker.gossipableIndicies[ip.NodeID] = 0 + tracker.gossipableIPs = []*ips.ClaimedIPPort{ + ip, + } + return tracker + }(), + }, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + test.initialState.OnValidatorAdded(test.nodeID, nil, ids.Empty, 0) + requireEqual(t, test.expectedState, test.initialState) + }) + } +} + +func TestIPTracker_OnValidatorRemoved(t *testing.T) { + tests := []struct { + name string + initialState *ipTracker + nodeID ids.NodeID + expectedState *ipTracker + }{ + { + name: "manually tracked", + initialState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.ManuallyTrack(ip.NodeID) + tracker.onValidatorAdded(ip.NodeID) + tracker.Connected(ip) + return tracker + }(), + nodeID: ip.NodeID, + expectedState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.ManuallyTrack(ip.NodeID) + tracker.onValidatorAdded(ip.NodeID) + tracker.Connected(ip) + return tracker + }(), + }, + { + name: "not gossipable", + initialState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.onValidatorAdded(ip.NodeID) + require.True(t, tracker.AddIP(ip)) + return tracker + }(), + nodeID: ip.NodeID, + expectedState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.onValidatorAdded(ip.NodeID) + require.True(t, tracker.AddIP(ip)) + delete(tracker.mostRecentValidatorIPs, ip.NodeID) + tracker.validators.Remove(ip.NodeID) + return tracker + }(), + }, + { + name: "latest gossipable", + initialState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.onValidatorAdded(ip.NodeID) + tracker.Connected(ip) + return tracker + }(), + nodeID: ip.NodeID, + expectedState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.onValidatorAdded(ip.NodeID) + tracker.Connected(ip) + delete(tracker.mostRecentValidatorIPs, ip.NodeID) + tracker.validators.Remove(ip.NodeID) + delete(tracker.gossipableIndicies, ip.NodeID) + tracker.gossipableIPs = tracker.gossipableIPs[:0] + return tracker + }(), + }, + { + name: "non-latest gossipable", + initialState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.onValidatorAdded(ip.NodeID) + tracker.Connected(ip) + tracker.onValidatorAdded(otherIP.NodeID) + tracker.Connected(otherIP) + return tracker + }(), + nodeID: ip.NodeID, + expectedState: func() *ipTracker { + tracker := newTestIPTracker(t) + tracker.onValidatorAdded(ip.NodeID) + tracker.Connected(ip) + tracker.onValidatorAdded(otherIP.NodeID) + tracker.Connected(otherIP) + delete(tracker.mostRecentValidatorIPs, ip.NodeID) + tracker.validators.Remove(ip.NodeID) + tracker.gossipableIndicies = map[ids.NodeID]int{ + otherIP.NodeID: 0, + } + tracker.gossipableIPs = []*ips.ClaimedIPPort{ + otherIP, + } + return tracker + }(), + }, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + test.initialState.OnValidatorRemoved(test.nodeID, 0) + requireEqual(t, test.expectedState, test.initialState) + }) + } +} + +func TestIPTracker_GetGossipableIPs(t *testing.T) { + require := require.New(t) + + tracker := newTestIPTracker(t) + tracker.Connected(ip) + tracker.Connected(otherIP) + tracker.onValidatorAdded(ip.NodeID) + tracker.onValidatorAdded(otherIP.NodeID) + + gossipableIPs := tracker.GetGossipableIPs(ids.EmptyNodeID, bloom.EmptyFilter, nil, 2) + require.ElementsMatch([]*ips.ClaimedIPPort{ip, otherIP}, gossipableIPs) + + gossipableIPs = tracker.GetGossipableIPs(ip.NodeID, bloom.EmptyFilter, nil, 2) + require.Equal([]*ips.ClaimedIPPort{otherIP}, gossipableIPs) + + gossipableIPs = tracker.GetGossipableIPs(ids.EmptyNodeID, bloom.FullFilter, nil, 2) + require.Empty(gossipableIPs) + + filter, err := bloom.New(8, 1024) + require.NoError(err) + bloom.Add(filter, ip.GossipID[:], nil) + + readFilter, err := bloom.Parse(filter.Marshal()) + require.NoError(err) + + gossipableIPs = tracker.GetGossipableIPs(ip.NodeID, readFilter, nil, 2) + require.Equal([]*ips.ClaimedIPPort{otherIP}, gossipableIPs) +} + +func TestIPTracker_BloomFiltersEverything(t *testing.T) { + require := require.New(t) + + tracker := newTestIPTracker(t) + tracker.Connected(ip) + tracker.Connected(otherIP) + tracker.onValidatorAdded(ip.NodeID) + tracker.onValidatorAdded(otherIP.NodeID) + + bloomBytes, salt := tracker.Bloom() + readFilter, err := bloom.Parse(bloomBytes) + require.NoError(err) + + gossipableIPs := tracker.GetGossipableIPs(ids.EmptyNodeID, readFilter, salt, 2) + require.Empty(gossipableIPs) + + require.NoError(tracker.ResetBloom()) +} + +func TestIPTracker_BloomGrowsWithValidatorSet(t *testing.T) { + require := require.New(t) + + tracker := newTestIPTracker(t) + initialMaxBloomCount := tracker.maxBloomCount + for i := 0; i < 2048; i++ { + tracker.onValidatorAdded(ids.GenerateTestNodeID()) + } + + require.NoError(tracker.ResetBloom()) + require.Greater(tracker.maxBloomCount, initialMaxBloomCount) +} + +func TestIPTracker_BloomResetsDynamically(t *testing.T) { + require := require.New(t) + + tracker := newTestIPTracker(t) + tracker.Connected(ip) + tracker.onValidatorAdded(ip.NodeID) + tracker.OnValidatorRemoved(ip.NodeID, 0) + tracker.maxBloomCount = 1 + tracker.Connected(otherIP) + tracker.onValidatorAdded(otherIP.NodeID) + + bloomBytes, salt := tracker.Bloom() + readFilter, err := bloom.Parse(bloomBytes) + require.NoError(err) + + require.False(bloom.Contains(readFilter, ip.GossipID[:], salt)) + require.True(bloom.Contains(readFilter, otherIP.GossipID[:], salt)) +} + +func TestIPTracker_PreventBloomFilterAddition(t *testing.T) { + require := require.New(t) + + newerIP := newerTestIP(ip) + newestIP := newerTestIP(newerIP) + + tracker := newTestIPTracker(t) + tracker.onValidatorAdded(ip.NodeID) + require.True(tracker.AddIP(ip)) + require.True(tracker.AddIP(newerIP)) + require.True(tracker.AddIP(newestIP)) + require.Equal(maxIPEntriesPerValidator, tracker.bloomAdditions[ip.NodeID]) +} + +func TestIPTracker_ShouldVerifyIP(t *testing.T) { + require := require.New(t) + + newerIP := newerTestIP(ip) + + tracker := newTestIPTracker(t) + require.False(tracker.ShouldVerifyIP(ip)) + tracker.onValidatorAdded(ip.NodeID) + require.True(tracker.ShouldVerifyIP(ip)) + require.True(tracker.AddIP(ip)) + require.False(tracker.ShouldVerifyIP(ip)) + require.True(tracker.ShouldVerifyIP(newerIP)) +} diff --git a/network/network.go b/network/network.go index 2d178cb93488..374038883ba7 100644 --- a/network/network.go +++ b/network/network.go @@ -20,22 +20,20 @@ import ( "go.uber.org/zap" - "golang.org/x/exp/maps" - "github.com/ava-labs/avalanchego/api/health" + "github.com/ava-labs/avalanchego/genesis" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/message" "github.com/ava-labs/avalanchego/network/dialer" "github.com/ava-labs/avalanchego/network/peer" "github.com/ava-labs/avalanchego/network/throttling" - "github.com/ava-labs/avalanchego/proto/pb/p2p" "github.com/ava-labs/avalanchego/snow/networking/router" "github.com/ava-labs/avalanchego/snow/networking/sender" "github.com/ava-labs/avalanchego/subnets" + "github.com/ava-labs/avalanchego/utils/bloom" "github.com/ava-labs/avalanchego/utils/constants" "github.com/ava-labs/avalanchego/utils/ips" "github.com/ava-labs/avalanchego/utils/logging" - "github.com/ava-labs/avalanchego/utils/sampler" "github.com/ava-labs/avalanchego/utils/set" "github.com/ava-labs/avalanchego/utils/wrappers" "github.com/ava-labs/avalanchego/version" @@ -79,12 +77,6 @@ type Network interface { // or the network is closed. Dispatch() error - // WantsConnection returns true if this node is willing to attempt to - // connect to the provided nodeID. If the node is attempting to connect to - // the minimum number of peers, then it should only connect if the peer is a - // validator or beacon. - WantsConnection(ids.NodeID) bool - // Attempt to connect to this IP. The network will never stop attempting to // connect to this ID. ManuallyTrack(nodeID ids.NodeID, ip ips.IPPort) @@ -151,13 +143,8 @@ type network struct { sendFailRateCalculator safemath.Averager // Tracks which peers know about which peers - gossipTracker peer.GossipTracker - peersLock sync.RWMutex - // peerIPs contains the most up to date set of signed IPs for nodes we are - // currently connected or attempting to connect to. - // Note: The txID provided inside of a claimed IP is not verified and should - // not be accessed from this map. - peerIPs map[ids.NodeID]*ips.ClaimedIPPort + ipTracker *ipTracker + peersLock sync.RWMutex // trackedIPs contains the set of IPs that we are currently attempting to // connect to. An entry is added to this set when we first start attempting // to connect to the peer. An entry is deleted from this set once we have @@ -167,10 +154,6 @@ type network struct { connectedPeers peer.Set closing bool - // Tracks special peers that the network should always track - manuallyTrackedIDsLock sync.RWMutex - manuallyTrackedIDs set.Set[ids.NodeID] - // router is notified about all peer [Connected] and [Disconnected] events // as well as all non-handshake peer messages. // @@ -254,6 +237,18 @@ func NewNetwork( return nil, fmt.Errorf("initializing network metrics failed with: %w", err) } + ipTracker, err := newIPTracker(log) + if err != nil { + return nil, fmt.Errorf("initializing ip tracker failed with: %w", err) + } + config.Validators.RegisterCallbackListener(constants.PrimaryNetworkID, ipTracker) + + // Track all default bootstrappers to ensure their current IPs are gossiped + // like validator IPs. + for _, bootstrapper := range genesis.GetBootstrappers(config.NetworkID) { + ipTracker.ManuallyTrack(bootstrapper.ID) + } + peerConfig := &peer.Config{ ReadBufferSize: config.PeerReadBufferSize, WriteBufferSize: config.PeerWriteBufferSize, @@ -300,9 +295,8 @@ func NewNetwork( time.Now(), )), - peerIPs: make(map[ids.NodeID]*ips.ClaimedIPPort), trackedIPs: make(map[ids.NodeID]*trackedIP), - gossipTracker: config.GossipTracker, + ipTracker: ipTracker, connectingPeers: peer.NewSet(), connectedPeers: peer.NewSet(), router: router, @@ -424,32 +418,6 @@ func (n *network) Connected(nodeID ids.NodeID) { return } - peerIP := peer.IP() - newIP := &ips.ClaimedIPPort{ - Cert: peer.Cert(), - IPPort: peerIP.IPPort, - Timestamp: peerIP.Timestamp, - Signature: peerIP.Signature, - } - prevIP, ok := n.peerIPs[nodeID] - if !ok { - // If the IP wasn't previously tracked, then we never could have - // gossiped it. This means we don't need to reset the validator's - // tracked set. - n.peerIPs[nodeID] = newIP - } else if prevIP.Timestamp < newIP.Timestamp { - // The previous IP was stale, so we should gossip the newer IP. - n.peerIPs[nodeID] = newIP - - if !prevIP.IPPort.Equal(newIP.IPPort) { - // This IP is actually different, so we should gossip it. - n.peerConfig.Log.Debug("resetting gossip due to ip change", - zap.Stringer("nodeID", nodeID), - ) - _ = n.gossipTracker.ResetValidator(nodeID) - } - } - if tracked, ok := n.trackedIPs[nodeID]; ok { tracked.stopTracking() delete(n.trackedIPs, nodeID) @@ -458,6 +426,15 @@ func (n *network) Connected(nodeID ids.NodeID) { n.connectedPeers.Add(peer) n.peersLock.Unlock() + peerIP := peer.IP() + newIP := ips.NewClaimedIPPort( + peer.Cert(), + peerIP.IPPort, + peerIP.Timestamp, + peerIP.Signature, + ) + n.ipTracker.Connected(newIP) + n.metrics.markConnected(peer) peerVersion := peer.Version() @@ -475,177 +452,15 @@ func (n *network) AllowConnection(nodeID ids.NodeID) bool { if !n.config.RequireValidatorToConnect { return true } - _, isValidator := n.config.Validators.GetValidator(constants.PrimaryNetworkID, n.config.MyNodeID) - return isValidator || n.WantsConnection(nodeID) -} - -func (n *network) Track(peerID ids.NodeID, claimedIPPorts []*ips.ClaimedIPPort) ([]*p2p.PeerAck, error) { - // Perform all signature verification and hashing before grabbing the peer - // lock. - // Note: Avoiding signature verification when the IP isn't needed is a - // **significant** performance optimization. - // Note: To avoid signature verification when the IP isn't needed, we - // optimistically filter out IPs. This can result in us not tracking an IP - // that we otherwise would have. This case can only happen if the node - // became a validator between the time we verified the signature and when we - // processed the IP; which should be very rare. - ipAuths, err := n.authenticateIPs(claimedIPPorts) - if err != nil { - n.peerConfig.Log.Debug("authenticating claimed IPs failed", - zap.Stringer("nodeID", peerID), - zap.Error(err), - ) - return nil, err - } - - // Information for them to update about us - ipLen := len(claimedIPPorts) - newestTimestamp := make(map[ids.ID]uint64, ipLen) - // Information for us to update about them - txIDsWithUpToDateIP := make([]ids.ID, 0, ipLen) - - // Atomically modify peer data - n.peersLock.Lock() - defer n.peersLock.Unlock() - for i, ip := range claimedIPPorts { - ipAuth := ipAuths[i] - nodeID := ipAuth.nodeID - // Invariant: [ip] is only used to modify local node state if - // [verifiedIP] is true. - // Note: modifying peer-level state is allowed regardless of - // [verifiedIP]. - verifiedIP := ipAuth.verified - - // Re-fetch latest info for a [nodeID] in case it changed since we last - // held [peersLock]. - prevIP, previouslyTracked, shouldUpdateOurIP, shouldDial := n.peerIPStatus(nodeID, ip) - tracked, isTracked := n.trackedIPs[nodeID] - - // Evaluate if the gossiped IP is useful to us or to the peer that - // shared it with us. - switch { - case previouslyTracked && prevIP.Timestamp > ip.Timestamp: - // Our previous IP was more up to date. We should tell the peer - // not to gossip their IP to us. We should still gossip our IP to - // them. - newestTimestamp[ip.TxID] = prevIP.Timestamp - - n.metrics.numUselessPeerListBytes.Add(float64(ip.BytesLen())) - case previouslyTracked && prevIP.Timestamp == ip.Timestamp: - // Our previous IP was equally fresh. We should tell the peer - // not to gossip this IP to us. We should not gossip our IP to them. - newestTimestamp[ip.TxID] = prevIP.Timestamp - txIDsWithUpToDateIP = append(txIDsWithUpToDateIP, ip.TxID) - - n.metrics.numUselessPeerListBytes.Add(float64(ip.BytesLen())) - case verifiedIP && shouldUpdateOurIP: - // This IP is more up to date. We should tell the peer not to gossip - // this IP to us. We should not gossip our IP to them. - newestTimestamp[ip.TxID] = ip.Timestamp - txIDsWithUpToDateIP = append(txIDsWithUpToDateIP, ip.TxID) - - // In the future, we should gossip this IP rather than the old IP. - n.peerIPs[nodeID] = ip - - // If the new IP is equal to the old IP, there is no reason to - // refresh the references to it. This can happen when a node - // restarts but does not change their IP. - if prevIP.IPPort.Equal(ip.IPPort) { - continue - } - - // We should gossip this new IP to all our peers. - n.peerConfig.Log.Debug("resetting gossip due to ip change", - zap.Stringer("nodeID", nodeID), - ) - _ = n.gossipTracker.ResetValidator(nodeID) - - // We should update any existing outbound connection attempts. - if isTracked { - // Stop tracking the old IP and start tracking the new one. - tracked := tracked.trackNewIP(ip.IPPort) - n.trackedIPs[nodeID] = tracked - n.dial(nodeID, tracked) - } - case verifiedIP && shouldDial: - // Invariant: [isTracked] is false here. - - // This is the first we've heard of this IP and we want to connect - // to it. We should tell the peer not to gossip this IP to us again. - newestTimestamp[ip.TxID] = ip.Timestamp - // We should not gossip this IP back to them. - txIDsWithUpToDateIP = append(txIDsWithUpToDateIP, ip.TxID) - - // We don't need to reset gossip about this validator because - // we've never gossiped it before. - n.peerIPs[nodeID] = ip - - tracked := newTrackedIP(ip.IPPort) - n.trackedIPs[nodeID] = tracked - n.dial(nodeID, tracked) - default: - // This IP isn't desired - n.metrics.numUselessPeerListBytes.Add(float64(ip.BytesLen())) - } - } - - txIDsToAck := maps.Keys(newestTimestamp) - txIDsToAck, ok := n.gossipTracker.AddKnown(peerID, txIDsWithUpToDateIP, txIDsToAck) - if !ok { - n.peerConfig.Log.Error("failed to update known peers", - zap.Stringer("nodeID", peerID), - ) - return nil, nil - } - - peerAcks := make([]*p2p.PeerAck, len(txIDsToAck)) - for i, txID := range txIDsToAck { - txID := txID - peerAcks[i] = &p2p.PeerAck{ - TxId: txID[:], - // By responding with the highest timestamp, not just the timestamp - // the peer provided us, we may be able to avoid some unnecessary - // gossip in the case that the peer is about to update this - // validator's IP. - Timestamp: newestTimestamp[txID], - } - } - return peerAcks, nil + _, iAmAValidator := n.config.Validators.GetValidator(constants.PrimaryNetworkID, n.config.MyNodeID) + return iAmAValidator || n.ipTracker.WantsConnection(nodeID) } -func (n *network) MarkTracked(peerID ids.NodeID, ips []*p2p.PeerAck) error { - txIDs := make([]ids.ID, 0, len(ips)) - - n.peersLock.RLock() - defer n.peersLock.RUnlock() - - for _, ip := range ips { - txID, err := ids.ToID(ip.TxId) - if err != nil { +func (n *network) Track(claimedIPPorts []*ips.ClaimedIPPort) error { + for _, ip := range claimedIPPorts { + if err := n.track(ip); err != nil { return err } - - // If [txID]'s corresponding nodeID isn't known, then they must no - // longer be a validator. Therefore we wouldn't gossip their IP anyways. - nodeID, ok := n.gossipTracker.GetNodeID(txID) - if !ok { - continue - } - - // If the peer returns a lower timestamp than I currently have, then I - // have updated the IP since I sent the PeerList message this is in - // response to. That means that I should re-gossip this node's IP to the - // peer. - myIP, previouslyTracked := n.peerIPs[nodeID] - if previouslyTracked && myIP.Timestamp <= ip.Timestamp { - txIDs = append(txIDs, txID) - } - } - - if _, ok := n.gossipTracker.AddKnown(peerID, txIDs, nil); !ok { - n.peerConfig.Log.Error("failed to update known peers", - zap.Stringer("nodeID", peerID), - ) } return nil } @@ -656,13 +471,6 @@ func (n *network) MarkTracked(peerID ids.NodeID, ips []*p2p.PeerAck) error { // call. Note that this is from the perspective of a single peer object, because // a peer with the same ID can reconnect to this network instance. func (n *network) Disconnected(nodeID ids.NodeID) { - if !n.gossipTracker.StopTrackingPeer(nodeID) { - n.peerConfig.Log.Error( - "stopped non-existent peer tracker", - zap.Stringer("nodeID", nodeID), - ) - } - n.peersLock.RLock() _, connecting := n.connectingPeers.GetByID(nodeID) peer, connected := n.connectedPeers.GetByID(nodeID) @@ -676,57 +484,17 @@ func (n *network) Disconnected(nodeID ids.NodeID) { } } -func (n *network) Peers(peerID ids.NodeID) ([]ips.ClaimedIPPort, error) { - // Only select validators that we haven't already sent to this peer - unknownValidators, ok := n.gossipTracker.GetUnknown(peerID) - if !ok { - n.peerConfig.Log.Debug( - "unable to find peer to gossip to", - zap.Stringer("nodeID", peerID), - ) - return nil, nil - } - - // We select a random sample of validators to gossip to avoid starving out a - // validator from being gossiped for an extended period of time. - s := sampler.NewUniform() - s.Initialize(uint64(len(unknownValidators))) - - // Calculate the unknown information we need to send to this peer. - validatorIPs := make([]ips.ClaimedIPPort, 0, int(n.config.PeerListNumValidatorIPs)) - for i := 0; i < len(unknownValidators) && len(validatorIPs) < int(n.config.PeerListNumValidatorIPs); i++ { - drawn, err := s.Next() - if err != nil { - return nil, err - } - - validator := unknownValidators[drawn] - n.peersLock.RLock() - _, isConnected := n.connectedPeers.GetByID(validator.NodeID) - peerIP := n.peerIPs[validator.NodeID] - n.peersLock.RUnlock() - if !isConnected { - n.peerConfig.Log.Verbo( - "unable to find validator in connected peers", - zap.Stringer("nodeID", validator.NodeID), - ) - continue - } - - // Note: peerIP isn't used directly here because the TxID may be - // incorrect. - validatorIPs = append(validatorIPs, - ips.ClaimedIPPort{ - Cert: peerIP.Cert, - IPPort: peerIP.IPPort, - Timestamp: peerIP.Timestamp, - Signature: peerIP.Signature, - TxID: validator.TxID, - }, - ) - } +func (n *network) KnownPeers() ([]byte, []byte) { + return n.ipTracker.Bloom() +} - return validatorIPs, nil +func (n *network) Peers(except ids.NodeID, knownPeers *bloom.ReadFilter, salt []byte) []*ips.ClaimedIPPort { + return n.ipTracker.GetGossipableIPs( + except, + knownPeers, + salt, + int(n.config.PeerListNumValidatorIPs), + ) } // Dispatch starts accepting connections from other nodes attempting to connect @@ -806,21 +574,8 @@ func (n *network) Dispatch() error { return errs.Err } -func (n *network) WantsConnection(nodeID ids.NodeID) bool { - if _, ok := n.config.Validators.GetValidator(constants.PrimaryNetworkID, nodeID); ok { - return true - } - - n.manuallyTrackedIDsLock.RLock() - defer n.manuallyTrackedIDsLock.RUnlock() - - return n.manuallyTrackedIDs.Contains(nodeID) -} - func (n *network) ManuallyTrack(nodeID ids.NodeID, ip ips.IPPort) { - n.manuallyTrackedIDsLock.Lock() - n.manuallyTrackedIDs.Add(nodeID) - n.manuallyTrackedIDsLock.Unlock() + n.ipTracker.ManuallyTrack(nodeID) n.peersLock.Lock() defer n.peersLock.Unlock() @@ -841,6 +596,58 @@ func (n *network) ManuallyTrack(nodeID ids.NodeID, ip ips.IPPort) { } } +func (n *network) track(ip *ips.ClaimedIPPort) error { + // To avoid signature verification when the IP isn't needed, we + // optimistically filter out IPs. This can result in us not tracking an IP + // that we otherwise would have. This case can only happen if the node + // became a validator between the time we verified the signature and when we + // processed the IP; which should be very rare. + // + // Note: Avoiding signature verification when the IP isn't needed is a + // **significant** performance optimization. + if !n.ipTracker.ShouldVerifyIP(ip) { + n.metrics.numUselessPeerListBytes.Add(float64(ip.Size())) + return nil + } + + // Perform all signature verification and hashing before grabbing the peer + // lock. + signedIP := peer.SignedIP{ + UnsignedIP: peer.UnsignedIP{ + IPPort: ip.IPPort, + Timestamp: ip.Timestamp, + }, + Signature: ip.Signature, + } + if err := signedIP.Verify(ip.Cert); err != nil { + return err + } + + n.peersLock.Lock() + defer n.peersLock.Unlock() + + if !n.ipTracker.AddIP(ip) { + return nil + } + + if _, connected := n.connectedPeers.GetByID(ip.NodeID); connected { + // If I'm currently connected to [nodeID] then I'll attempt to dial them + // when we disconnect. + return nil + } + + tracked, isTracked := n.trackedIPs[ip.NodeID] + if isTracked { + // Stop tracking the old IP and start tracking the new one. + tracked = tracked.trackNewIP(ip.IPPort) + } else { + tracked = newTrackedIP(ip.IPPort) + } + n.trackedIPs[ip.NodeID] = tracked + n.dial(ip.NodeID, tracked) + return nil +} + // getPeers returns a slice of connected peers from a set of [nodeIDs]. // // - [nodeIDs] the IDs of the peers that should be returned if they are @@ -965,13 +772,12 @@ func (n *network) disconnectedFromConnecting(nodeID ids.NodeID) { // The peer that is disconnecting from us didn't finish the handshake tracked, ok := n.trackedIPs[nodeID] if ok { - if n.WantsConnection(nodeID) { + if n.ipTracker.WantsConnection(nodeID) { tracked := tracked.trackNewIP(tracked.ip) n.trackedIPs[nodeID] = tracked n.dial(nodeID, tracked) } else { tracked.stopTracking() - delete(n.peerIPs, nodeID) delete(n.trackedIPs, nodeID) } } @@ -980,6 +786,7 @@ func (n *network) disconnectedFromConnecting(nodeID ids.NodeID) { } func (n *network) disconnectedFromConnected(peer peer.Peer, nodeID ids.NodeID) { + n.ipTracker.Disconnected(nodeID) n.router.Disconnected(nodeID) n.peersLock.Lock() @@ -988,66 +795,15 @@ func (n *network) disconnectedFromConnected(peer peer.Peer, nodeID ids.NodeID) { n.connectedPeers.Remove(nodeID) // The peer that is disconnecting from us finished the handshake - if n.WantsConnection(nodeID) { - prevIP := n.peerIPs[nodeID] - tracked := newTrackedIP(prevIP.IPPort) + if ip, wantsConnection := n.ipTracker.GetIP(nodeID); wantsConnection { + tracked := newTrackedIP(ip.IPPort) n.trackedIPs[nodeID] = tracked n.dial(nodeID, tracked) - } else { - delete(n.peerIPs, nodeID) } n.metrics.markDisconnected(peer) } -// ipAuth is a helper struct used to convey information about an -// [*ips.ClaimedIPPort]. -type ipAuth struct { - nodeID ids.NodeID - verified bool -} - -func (n *network) authenticateIPs(ips []*ips.ClaimedIPPort) ([]*ipAuth, error) { - ipAuths := make([]*ipAuth, len(ips)) - for i, ip := range ips { - nodeID := ids.NodeIDFromCert(ip.Cert) - n.peersLock.RLock() - _, _, shouldUpdateOurIP, shouldDial := n.peerIPStatus(nodeID, ip) - n.peersLock.RUnlock() - if !shouldUpdateOurIP && !shouldDial { - ipAuths[i] = &ipAuth{ - nodeID: nodeID, - } - continue - } - - // Verify signature if needed - signedIP := peer.SignedIP{ - UnsignedIP: peer.UnsignedIP{ - IPPort: ip.IPPort, - Timestamp: ip.Timestamp, - }, - Signature: ip.Signature, - } - if err := signedIP.Verify(ip.Cert); err != nil { - return nil, err - } - ipAuths[i] = &ipAuth{ - nodeID: nodeID, - verified: true, - } - } - return ipAuths, nil -} - -// peerIPStatus assumes the caller holds [peersLock] -func (n *network) peerIPStatus(nodeID ids.NodeID, ip *ips.ClaimedIPPort) (*ips.ClaimedIPPort, bool, bool, bool) { - prevIP, previouslyTracked := n.peerIPs[nodeID] - shouldUpdateOurIP := previouslyTracked && prevIP.Timestamp < ip.Timestamp - shouldDial := !previouslyTracked && n.WantsConnection(nodeID) - return prevIP, previouslyTracked, shouldUpdateOurIP, shouldDial -} - // dial will spin up a new goroutine and attempt to establish a connection with // [nodeID] at [ip]. // @@ -1094,13 +850,12 @@ func (n *network) dial(nodeID ids.NodeID, ip *trackedIP) { // trackedIPs and this goroutine. This prevents a memory leak when // the tracked nodeID leaves the validator set and is never able to // be connected to. - if !n.WantsConnection(nodeID) { + if !n.ipTracker.WantsConnection(nodeID) { // Typically [n.trackedIPs[nodeID]] will already equal [ip], but // the reference to [ip] is refreshed to avoid any potential // race conditions before removing the entry. if ip, exists := n.trackedIPs[nodeID]; exists { ip.stopTracking() - delete(n.peerIPs, nodeID) delete(n.trackedIPs, nodeID) } n.peersLock.Unlock() @@ -1277,13 +1032,6 @@ func (n *network) upgrade(conn net.Conn, upgrader peer.Upgrader) error { zap.Stringer("nodeID", nodeID), ) - if !n.gossipTracker.StartTrackingPeer(nodeID) { - n.peerConfig.Log.Error( - "started duplicate peer tracker", - zap.Stringer("nodeID", nodeID), - ) - } - // peer.Start requires there is only ever one peer instance running with the // same [peerConfig.InboundMsgThrottler]. This is guaranteed by the above // de-duplications for [connectingPeers] and [connectedPeers]. @@ -1332,7 +1080,6 @@ func (n *network) StartClose() { for nodeID, tracked := range n.trackedIPs { tracked.stopTracking() - delete(n.peerIPs, nodeID) delete(n.trackedIPs, nodeID) } @@ -1404,10 +1151,13 @@ func (n *network) NodeUptime(subnetID ids.ID) (UptimeResult, error) { } func (n *network) runTimers() { - gossipPeerlists := time.NewTicker(n.config.PeerListGossipFreq) + pushGossipPeerlists := time.NewTicker(n.config.PeerListGossipFreq) + pullGossipPeerlists := time.NewTicker(n.config.PeerListPullGossipFreq) + resetPeerListBloom := time.NewTicker(n.config.PeerListBloomResetFreq) updateUptimes := time.NewTicker(n.config.UptimeMetricFreq) defer func() { - gossipPeerlists.Stop() + pushGossipPeerlists.Stop() + resetPeerListBloom.Stop() updateUptimes.Stop() }() @@ -1415,8 +1165,18 @@ func (n *network) runTimers() { select { case <-n.onCloseCtx.Done(): return - case <-gossipPeerlists.C: - n.gossipPeerLists() + case <-pushGossipPeerlists.C: + n.pushGossipPeerLists() + case <-pullGossipPeerlists.C: + n.pullGossipPeerLists() + case <-resetPeerListBloom.C: + if err := n.ipTracker.ResetBloom(); err != nil { + n.peerConfig.Log.Error("failed to reset ip tracker bloom filter", + zap.Error(err), + ) + } else { + n.peerConfig.Log.Debug("reset ip tracker bloom filter") + } case <-updateUptimes.C: primaryUptime, err := n.NodeUptime(constants.PrimaryNetworkID) if err != nil { @@ -1443,8 +1203,8 @@ func (n *network) runTimers() { } } -// gossipPeerLists gossips validators to peers in the network -func (n *network) gossipPeerLists() { +// pushGossipPeerLists gossips validators to peers in the network +func (n *network) pushGossipPeerLists() { peers := n.samplePeers( constants.PrimaryNetworkID, int(n.config.PeerListValidatorGossipSize), @@ -1458,6 +1218,21 @@ func (n *network) gossipPeerLists() { } } +// pullGossipPeerLists requests validators from peers in the network +func (n *network) pullGossipPeerLists() { + peers := n.samplePeers( + constants.PrimaryNetworkID, + 1, // numValidatorsToSample + 0, // numNonValidatorsToSample + 0, // numPeersToSample + subnets.NoOpAllower, + ) + + for _, p := range peers { + p.StartSendGetPeerList() + } +} + func (n *network) getLastReceived() (time.Time, bool) { lastReceived := atomic.LoadInt64(&n.peerConfig.LastReceived) if lastReceived == 0 { diff --git a/network/network_test.go b/network/network_test.go index 916b527da82b..90c063a99bb7 100644 --- a/network/network_test.go +++ b/network/network_test.go @@ -54,6 +54,8 @@ var ( PeerListNonValidatorGossipSize: 100, PeerListPeersGossipSize: 100, PeerListGossipFreq: time.Second, + PeerListPullGossipFreq: time.Second, + PeerListBloomResetFreq: constants.DefaultNetworkPeerListBloomResetFreq, } defaultTimeoutConfig = TimeoutConfig{ PingPongTimeout: 30 * time.Second, @@ -215,27 +217,16 @@ func newFullyConnectedTestNetwork(t *testing.T, handlers []router.InboundHandler msgCreator := newMessageCreator(t) registry := prometheus.NewRegistry() - g, err := peer.NewGossipTracker(registry, "foobar") - require.NoError(err) - - log := logging.NoLog{} - gossipTrackerCallback := peer.GossipTrackerCallback{ - Log: log, - GossipTracker: g, - } - beacons := validators.NewManager() require.NoError(beacons.AddStaker(constants.PrimaryNetworkID, nodeIDs[0], nil, ids.GenerateTestID(), 1)) vdrs := validators.NewManager() - vdrs.RegisterCallbackListener(constants.PrimaryNetworkID, &gossipTrackerCallback) for _, nodeID := range nodeIDs { require.NoError(vdrs.AddStaker(constants.PrimaryNetworkID, nodeID, nil, ids.GenerateTestID(), 1)) } config := config - config.GossipTracker = g config.Beacons = beacons config.Validators = vdrs @@ -244,7 +235,7 @@ func newFullyConnectedTestNetwork(t *testing.T, handlers []router.InboundHandler config, msgCreator, registry, - log, + logging.NoLog{}, listeners[i], dialer, &testHandler{ @@ -405,15 +396,17 @@ func TestTrackVerifiesSignatures(t *testing.T) { nodeID, tlsCert, _ := getTLS(t, 1) require.NoError(network.config.Validators.AddStaker(constants.PrimaryNetworkID, nodeID, nil, ids.Empty, 1)) - _, err := network.Track(ids.EmptyNodeID, []*ips.ClaimedIPPort{{ - Cert: staking.CertificateFromX509(tlsCert.Leaf), - IPPort: ips.IPPort{ - IP: net.IPv4(123, 132, 123, 123), - Port: 10000, - }, - Timestamp: 1000, - Signature: nil, - }}) + err := network.Track([]*ips.ClaimedIPPort{ + ips.NewClaimedIPPort( + staking.CertificateFromX509(tlsCert.Leaf), + ips.IPPort{ + IP: net.IPv4(123, 132, 123, 123), + Port: 10000, + }, + 1000, // timestamp + nil, // signature + ), + }) // The signature is wrong so this peer tracking info isn't useful. require.ErrorIs(err, rsa.ErrVerification) @@ -437,27 +430,16 @@ func TestTrackDoesNotDialPrivateIPs(t *testing.T) { msgCreator := newMessageCreator(t) registry := prometheus.NewRegistry() - g, err := peer.NewGossipTracker(registry, "foobar") - require.NoError(err) - - log := logging.NoLog{} - gossipTrackerCallback := peer.GossipTrackerCallback{ - Log: log, - GossipTracker: g, - } - beacons := validators.NewManager() require.NoError(beacons.AddStaker(constants.PrimaryNetworkID, nodeIDs[0], nil, ids.GenerateTestID(), 1)) vdrs := validators.NewManager() - vdrs.RegisterCallbackListener(constants.PrimaryNetworkID, &gossipTrackerCallback) for _, nodeID := range nodeIDs { require.NoError(vdrs.AddStaker(constants.PrimaryNetworkID, nodeID, nil, ids.GenerateTestID(), 1)) } config := config - config.GossipTracker = g config.Beacons = beacons config.Validators = vdrs config.AllowPrivateIPs = false @@ -466,7 +448,7 @@ func TestTrackDoesNotDialPrivateIPs(t *testing.T) { config, msgCreator, registry, - log, + logging.NoLog{}, listeners[i], dialer, &testHandler{ @@ -532,23 +514,11 @@ func TestDialDeletesNonValidators(t *testing.T) { msgCreator := newMessageCreator(t) registry := prometheus.NewRegistry() - g, err := peer.NewGossipTracker(registry, "foobar") - require.NoError(err) - - log := logging.NoLog{} - gossipTrackerCallback := peer.GossipTrackerCallback{ - Log: log, - GossipTracker: g, - } - beacons := validators.NewManager() require.NoError(beacons.AddStaker(constants.PrimaryNetworkID, nodeIDs[0], nil, ids.GenerateTestID(), 1)) - vdrs.RegisterCallbackListener(constants.PrimaryNetworkID, &gossipTrackerCallback) - config := config - config.GossipTracker = g config.Beacons = beacons config.Validators = vdrs config.AllowPrivateIPs = false @@ -557,7 +527,7 @@ func TestDialDeletesNonValidators(t *testing.T) { config, msgCreator, registry, - log, + logging.NoLog{}, listeners[i], dialer, &testHandler{ @@ -581,16 +551,15 @@ func TestDialDeletesNonValidators(t *testing.T) { wg.Add(len(networks)) for i, net := range networks { if i != 0 { - peerAcks, err := net.Track(config.MyNodeID, []*ips.ClaimedIPPort{{ - Cert: staking.CertificateFromX509(config.TLSConfig.Certificates[0].Leaf), - IPPort: ip.IPPort, - Timestamp: ip.Timestamp, - Signature: ip.Signature, - }}) + err := net.Track([]*ips.ClaimedIPPort{ + ips.NewClaimedIPPort( + staking.CertificateFromX509(config.TLSConfig.Certificates[0].Leaf), + ip.IPPort, + ip.Timestamp, + ip.Signature, + ), + }) require.NoError(err) - // peerAcks is empty because we aren't actually connected to - // MyNodeID yet - require.Empty(peerAcks) } go func(net Network) { @@ -694,25 +663,14 @@ func TestAllowConnectionAsAValidator(t *testing.T) { msgCreator := newMessageCreator(t) registry := prometheus.NewRegistry() - g, err := peer.NewGossipTracker(registry, "foobar") - require.NoError(err) - - log := logging.NoLog{} - gossipTrackerCallback := peer.GossipTrackerCallback{ - Log: log, - GossipTracker: g, - } - beacons := validators.NewManager() require.NoError(beacons.AddStaker(constants.PrimaryNetworkID, nodeIDs[0], nil, ids.GenerateTestID(), 1)) vdrs := validators.NewManager() - vdrs.RegisterCallbackListener(constants.PrimaryNetworkID, &gossipTrackerCallback) require.NoError(vdrs.AddStaker(constants.PrimaryNetworkID, nodeIDs[0], nil, ids.GenerateTestID(), 1)) config := config - config.GossipTracker = g config.Beacons = beacons config.Validators = vdrs config.RequireValidatorToConnect = true @@ -721,7 +679,7 @@ func TestAllowConnectionAsAValidator(t *testing.T) { config, msgCreator, registry, - log, + logging.NoLog{}, listeners[i], dialer, &testHandler{ diff --git a/network/peer/gossip_tracker.go b/network/peer/gossip_tracker.go deleted file mode 100644 index 105d3e5ce64d..000000000000 --- a/network/peer/gossip_tracker.go +++ /dev/null @@ -1,323 +0,0 @@ -// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - -package peer - -import ( - "fmt" - "sync" - - "github.com/prometheus/client_golang/prometheus" - - "github.com/ava-labs/avalanchego/ids" - "github.com/ava-labs/avalanchego/utils/set" -) - -// GossipTracker tracks the validators that we're currently aware of, as well as -// the validators we've told each peers about. This data is stored in a bitset -// to optimize space, where only N (num validators) bits will be used per peer. -// -// This is done by recording some state information of both what validators this -// node is aware of, and what validators we've told each peer about. -// As an example, say we track three peers and three validators (MSB first): -// -// trackedPeers: { -// p1: [1, 1, 1] // we have already told [p1] about all validators -// p2: [0, 1, 1] // [p2] doesn't know about [v3] -// p3: [0, 0, 1] // [p3] knows only about [v3] -// } -// -// GetUnknown computes the validators we haven't sent to a given peer. Ex: -// -// GetUnknown(p1) - [0, 0, 0] -// GetUnknown(p2) - [1, 0, 0] -// GetUnknown(p3) - [1, 1, 0] -// -// Using the gossipTracker, we can quickly compute the validators each peer -// doesn't know about using GetUnknown so that in subsequent PeerList gossip -// messages we only send information that this peer (most likely) doesn't -// already know about. The only case where we'll send a redundant set of -// bytes is if another remote peer gossips to the same peer we're trying to -// gossip to first. -type GossipTracker interface { - // Tracked returns if a peer is being tracked - // Returns: - // bool: False if [peerID] is not tracked. True otherwise. - Tracked(peerID ids.NodeID) bool - - // StartTrackingPeer starts tracking a peer - // Returns: - // bool: False if [peerID] was already tracked. True otherwise. - StartTrackingPeer(peerID ids.NodeID) bool - // StopTrackingPeer stops tracking a given peer - // Returns: - // bool: False if [peerID] was not tracked. True otherwise. - StopTrackingPeer(peerID ids.NodeID) bool - - // AddValidator adds a validator that can be gossiped about - // bool: False if a validator with the same node ID or txID as [validator] - // is present. True otherwise. - AddValidator(validator ValidatorID) bool - // GetNodeID maps a txID into a nodeIDs - // nodeID: The nodeID that was registered by [txID] - // bool: False if [validator] was not present. True otherwise. - GetNodeID(txID ids.ID) (ids.NodeID, bool) - // RemoveValidator removes a validator that can be gossiped about - // bool: False if [validator] was already not present. True otherwise. - RemoveValidator(validatorID ids.NodeID) bool - // ResetValidator resets known gossip status of [validatorID] to unknown - // for all peers - // bool: False if [validator] was not present. True otherwise. - ResetValidator(validatorID ids.NodeID) bool - - // AddKnown adds [knownTxIDs] to the txIDs known by [peerID] and filters - // [txIDs] for non-validators. - // Returns: - // txIDs: The txIDs in [txIDs] that are currently validators. - // bool: False if [peerID] is not tracked. True otherwise. - AddKnown( - peerID ids.NodeID, - knownTxIDs []ids.ID, - txIDs []ids.ID, - ) ([]ids.ID, bool) - // GetUnknown gets the peers that we haven't sent to this peer - // Returns: - // []ValidatorID: a slice of ValidatorIDs that [peerID] doesn't know about. - // bool: False if [peerID] is not tracked. True otherwise. - GetUnknown(peerID ids.NodeID) ([]ValidatorID, bool) -} - -type gossipTracker struct { - lock sync.RWMutex - // a mapping of txIDs => the validator added to the validiator set by that - // tx. - txIDsToNodeIDs map[ids.ID]ids.NodeID - // a mapping of validators => the index they occupy in the bitsets - nodeIDsToIndices map[ids.NodeID]int - // each validator in the index it occupies in the bitset - validatorIDs []ValidatorID - // a mapping of each peer => the validators they know about - trackedPeers map[ids.NodeID]set.Bits - - metrics gossipTrackerMetrics -} - -// NewGossipTracker returns an instance of gossipTracker -func NewGossipTracker( - registerer prometheus.Registerer, - namespace string, -) (GossipTracker, error) { - m, err := newGossipTrackerMetrics(registerer, fmt.Sprintf("%s_gossip_tracker", namespace)) - if err != nil { - return nil, err - } - - return &gossipTracker{ - txIDsToNodeIDs: make(map[ids.ID]ids.NodeID), - nodeIDsToIndices: make(map[ids.NodeID]int), - trackedPeers: make(map[ids.NodeID]set.Bits), - metrics: m, - }, nil -} - -func (g *gossipTracker) Tracked(peerID ids.NodeID) bool { - g.lock.RLock() - defer g.lock.RUnlock() - - _, ok := g.trackedPeers[peerID] - return ok -} - -func (g *gossipTracker) StartTrackingPeer(peerID ids.NodeID) bool { - g.lock.Lock() - defer g.lock.Unlock() - - // don't track the peer if it's already being tracked - if _, ok := g.trackedPeers[peerID]; ok { - return false - } - - // start tracking the peer. Initialize their bitset to zero since we - // haven't sent them anything yet. - g.trackedPeers[peerID] = set.NewBits() - - // emit metrics - g.metrics.trackedPeersSize.Set(float64(len(g.trackedPeers))) - - return true -} - -func (g *gossipTracker) StopTrackingPeer(peerID ids.NodeID) bool { - g.lock.Lock() - defer g.lock.Unlock() - - // only stop tracking peers that are actually being tracked - if _, ok := g.trackedPeers[peerID]; !ok { - return false - } - - // stop tracking the peer by removing them - delete(g.trackedPeers, peerID) - g.metrics.trackedPeersSize.Set(float64(len(g.trackedPeers))) - - return true -} - -func (g *gossipTracker) AddValidator(validator ValidatorID) bool { - g.lock.Lock() - defer g.lock.Unlock() - - // only add validators that are not already present - if _, ok := g.txIDsToNodeIDs[validator.TxID]; ok { - return false - } - if _, ok := g.nodeIDsToIndices[validator.NodeID]; ok { - return false - } - - // add the validator to the MSB of the bitset. - msb := len(g.validatorIDs) - g.txIDsToNodeIDs[validator.TxID] = validator.NodeID - g.nodeIDsToIndices[validator.NodeID] = msb - g.validatorIDs = append(g.validatorIDs, validator) - - // emit metrics - g.metrics.validatorsSize.Set(float64(len(g.validatorIDs))) - - return true -} - -func (g *gossipTracker) GetNodeID(txID ids.ID) (ids.NodeID, bool) { - g.lock.RLock() - defer g.lock.RUnlock() - - nodeID, ok := g.txIDsToNodeIDs[txID] - return nodeID, ok -} - -func (g *gossipTracker) RemoveValidator(validatorID ids.NodeID) bool { - g.lock.Lock() - defer g.lock.Unlock() - - // only remove validators that are already present - indexToRemove, ok := g.nodeIDsToIndices[validatorID] - if !ok { - return false - } - validatorToRemove := g.validatorIDs[indexToRemove] - - // swap the validator-to-be-removed with the validator in the last index - // if the element we're swapping with is ourselves, we can skip this swap - // since we only need to delete instead - lastIndex := len(g.validatorIDs) - 1 - if indexToRemove != lastIndex { - lastValidator := g.validatorIDs[lastIndex] - - g.nodeIDsToIndices[lastValidator.NodeID] = indexToRemove - g.validatorIDs[indexToRemove] = lastValidator - } - - delete(g.txIDsToNodeIDs, validatorToRemove.TxID) - delete(g.nodeIDsToIndices, validatorID) - g.validatorIDs = g.validatorIDs[:lastIndex] - - // Invariant: We must remove the validator from everyone else's validator - // bitsets to make sure that each validator occupies the same position in - // each bitset. - for _, knownPeers := range g.trackedPeers { - // swap the element to be removed with the msb - if indexToRemove != lastIndex { - if knownPeers.Contains(lastIndex) { - knownPeers.Add(indexToRemove) - } else { - knownPeers.Remove(indexToRemove) - } - } - knownPeers.Remove(lastIndex) - } - - // emit metrics - g.metrics.validatorsSize.Set(float64(len(g.validatorIDs))) - - return true -} - -func (g *gossipTracker) ResetValidator(validatorID ids.NodeID) bool { - g.lock.Lock() - defer g.lock.Unlock() - - // only reset validators that exist - indexToReset, ok := g.nodeIDsToIndices[validatorID] - if !ok { - return false - } - - for _, knownPeers := range g.trackedPeers { - knownPeers.Remove(indexToReset) - } - - return true -} - -// AddKnown invariants: -// -// 1. [peerID] SHOULD only be a nodeID that has been tracked with -// StartTrackingPeer(). -func (g *gossipTracker) AddKnown( - peerID ids.NodeID, - knownTxIDs []ids.ID, - txIDs []ids.ID, -) ([]ids.ID, bool) { - g.lock.Lock() - defer g.lock.Unlock() - - knownPeers, ok := g.trackedPeers[peerID] - if !ok { - return nil, false - } - for _, txID := range knownTxIDs { - nodeID, ok := g.txIDsToNodeIDs[txID] - if !ok { - // We don't know about this txID, this can happen due to differences - // between our current validator set and the peer's current - // validator set. - continue - } - - // Because we fetched the nodeID from [g.txIDsToNodeIDs], we are - // guaranteed that the index is populated. - index := g.nodeIDsToIndices[nodeID] - knownPeers.Add(index) - } - - validatorTxIDs := make([]ids.ID, 0, len(txIDs)) - for _, txID := range txIDs { - if _, ok := g.txIDsToNodeIDs[txID]; ok { - validatorTxIDs = append(validatorTxIDs, txID) - } - } - return validatorTxIDs, true -} - -func (g *gossipTracker) GetUnknown(peerID ids.NodeID) ([]ValidatorID, bool) { - g.lock.RLock() - defer g.lock.RUnlock() - - // return false if this peer isn't tracked - knownPeers, ok := g.trackedPeers[peerID] - if !ok { - return nil, false - } - - // Calculate the unknown information we need to send to this peer. We do - // this by computing the difference between the validators we know about - // and the validators we know we've sent to [peerID]. - result := make([]ValidatorID, 0, len(g.validatorIDs)) - for i, validatorID := range g.validatorIDs { - if !knownPeers.Contains(i) { - result = append(result, validatorID) - } - } - - return result, true -} diff --git a/network/peer/gossip_tracker_callback.go b/network/peer/gossip_tracker_callback.go deleted file mode 100644 index 5863b236e069..000000000000 --- a/network/peer/gossip_tracker_callback.go +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - -package peer - -import ( - "go.uber.org/zap" - - "github.com/ava-labs/avalanchego/ids" - "github.com/ava-labs/avalanchego/snow/validators" - "github.com/ava-labs/avalanchego/utils/crypto/bls" - "github.com/ava-labs/avalanchego/utils/logging" -) - -var _ validators.SetCallbackListener = (*GossipTrackerCallback)(nil) - -// GossipTrackerCallback synchronizes GossipTracker's validator state with the -// validator set it's registered to. -type GossipTrackerCallback struct { - Log logging.Logger - GossipTracker GossipTracker -} - -// OnValidatorAdded adds [validatorID] to the set of validators that can be -// gossiped about -func (g *GossipTrackerCallback) OnValidatorAdded( - nodeID ids.NodeID, - _ *bls.PublicKey, - txID ids.ID, - _ uint64, -) { - vdr := ValidatorID{ - NodeID: nodeID, - TxID: txID, - } - if !g.GossipTracker.AddValidator(vdr) { - g.Log.Error("failed to add a validator", - zap.Stringer("nodeID", nodeID), - zap.Stringer("txID", txID), - ) - } -} - -// OnValidatorRemoved removes [validatorID] from the set of validators that can -// be gossiped about. -func (g *GossipTrackerCallback) OnValidatorRemoved(nodeID ids.NodeID, _ uint64) { - if !g.GossipTracker.RemoveValidator(nodeID) { - g.Log.Error("failed to remove a validator", - zap.Stringer("nodeID", nodeID), - ) - } -} - -// OnValidatorWeightChanged does nothing because PeerList gossip doesn't care -// about validator weights. -func (*GossipTrackerCallback) OnValidatorWeightChanged(ids.NodeID, uint64, uint64) {} diff --git a/network/peer/gossip_tracker_metrics.go b/network/peer/gossip_tracker_metrics.go deleted file mode 100644 index 080f37fde5c1..000000000000 --- a/network/peer/gossip_tracker_metrics.go +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - -package peer - -import ( - "github.com/prometheus/client_golang/prometheus" - - "github.com/ava-labs/avalanchego/utils" -) - -type gossipTrackerMetrics struct { - trackedPeersSize prometheus.Gauge - validatorsSize prometheus.Gauge -} - -func newGossipTrackerMetrics(registerer prometheus.Registerer, namespace string) (gossipTrackerMetrics, error) { - m := gossipTrackerMetrics{ - trackedPeersSize: prometheus.NewGauge( - prometheus.GaugeOpts{ - Namespace: namespace, - Name: "tracked_peers_size", - Help: "amount of peers that are being tracked", - }, - ), - validatorsSize: prometheus.NewGauge( - prometheus.GaugeOpts{ - Namespace: namespace, - Name: "validators_size", - Help: "number of validators this node is tracking", - }, - ), - } - - err := utils.Err( - registerer.Register(m.trackedPeersSize), - registerer.Register(m.validatorsSize), - ) - return m, err -} diff --git a/network/peer/gossip_tracker_test.go b/network/peer/gossip_tracker_test.go deleted file mode 100644 index c9ab1ef8e026..000000000000 --- a/network/peer/gossip_tracker_test.go +++ /dev/null @@ -1,620 +0,0 @@ -// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - -package peer - -import ( - "testing" - - "github.com/prometheus/client_golang/prometheus" - - "github.com/stretchr/testify/require" - - "github.com/ava-labs/avalanchego/ids" -) - -var ( - // peers - p1 = ids.GenerateTestNodeID() - p2 = ids.GenerateTestNodeID() - p3 = ids.GenerateTestNodeID() - - // validators - v1 = ValidatorID{ - NodeID: ids.GenerateTestNodeID(), - TxID: ids.GenerateTestID(), - } - v2 = ValidatorID{ - NodeID: ids.GenerateTestNodeID(), - TxID: ids.GenerateTestID(), - } - v3 = ValidatorID{ - NodeID: ids.GenerateTestNodeID(), - TxID: ids.GenerateTestID(), - } -) - -func TestGossipTracker_Contains(t *testing.T) { - tests := []struct { - name string - track []ids.NodeID - contains ids.NodeID - expected bool - }{ - { - name: "empty", - track: []ids.NodeID{}, - contains: p1, - expected: false, - }, - { - name: "populated - does not contain", - track: []ids.NodeID{p1, p2}, - contains: p3, - expected: false, - }, - { - name: "populated - contains", - track: []ids.NodeID{p1, p2, p3}, - contains: p3, - expected: true, - }, - } - - for _, test := range tests { - t.Run(test.name, func(t *testing.T) { - require := require.New(t) - - g, err := NewGossipTracker(prometheus.NewRegistry(), "foobar") - require.NoError(err) - - for _, add := range test.track { - require.True(g.StartTrackingPeer(add)) - } - - require.Equal(test.expected, g.Tracked(test.contains)) - }) - } -} - -func TestGossipTracker_StartTrackingPeer(t *testing.T) { - tests := []struct { - name string - toStartTracking []ids.NodeID - expected []bool - }{ - { - // Tracking new peers always works - name: "unique adds", - toStartTracking: []ids.NodeID{p1, p2, p3}, - expected: []bool{true, true, true}, - }, - { - // We shouldn't be able to track a peer more than once - name: "duplicate adds", - toStartTracking: []ids.NodeID{p1, p1, p1}, - expected: []bool{true, false, false}, - }, - } - - for _, test := range tests { - t.Run(test.name, func(t *testing.T) { - require := require.New(t) - - g, err := NewGossipTracker(prometheus.NewRegistry(), "foobar") - require.NoError(err) - - for i, p := range test.toStartTracking { - require.Equal(test.expected[i], g.StartTrackingPeer(p)) - require.True(g.Tracked(p)) - } - }) - } -} - -func TestGossipTracker_StopTrackingPeer(t *testing.T) { - tests := []struct { - name string - toStartTracking []ids.NodeID - expectedStartTracking []bool - toStopTracking []ids.NodeID - expectedStopTracking []bool - }{ - { - // We should be able to stop tracking that we are tracking - name: "stop tracking tracked peers", - toStartTracking: []ids.NodeID{p1, p2, p3}, - toStopTracking: []ids.NodeID{p1, p2, p3}, - expectedStopTracking: []bool{true, true, true}, - }, - { - // We shouldn't be able to stop tracking peers we've stopped tracking - name: "stop tracking twice", - toStartTracking: []ids.NodeID{p1}, - toStopTracking: []ids.NodeID{p1, p1}, - expectedStopTracking: []bool{true, false}, - }, - { - // We shouldn't be able to stop tracking peers we were never tracking - name: "remove non-existent elements", - toStartTracking: []ids.NodeID{}, - expectedStartTracking: []bool{}, - toStopTracking: []ids.NodeID{p1, p2, p3}, - expectedStopTracking: []bool{false, false, false}, - }, - } - - for _, test := range tests { - t.Run(test.name, func(t *testing.T) { - require := require.New(t) - - g, err := NewGossipTracker(prometheus.NewRegistry(), "foobar") - require.NoError(err) - - for _, add := range test.toStartTracking { - require.True(g.StartTrackingPeer(add)) - require.True(g.Tracked(add)) - } - - for i, p := range test.toStopTracking { - require.Equal(test.expectedStopTracking[i], g.StopTrackingPeer(p)) - } - }) - } -} - -func TestGossipTracker_AddValidator(t *testing.T) { - type args struct { - validator ValidatorID - } - - tests := []struct { - name string - validators []ValidatorID - args args - expected bool - }{ - { - name: "not present", - validators: []ValidatorID{}, - args: args{validator: v1}, - expected: true, - }, - { - name: "already present txID but with different nodeID", - validators: []ValidatorID{v1}, - args: args{validator: ValidatorID{ - NodeID: ids.GenerateTestNodeID(), - TxID: v1.TxID, - }}, - expected: false, - }, - { - name: "already present nodeID but with different txID", - validators: []ValidatorID{v1}, - args: args{validator: ValidatorID{ - NodeID: v1.NodeID, - TxID: ids.GenerateTestID(), - }}, - expected: false, - }, - { - name: "already present validatorID", - validators: []ValidatorID{v1}, - args: args{validator: v1}, - expected: false, - }, - } - - for _, test := range tests { - t.Run(test.name, func(t *testing.T) { - require := require.New(t) - - g, err := NewGossipTracker(prometheus.NewRegistry(), "foobar") - require.NoError(err) - - for _, v := range test.validators { - require.True(g.AddValidator(v)) - } - - require.Equal(test.expected, g.AddValidator(test.args.validator)) - }) - } -} - -func TestGossipTracker_RemoveValidator(t *testing.T) { - type args struct { - id ids.NodeID - } - - tests := []struct { - name string - validators []ValidatorID - args args - expected bool - }{ - { - name: "not already present", - validators: []ValidatorID{}, - args: args{id: v1.NodeID}, - expected: false, - }, - { - name: "already present", - validators: []ValidatorID{v1}, - args: args{id: v1.NodeID}, - expected: true, - }, - } - - for _, test := range tests { - t.Run(test.name, func(t *testing.T) { - require := require.New(t) - - g, err := NewGossipTracker(prometheus.NewRegistry(), "foobar") - require.NoError(err) - - for _, v := range test.validators { - require.True(g.AddValidator(v)) - } - - require.Equal(test.expected, g.RemoveValidator(test.args.id)) - }) - } -} - -func TestGossipTracker_ResetValidator(t *testing.T) { - type args struct { - id ids.NodeID - } - - tests := []struct { - name string - validators []ValidatorID - args args - expected bool - }{ - { - name: "non-existent validator", - validators: []ValidatorID{}, - args: args{id: v1.NodeID}, - expected: false, - }, - { - name: "existing validator", - validators: []ValidatorID{v1}, - args: args{id: v1.NodeID}, - expected: true, - }, - } - - for _, test := range tests { - t.Run(test.name, func(t *testing.T) { - require := require.New(t) - - g, err := NewGossipTracker(prometheus.NewRegistry(), "foobar") - require.NoError(err) - - require.True(g.StartTrackingPeer(p1)) - - for _, v := range test.validators { - require.True(g.AddValidator(v)) - g.AddKnown(p1, []ids.ID{v.TxID}, nil) - - unknown, ok := g.GetUnknown(p1) - require.True(ok) - require.NotContains(unknown, v) - } - - require.Equal(test.expected, g.ResetValidator(test.args.id)) - - for _, v := range test.validators { - unknown, ok := g.GetUnknown(p1) - require.True(ok) - require.Contains(unknown, v) - } - }) - } -} - -func TestGossipTracker_AddKnown(t *testing.T) { - type args struct { - peerID ids.NodeID - txIDs []ids.ID - } - - tests := []struct { - name string - trackedPeers []ids.NodeID - validators []ValidatorID - args args - expectedTxIDs []ids.ID - expectedOk bool - }{ - { - // We should not be able to update an untracked peer - name: "untracked peer - empty", - trackedPeers: []ids.NodeID{}, - validators: []ValidatorID{}, - args: args{peerID: p1, txIDs: []ids.ID{}}, - expectedTxIDs: nil, - expectedOk: false, - }, - { - // We should not be able to update an untracked peer - name: "untracked peer - populated", - trackedPeers: []ids.NodeID{p2, p3}, - validators: []ValidatorID{}, - args: args{peerID: p1, txIDs: []ids.ID{}}, - expectedTxIDs: nil, - expectedOk: false, - }, - { - // We shouldn't be able to look up a peer that isn't tracked - name: "untracked peer - unknown validator", - trackedPeers: []ids.NodeID{}, - validators: []ValidatorID{}, - args: args{peerID: p1, txIDs: []ids.ID{v1.TxID}}, - expectedTxIDs: nil, - expectedOk: false, - }, - { - // We shouldn't fail on a validator that's not registered - name: "tracked peer - unknown validator", - trackedPeers: []ids.NodeID{p1}, - validators: []ValidatorID{}, - args: args{peerID: p1, txIDs: []ids.ID{v1.TxID}}, - expectedTxIDs: []ids.ID{}, - expectedOk: true, - }, - { - // We should be able to update a tracked validator - name: "update tracked validator", - trackedPeers: []ids.NodeID{p1, p2, p3}, - validators: []ValidatorID{v1}, - args: args{peerID: p1, txIDs: []ids.ID{v1.TxID}}, - expectedTxIDs: []ids.ID{v1.TxID}, - expectedOk: true, - }, - } - - for _, test := range tests { - t.Run(test.name, func(t *testing.T) { - require := require.New(t) - - g, err := NewGossipTracker(prometheus.NewRegistry(), "foobar") - require.NoError(err) - - for _, p := range test.trackedPeers { - require.True(g.StartTrackingPeer(p)) - require.True(g.Tracked(p)) - } - - for _, v := range test.validators { - require.True(g.AddValidator(v)) - } - - txIDs, ok := g.AddKnown(test.args.peerID, test.args.txIDs, test.args.txIDs) - require.Equal(test.expectedOk, ok) - require.Equal(test.expectedTxIDs, txIDs) - }) - } -} - -func TestGossipTracker_GetUnknown(t *testing.T) { - tests := []struct { - name string - peerID ids.NodeID - peersToTrack []ids.NodeID - validators []ValidatorID - expectedUnknown []ValidatorID - expectedOk bool - }{ - { - name: "non tracked peer", - peerID: p1, - validators: []ValidatorID{v2}, - peersToTrack: []ids.NodeID{}, - expectedUnknown: nil, - expectedOk: false, - }, - { - name: "only validators", - peerID: p1, - peersToTrack: []ids.NodeID{p1}, - validators: []ValidatorID{v2}, - expectedUnknown: []ValidatorID{v2}, - expectedOk: true, - }, - { - name: "only non-validators", - peerID: p1, - peersToTrack: []ids.NodeID{p1, p2}, - validators: []ValidatorID{}, - expectedUnknown: []ValidatorID{}, - expectedOk: true, - }, - { - name: "validators and non-validators", - peerID: p1, - peersToTrack: []ids.NodeID{p1, p3}, - validators: []ValidatorID{v2}, - expectedUnknown: []ValidatorID{v2}, - expectedOk: true, - }, - { - name: "same as limit", - peerID: p1, - peersToTrack: []ids.NodeID{p1}, - validators: []ValidatorID{v2, v3}, - expectedUnknown: []ValidatorID{v2, v3}, - expectedOk: true, - }, - } - - for _, test := range tests { - t.Run(test.name, func(t *testing.T) { - require := require.New(t) - - g, err := NewGossipTracker(prometheus.NewRegistry(), "foobar") - require.NoError(err) - - // add our validators - for _, validator := range test.validators { - require.True(g.AddValidator(validator)) - } - - // start tracking our peers - for _, nonValidator := range test.peersToTrack { - require.True(g.StartTrackingPeer(nonValidator)) - require.True(g.Tracked(nonValidator)) - } - - // get the unknown peers for this peer - result, ok := g.GetUnknown(test.peerID) - require.Equal(test.expectedOk, ok) - require.Len(result, len(test.expectedUnknown)) - for _, v := range test.expectedUnknown { - require.Contains(result, v) - } - }) - } -} - -func TestGossipTracker_E2E(t *testing.T) { - require := require.New(t) - - g, err := NewGossipTracker(prometheus.NewRegistry(), "foobar") - require.NoError(err) - - // [v1, v2, v3] are validators - require.True(g.AddValidator(v1)) - require.True(g.AddValidator(v2)) - - // we should get an empty unknown since we're not tracking anything - unknown, ok := g.GetUnknown(p1) - require.False(ok) - require.Nil(unknown) - - // we should get a unknown of [v1, v2] since v1 and v2 are registered - require.True(g.StartTrackingPeer(p1)) - require.True(g.Tracked(p1)) - - // check p1's unknown - unknown, ok = g.GetUnknown(p1) - require.True(ok) - require.Contains(unknown, v1) - require.Contains(unknown, v2) - require.Len(unknown, 2) - - // Check p2's unknown. We should get nothing since we're not tracking it - // yet. - unknown, ok = g.GetUnknown(p2) - require.False(ok) - require.Nil(unknown) - - // Start tracking p2 - require.True(g.StartTrackingPeer(p2)) - - // check p2's unknown - unknown, ok = g.GetUnknown(p2) - require.True(ok) - require.Contains(unknown, v1) - require.Contains(unknown, v2) - require.Len(unknown, 2) - - // p1 now knows about v1, but not v2, so it should see [v2] in its unknown - // p2 still knows nothing, so it should see both - txIDs, ok := g.AddKnown(p1, []ids.ID{v1.TxID}, []ids.ID{v1.TxID}) - require.True(ok) - require.Equal([]ids.ID{v1.TxID}, txIDs) - - // p1 should have an unknown of [v2], since it knows v1 - unknown, ok = g.GetUnknown(p1) - require.True(ok) - require.Contains(unknown, v2) - require.Len(unknown, 1) - - // p2 should have a unknown of [v1, v2], since it knows nothing - unknown, ok = g.GetUnknown(p2) - require.True(ok) - require.Contains(unknown, v1) - require.Contains(unknown, v2) - require.Len(unknown, 2) - - // Add v3 - require.True(g.AddValidator(v3)) - - // track p3, who knows of v1, v2, and v3 - // p1 and p2 still don't know of v3 - require.True(g.StartTrackingPeer(p3)) - - txIDs, ok = g.AddKnown(p3, []ids.ID{v1.TxID, v2.TxID, v3.TxID}, []ids.ID{v1.TxID, v2.TxID, v3.TxID}) - require.True(ok) - require.Equal([]ids.ID{v1.TxID, v2.TxID, v3.TxID}, txIDs) - - // p1 doesn't know about [v2, v3] - unknown, ok = g.GetUnknown(p1) - require.True(ok) - require.Contains(unknown, v2) - require.Contains(unknown, v3) - require.Len(unknown, 2) - - // p2 doesn't know about [v1, v2, v3] - unknown, ok = g.GetUnknown(p2) - require.True(ok) - require.Contains(unknown, v1) - require.Contains(unknown, v2) - require.Contains(unknown, v3) - require.Len(unknown, 3) - - // p3 knows about everyone - unknown, ok = g.GetUnknown(p3) - require.True(ok) - require.Empty(unknown) - - // stop tracking p2 - require.True(g.StopTrackingPeer(p2)) - unknown, ok = g.GetUnknown(p2) - require.False(ok) - require.Nil(unknown) - - // p1 doesn't know about [v2, v3] because v2 is still registered as - // a validator - unknown, ok = g.GetUnknown(p1) - require.True(ok) - require.Contains(unknown, v2) - require.Contains(unknown, v3) - require.Len(unknown, 2) - - // Remove p2 from the validator set - require.True(g.RemoveValidator(v2.NodeID)) - - // p1 doesn't know about [v3] since v2 left the validator set - unknown, ok = g.GetUnknown(p1) - require.True(ok) - require.Contains(unknown, v3) - require.Len(unknown, 1) - - // p3 knows about everyone since it learned about v1 and v3 earlier. - unknown, ok = g.GetUnknown(p3) - require.Empty(unknown) - require.True(ok) -} - -func TestGossipTracker_Regression_IncorrectTxIDDeletion(t *testing.T) { - require := require.New(t) - - g, err := NewGossipTracker(prometheus.NewRegistry(), "foobar") - require.NoError(err) - - require.True(g.AddValidator(v1)) - require.True(g.AddValidator(v2)) - - require.True(g.RemoveValidator(v1.NodeID)) - - require.False(g.AddValidator(ValidatorID{ - NodeID: ids.GenerateTestNodeID(), - TxID: v2.TxID, - })) -} diff --git a/network/peer/network.go b/network/peer/network.go index 8c18ef0ac899..b8fb01814546 100644 --- a/network/peer/network.go +++ b/network/peer/network.go @@ -5,7 +5,7 @@ package peer import ( "github.com/ava-labs/avalanchego/ids" - "github.com/ava-labs/avalanchego/proto/pb/p2p" + "github.com/ava-labs/avalanchego/utils/bloom" "github.com/ava-labs/avalanchego/utils/ips" ) @@ -19,15 +19,9 @@ type Network interface { // connection is no longer desired and should be terminated. AllowConnection(peerID ids.NodeID) bool - // Track allows the peer to notify the network of a potential new peer to - // connect to, given the [ips] of the peers it sent us during the peer - // handshake. - // - // Returns which IPs should not be gossipped to this node again. - Track(peerID ids.NodeID, ips []*ips.ClaimedIPPort) ([]*p2p.PeerAck, error) - - // MarkTracked stops sending gossip about [ips] to [peerID]. - MarkTracked(peerID ids.NodeID, ips []*p2p.PeerAck) error + // Track allows the peer to notify the network of potential new peers to + // connect to. + Track(ips []*ips.ClaimedIPPort) error // Disconnected is called when the peer finishes shutting down. It is not // guaranteed that [Connected] was called for the provided peer. However, it @@ -35,6 +29,13 @@ type Network interface { // for a given [Peer] object. Disconnected(peerID ids.NodeID) - // Peers returns peers that [peerID] might not know about. - Peers(peerID ids.NodeID) ([]ips.ClaimedIPPort, error) + // KnownPeers returns the bloom filter of the known peers. + KnownPeers() (bloomFilter []byte, salt []byte) + + // Peers returns peers that are not known. + Peers( + peerID ids.NodeID, + knownPeers *bloom.ReadFilter, + peerSalt []byte, + ) []*ips.ClaimedIPPort } diff --git a/network/peer/peer.go b/network/peer/peer.go index 16b5d3ab3090..db2cb5485b04 100644 --- a/network/peer/peer.go +++ b/network/peer/peer.go @@ -21,6 +21,7 @@ import ( "github.com/ava-labs/avalanchego/proto/pb/p2p" "github.com/ava-labs/avalanchego/staking" "github.com/ava-labs/avalanchego/utils" + "github.com/ava-labs/avalanchego/utils/bloom" "github.com/ava-labs/avalanchego/utils/constants" "github.com/ava-labs/avalanchego/utils/ips" "github.com/ava-labs/avalanchego/utils/json" @@ -29,6 +30,10 @@ import ( "github.com/ava-labs/avalanchego/version" ) +// maxBloomSaltLen restricts the allowed size of the bloom salt to prevent +// excessively expensive bloom filter contains checks. +const maxBloomSaltLen = 32 + var ( errClosed = errors.New("closed") @@ -91,6 +96,11 @@ type Peer interface { // sent. StartSendPeerList() + // StartSendGetPeerList attempts to send a GetPeerList message to this peer + // on this peer's gossip routine. It is not guaranteed that a GetPeerList + // will be sent. + StartSendGetPeerList() + // StartClose will begin shutting down the peer. It will not block. StartClose() @@ -170,6 +180,10 @@ type peer struct { // peerListChan signals that we should attempt to send a PeerList to this // peer peerListChan chan struct{} + + // getPeerListChan signals that we should attempt to send a GetPeerList to + // this peer + getPeerListChan chan struct{} } // Start a new peer instance. @@ -197,6 +211,7 @@ func Start( onClosed: make(chan struct{}), observedUptimes: make(map[ids.ID]uint32), peerListChan: make(chan struct{}, 1), + getPeerListChan: make(chan struct{}, 1), } go p.readMessages() @@ -310,6 +325,13 @@ func (p *peer) StartSendPeerList() { } } +func (p *peer) StartSendGetPeerList() { + select { + case p.getPeerListChan <- struct{}{}: + default: + } +} + func (p *peer) StartClose() { p.startClosingOnce.Do(func() { if err := p.conn.Close(); err != nil { @@ -516,6 +538,8 @@ func (p *peer) writeMessages() { Patch: myVersion.Patch, } + knownPeersFilter, knownPeersSalt := p.Network.KnownPeers() + msg, err := p.MessageCreator.Handshake( p.NetworkID, p.Clock.Unix(), @@ -530,6 +554,8 @@ func (p *peer) writeMessages() { p.MySubnets.List(), p.SupportedACPs, p.ObjectedACPs, + knownPeersFilter, + knownPeersSalt, ) if err != nil { p.Log.Error("failed to create message", @@ -621,15 +647,7 @@ func (p *peer) sendNetworkMessages() { for { select { case <-p.peerListChan: - peerIPs, err := p.Config.Network.Peers(p.id) - if err != nil { - p.Log.Error("failed to get peers to gossip", - zap.Stringer("nodeID", p.id), - zap.Error(err), - ) - return - } - + peerIPs := p.Config.Network.Peers(p.id, bloom.EmptyFilter, nil) if len(peerIPs) == 0 { p.Log.Verbo( "skipping peer gossip as there are no unknown peers", @@ -654,6 +672,22 @@ func (p *peer) sendNetworkMessages() { zap.Stringer("nodeID", p.id), ) } + case <-p.getPeerListChan: + knownPeersFilter, knownPeersSalt := p.Config.Network.KnownPeers() + msg, err := p.Config.MessageCreator.GetPeerList(knownPeersFilter, knownPeersSalt) + if err != nil { + p.Log.Error("failed to create get peer list message", + zap.Stringer("nodeID", p.id), + zap.Error(err), + ) + continue + } + + if !p.Send(p.onClosingCtx, msg) { + p.Log.Debug("failed to send get peer list", + zap.Stringer("nodeID", p.id), + ) + } case <-sendPingsTicker.C: if !p.Network.AllowConnection(p.id) { p.Log.Debug("disconnecting from peer", @@ -707,12 +741,12 @@ func (p *peer) handle(msg message.InboundMessage) { p.handleHandshake(m) msg.OnFinishedHandling() return - case *p2p.PeerList: - p.handlePeerList(m) + case *p2p.GetPeerList: + p.handleGetPeerList(m) msg.OnFinishedHandling() return - case *p2p.PeerListAck: - p.handlePeerListAck(m) + case *p2p.PeerList: + p.handlePeerList(m) msg.OnFinishedHandling() return } @@ -992,6 +1026,37 @@ func (p *peer) handleHandshake(msg *p2p.Handshake) { return } + var ( + knownPeers = bloom.EmptyFilter + salt []byte + ) + if msg.KnownPeers != nil { + var err error + knownPeers, err = bloom.Parse(msg.KnownPeers.Filter) + if err != nil { + p.Log.Debug("message with invalid field", + zap.Stringer("nodeID", p.id), + zap.Stringer("messageOp", message.HandshakeOp), + zap.String("field", "KnownPeers.Filter"), + zap.Error(err), + ) + p.StartClose() + return + } + + salt = msg.KnownPeers.Salt + if saltLen := len(salt); saltLen > maxBloomSaltLen { + p.Log.Debug("message with invalid field", + zap.Stringer("nodeID", p.id), + zap.Stringer("messageOp", message.HandshakeOp), + zap.String("field", "KnownPeers.Salt"), + zap.Int("saltLen", saltLen), + ) + p.StartClose() + return + } + } + // "net.IP" type in Golang is 16-byte if ipLen := len(msg.IpAddr); ipLen != net.IPv6len { p.Log.Debug("message with invalid field", @@ -1035,14 +1100,7 @@ func (p *peer) handleHandshake(msg *p2p.Handshake) { p.gotHandshake.Set(true) - peerIPs, err := p.Network.Peers(p.id) - if err != nil { - p.Log.Error("failed to get peers to gossip for handshake", - zap.Stringer("nodeID", p.id), - zap.Error(err), - ) - return - } + peerIPs := p.Network.Peers(p.id, knownPeers, salt) // We bypass throttling here to ensure that the peerlist message is // acknowledged timely. @@ -1066,6 +1124,65 @@ func (p *peer) handleHandshake(msg *p2p.Handshake) { } } +func (p *peer) handleGetPeerList(msg *p2p.GetPeerList) { + if !p.finishedHandshake.Get() { + p.Log.Verbo("dropping get peer list message", + zap.Stringer("nodeID", p.id), + ) + return + } + + knownPeersMsg := msg.GetKnownPeers() + filter, err := bloom.Parse(knownPeersMsg.GetFilter()) + if err != nil { + p.Log.Debug("message with invalid field", + zap.Stringer("nodeID", p.id), + zap.Stringer("messageOp", message.GetPeerListOp), + zap.String("field", "KnownPeers.Filter"), + zap.Error(err), + ) + p.StartClose() + return + } + + salt := knownPeersMsg.GetSalt() + if saltLen := len(salt); saltLen > maxBloomSaltLen { + p.Log.Debug("message with invalid field", + zap.Stringer("nodeID", p.id), + zap.Stringer("messageOp", message.GetPeerListOp), + zap.String("field", "KnownPeers.Salt"), + zap.Int("saltLen", saltLen), + ) + p.StartClose() + return + } + + peerIPs := p.Network.Peers(p.id, filter, salt) + if len(peerIPs) == 0 { + p.Log.Debug("skipping sending of empty peer list", + zap.Stringer("nodeID", p.id), + ) + return + } + + // Bypass throttling is disabled here to follow the non-handshake message + // sending pattern. + peerListMsg, err := p.Config.MessageCreator.PeerList(peerIPs, false /*=bypassThrottling*/) + if err != nil { + p.Log.Error("failed to create peer list message", + zap.Stringer("nodeID", p.id), + zap.Error(err), + ) + return + } + + if !p.Send(p.onClosingCtx, peerListMsg) { + p.Log.Debug("failed to send peer list", + zap.Stringer("nodeID", p.id), + ) + } +} + func (p *peer) handlePeerList(msg *p2p.PeerList) { if !p.finishedHandshake.Get() { if !p.gotHandshake.Get() { @@ -1114,32 +1231,18 @@ func (p *peer) handlePeerList(msg *p2p.PeerList) { continue } - txID, err := ids.ToID(claimedIPPort.TxId) - if err != nil { - p.Log.Debug("message with invalid field", - zap.Stringer("nodeID", p.id), - zap.Stringer("messageOp", message.PeerListOp), - zap.String("field", "txID"), - zap.Error(err), - ) - p.StartClose() - return - } - - discoveredIPs[i] = &ips.ClaimedIPPort{ - Cert: tlsCert, - IPPort: ips.IPPort{ + discoveredIPs[i] = ips.NewClaimedIPPort( + tlsCert, + ips.IPPort{ IP: claimedIPPort.IpAddr, Port: uint16(claimedIPPort.IpPort), }, - Timestamp: claimedIPPort.Timestamp, - Signature: claimedIPPort.Signature, - TxID: txID, - } + claimedIPPort.Timestamp, + claimedIPPort.Signature, + ) } - trackedPeers, err := p.Network.Track(p.id, discoveredIPs) - if err != nil { + if err := p.Network.Track(discoveredIPs); err != nil { p.Log.Debug("message with invalid field", zap.Stringer("nodeID", p.id), zap.Stringer("messageOp", message.PeerListOp), @@ -1147,42 +1250,6 @@ func (p *peer) handlePeerList(msg *p2p.PeerList) { zap.Error(err), ) p.StartClose() - return - } - if len(trackedPeers) == 0 { - p.Log.Debug("skipping peerlist ack as there were no tracked peers", - zap.Stringer("nodeID", p.id), - ) - return - } - - peerListAckMsg, err := p.Config.MessageCreator.PeerListAck(trackedPeers) - if err != nil { - p.Log.Error("failed to create message", - zap.Stringer("messageOp", message.PeerListAckOp), - zap.Stringer("nodeID", p.id), - zap.Error(err), - ) - return - } - - if !p.Send(p.onClosingCtx, peerListAckMsg) { - p.Log.Debug("failed to send peer list ack", - zap.Stringer("nodeID", p.id), - ) - } -} - -func (p *peer) handlePeerListAck(msg *p2p.PeerListAck) { - err := p.Network.MarkTracked(p.id, msg.PeerAcks) - if err != nil { - p.Log.Debug("message with invalid field", - zap.Stringer("nodeID", p.id), - zap.Stringer("messageOp", message.PeerListAckOp), - zap.String("field", "txID"), - zap.Error(err), - ) - p.StartClose() } } diff --git a/network/peer/test_network.go b/network/peer/test_network.go index 1ba047e1d423..01a341ae9abc 100644 --- a/network/peer/test_network.go +++ b/network/peer/test_network.go @@ -5,7 +5,7 @@ package peer import ( "github.com/ava-labs/avalanchego/ids" - "github.com/ava-labs/avalanchego/proto/pb/p2p" + "github.com/ava-labs/avalanchego/utils/bloom" "github.com/ava-labs/avalanchego/utils/ips" ) @@ -19,16 +19,16 @@ func (testNetwork) AllowConnection(ids.NodeID) bool { return true } -func (testNetwork) Track(ids.NodeID, []*ips.ClaimedIPPort) ([]*p2p.PeerAck, error) { - return nil, nil -} - -func (testNetwork) MarkTracked(ids.NodeID, []*p2p.PeerAck) error { +func (testNetwork) Track([]*ips.ClaimedIPPort) error { return nil } func (testNetwork) Disconnected(ids.NodeID) {} -func (testNetwork) Peers(ids.NodeID) ([]ips.ClaimedIPPort, error) { - return nil, nil +func (testNetwork) KnownPeers() ([]byte, []byte) { + return bloom.EmptyFilter.Marshal(), nil +} + +func (testNetwork) Peers(ids.NodeID, *bloom.ReadFilter, []byte) []*ips.ClaimedIPPort { + return nil } diff --git a/network/test_network.go b/network/test_network.go index 0811875b4c43..8079e76240c1 100644 --- a/network/test_network.go +++ b/network/test_network.go @@ -156,6 +156,8 @@ func NewTestNetwork( PeerListNonValidatorGossipSize: constants.DefaultNetworkPeerListNonValidatorGossipSize, PeerListPeersGossipSize: constants.DefaultNetworkPeerListPeersGossipSize, PeerListGossipFreq: constants.DefaultNetworkPeerListGossipFreq, + PeerListPullGossipFreq: constants.DefaultNetworkPeerListPullGossipFreq, + PeerListBloomResetFreq: constants.DefaultNetworkPeerListBloomResetFreq, }, DelayConfig: DelayConfig{ @@ -186,9 +188,8 @@ func NewTestNetwork( networkConfig.TLSConfig = tlsConfig networkConfig.TLSKey = tlsCert.PrivateKey.(crypto.Signer) - beacons := validators.NewManager() networkConfig.Validators = currentValidators - networkConfig.Beacons = beacons + networkConfig.Beacons = validators.NewManager() // This never actually does anything because we never initialize the P-chain networkConfig.UptimeCalculator = uptime.NoOpCalculator @@ -227,11 +228,6 @@ func NewTestNetwork( networkConfig.MyIPPort = ips.NewDynamicIPPort(net.IPv4zero, 1) - networkConfig.GossipTracker, err = peer.NewGossipTracker(metrics, "") - if err != nil { - return nil, err - } - return NewNetwork( &networkConfig, msgCreator, diff --git a/node/node.go b/node/node.go index 8fce5df75550..24f5c1711767 100644 --- a/node/node.go +++ b/node/node.go @@ -583,18 +583,6 @@ func (n *Node) initNetworking() error { }() } - // initialize gossip tracker - gossipTracker, err := peer.NewGossipTracker(n.MetricsRegisterer, n.networkNamespace) - if err != nil { - return err - } - - // keep gossip tracker synchronized with the validator set - n.vdrs.RegisterCallbackListener(constants.PrimaryNetworkID, &peer.GossipTrackerCallback{ - Log: n.Log, - GossipTracker: gossipTracker, - }) - // add node configs to network config n.Config.NetworkConfig.Namespace = n.networkNamespace n.Config.NetworkConfig.MyNodeID = n.ID @@ -610,7 +598,6 @@ func (n *Node) initNetworking() error { n.Config.NetworkConfig.ResourceTracker = n.resourceTracker n.Config.NetworkConfig.CPUTargeter = n.cpuTargeter n.Config.NetworkConfig.DiskTargeter = n.diskTargeter - n.Config.NetworkConfig.GossipTracker = gossipTracker n.Net, err = network.NewNetwork( &n.Config.NetworkConfig, diff --git a/proto/p2p/p2p.proto b/proto/p2p/p2p.proto index 53a4d3d2126a..6b5deacc7e01 100644 --- a/proto/p2p/p2p.proto +++ b/proto/p2p/p2p.proto @@ -8,6 +8,8 @@ option go_package = "github.com/ava-labs/avalanchego/proto/pb/p2p"; // Represents peer-to-peer messages. // Only one type can be non-null. message Message { + reserved 33; // Until after durango activation. + reserved 36; // Next unused field number. // NOTES // Use "oneof" for each message type and set rest to null if not used. // That is because when the compression is enabled, we don't want to include uncompressed fields. @@ -29,6 +31,7 @@ message Message { Ping ping = 11; Pong pong = 12; Handshake handshake = 13; + GetPeerList get_peer_list = 35; PeerList peer_list = 14; // State-sync messages: @@ -56,8 +59,6 @@ message Message { AppRequest app_request = 30; AppResponse app_response = 31; AppGossip app_gossip = 32; - - PeerListAck peer_list_ack = 33; AppError app_error = 34; } } @@ -118,6 +119,7 @@ message Handshake { Client client = 9; repeated uint32 supported_acps = 10; repeated uint32 objected_acps = 11; + BloomFilter known_peers = 12; } // Metadata about a peer's P2P client used to determine compatibility @@ -130,6 +132,12 @@ message Client { uint32 patch = 4; } +// BloomFilter with a random salt to prevent consistent hash collisions +message BloomFilter { + bytes filter = 1; + bytes salt = 2; +} + // ClaimedIpPort contains metadata needed to connect to a peer message ClaimedIpPort { // X509 certificate of the peer @@ -146,38 +154,29 @@ message ClaimedIpPort { bytes tx_id = 6; } +// GetPeerList contains a bloom filter of the currently known validator IPs. +// +// GetPeerList must not be responded to until finishing the handshake. After the +// handshake is completed, GetPeerlist messages should be responded to with a +// Peerlist message containing validators that are not present in the bloom +// filter. +message GetPeerList { + BloomFilter known_peers = 1; +} + // PeerList contains network-level metadata for a set of validators. // // PeerList must be sent in response to an inbound Handshake message from a // remote peer a peer wants to connect to. Once a PeerList is received after // a Handshake message, the p2p handshake is complete and the connection is // established. - -// Peers should periodically send PeerList messages to allow peers to -// discover each other. // -// PeerListAck should be sent in response to a PeerList. +// PeerList should be sent in response to a GetPeerlist message if the handshake +// has been completed. message PeerList { repeated ClaimedIpPort claimed_ip_ports = 1; } -// PeerAck acknowledges that a gossiped peer in a PeerList message will be -// tracked by the remote peer. -message PeerAck { - // P-Chain transaction that added the acknowledged peer to the validator - // set - bytes tx_id = 1; - // Timestamp of the signed ip of the peer - uint64 timestamp = 2; -} - -// PeerListAck is sent in response to PeerList to acknowledge the subset of -// peers that the peer will attempt to connect to. -message PeerListAck { - reserved 1; // deprecated; used to be tx_ids - repeated PeerAck peer_acks = 2; -} - // GetStateSummaryFrontier requests a peer's most recently accepted state // summary message GetStateSummaryFrontier { diff --git a/proto/pb/p2p/p2p.pb.go b/proto/pb/p2p/p2p.pb.go index 166a8d11f493..0732bf1a13c8 100644 --- a/proto/pb/p2p/p2p.pb.go +++ b/proto/pb/p2p/p2p.pb.go @@ -89,7 +89,8 @@ type Message struct { // *Message_Ping // *Message_Pong // *Message_Handshake - // *Message_PeerList + // *Message_GetPeerList + // *Message_PeerList_ // *Message_GetStateSummaryFrontier // *Message_StateSummaryFrontier_ // *Message_GetAcceptedStateSummary @@ -108,7 +109,6 @@ type Message struct { // *Message_AppRequest // *Message_AppResponse // *Message_AppGossip - // *Message_PeerListAck // *Message_AppError Message isMessage_Message `protobuf_oneof:"message"` } @@ -187,9 +187,16 @@ func (x *Message) GetHandshake() *Handshake { return nil } -func (x *Message) GetPeerList() *PeerList { - if x, ok := x.GetMessage().(*Message_PeerList); ok { - return x.PeerList +func (x *Message) GetGetPeerList() *GetPeerList { + if x, ok := x.GetMessage().(*Message_GetPeerList); ok { + return x.GetPeerList + } + return nil +} + +func (x *Message) GetPeerList_() *PeerList { + if x, ok := x.GetMessage().(*Message_PeerList_); ok { + return x.PeerList_ } return nil } @@ -320,13 +327,6 @@ func (x *Message) GetAppGossip() *AppGossip { return nil } -func (x *Message) GetPeerListAck() *PeerListAck { - if x, ok := x.GetMessage().(*Message_PeerListAck); ok { - return x.PeerListAck - } - return nil -} - func (x *Message) GetAppError() *AppError { if x, ok := x.GetMessage().(*Message_AppError); ok { return x.AppError @@ -365,8 +365,12 @@ type Message_Handshake struct { Handshake *Handshake `protobuf:"bytes,13,opt,name=handshake,proto3,oneof"` } -type Message_PeerList struct { - PeerList *PeerList `protobuf:"bytes,14,opt,name=peer_list,json=peerList,proto3,oneof"` +type Message_GetPeerList struct { + GetPeerList *GetPeerList `protobuf:"bytes,35,opt,name=get_peer_list,json=getPeerList,proto3,oneof"` +} + +type Message_PeerList_ struct { + PeerList_ *PeerList `protobuf:"bytes,14,opt,name=peer_list,json=peerList,proto3,oneof"` } type Message_GetStateSummaryFrontier struct { @@ -445,10 +449,6 @@ type Message_AppGossip struct { AppGossip *AppGossip `protobuf:"bytes,32,opt,name=app_gossip,json=appGossip,proto3,oneof"` } -type Message_PeerListAck struct { - PeerListAck *PeerListAck `protobuf:"bytes,33,opt,name=peer_list_ack,json=peerListAck,proto3,oneof"` -} - type Message_AppError struct { AppError *AppError `protobuf:"bytes,34,opt,name=app_error,json=appError,proto3,oneof"` } @@ -463,7 +463,9 @@ func (*Message_Pong) isMessage_Message() {} func (*Message_Handshake) isMessage_Message() {} -func (*Message_PeerList) isMessage_Message() {} +func (*Message_GetPeerList) isMessage_Message() {} + +func (*Message_PeerList_) isMessage_Message() {} func (*Message_GetStateSummaryFrontier) isMessage_Message() {} @@ -501,8 +503,6 @@ func (*Message_AppResponse) isMessage_Message() {} func (*Message_AppGossip) isMessage_Message() {} -func (*Message_PeerListAck) isMessage_Message() {} - func (*Message_AppError) isMessage_Message() {} // Ping reports a peer's perceived uptime percentage. @@ -711,10 +711,11 @@ type Handshake struct { // Signature of the peer IP port pair at a provided timestamp Sig []byte `protobuf:"bytes,7,opt,name=sig,proto3" json:"sig,omitempty"` // Subnets the peer is tracking - TrackedSubnets [][]byte `protobuf:"bytes,8,rep,name=tracked_subnets,json=trackedSubnets,proto3" json:"tracked_subnets,omitempty"` - Client *Client `protobuf:"bytes,9,opt,name=client,proto3" json:"client,omitempty"` - SupportedAcps []uint32 `protobuf:"varint,10,rep,packed,name=supported_acps,json=supportedAcps,proto3" json:"supported_acps,omitempty"` - ObjectedAcps []uint32 `protobuf:"varint,11,rep,packed,name=objected_acps,json=objectedAcps,proto3" json:"objected_acps,omitempty"` + TrackedSubnets [][]byte `protobuf:"bytes,8,rep,name=tracked_subnets,json=trackedSubnets,proto3" json:"tracked_subnets,omitempty"` + Client *Client `protobuf:"bytes,9,opt,name=client,proto3" json:"client,omitempty"` + SupportedAcps []uint32 `protobuf:"varint,10,rep,packed,name=supported_acps,json=supportedAcps,proto3" json:"supported_acps,omitempty"` + ObjectedAcps []uint32 `protobuf:"varint,11,rep,packed,name=objected_acps,json=objectedAcps,proto3" json:"objected_acps,omitempty"` + KnownPeers *BloomFilter `protobuf:"bytes,12,opt,name=known_peers,json=knownPeers,proto3" json:"known_peers,omitempty"` } func (x *Handshake) Reset() { @@ -826,6 +827,13 @@ func (x *Handshake) GetObjectedAcps() []uint32 { return nil } +func (x *Handshake) GetKnownPeers() *BloomFilter { + if x != nil { + return x.KnownPeers + } + return nil +} + // Metadata about a peer's P2P client used to determine compatibility type Client struct { state protoimpl.MessageState @@ -900,6 +908,62 @@ func (x *Client) GetPatch() uint32 { return 0 } +// BloomFilter with a random salt to prevent consistent hash collisions +type BloomFilter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Filter []byte `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"` + Salt []byte `protobuf:"bytes,2,opt,name=salt,proto3" json:"salt,omitempty"` +} + +func (x *BloomFilter) Reset() { + *x = BloomFilter{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_p2p_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BloomFilter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BloomFilter) ProtoMessage() {} + +func (x *BloomFilter) ProtoReflect() protoreflect.Message { + mi := &file_p2p_p2p_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BloomFilter.ProtoReflect.Descriptor instead. +func (*BloomFilter) Descriptor() ([]byte, []int) { + return file_p2p_p2p_proto_rawDescGZIP(), []int{6} +} + +func (x *BloomFilter) GetFilter() []byte { + if x != nil { + return x.Filter + } + return nil +} + +func (x *BloomFilter) GetSalt() []byte { + if x != nil { + return x.Salt + } + return nil +} + // ClaimedIpPort contains metadata needed to connect to a peer type ClaimedIpPort struct { state protoimpl.MessageState @@ -923,7 +987,7 @@ type ClaimedIpPort struct { func (x *ClaimedIpPort) Reset() { *x = ClaimedIpPort{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_p2p_proto_msgTypes[6] + mi := &file_p2p_p2p_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -936,7 +1000,7 @@ func (x *ClaimedIpPort) String() string { func (*ClaimedIpPort) ProtoMessage() {} func (x *ClaimedIpPort) ProtoReflect() protoreflect.Message { - mi := &file_p2p_p2p_proto_msgTypes[6] + mi := &file_p2p_p2p_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -949,7 +1013,7 @@ func (x *ClaimedIpPort) ProtoReflect() protoreflect.Message { // Deprecated: Use ClaimedIpPort.ProtoReflect.Descriptor instead. func (*ClaimedIpPort) Descriptor() ([]byte, []int) { - return file_p2p_p2p_proto_rawDescGZIP(), []int{6} + return file_p2p_p2p_proto_rawDescGZIP(), []int{7} } func (x *ClaimedIpPort) GetX509Certificate() []byte { @@ -994,73 +1058,22 @@ func (x *ClaimedIpPort) GetTxId() []byte { return nil } -// Peers should periodically send PeerList messages to allow peers to -// discover each other. +// GetPeerList contains a bloom filter of the currently known validator IPs. // -// PeerListAck should be sent in response to a PeerList. -type PeerList struct { +// GetPeerList must not be responded to until finishing the handshake. After the +// handshake is completed, GetPeerlist messages should be responded to with a +// Peerlist message containing validators that are not present in the bloom +// filter. +type GetPeerList struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ClaimedIpPorts []*ClaimedIpPort `protobuf:"bytes,1,rep,name=claimed_ip_ports,json=claimedIpPorts,proto3" json:"claimed_ip_ports,omitempty"` + KnownPeers *BloomFilter `protobuf:"bytes,1,opt,name=known_peers,json=knownPeers,proto3" json:"known_peers,omitempty"` } -func (x *PeerList) Reset() { - *x = PeerList{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_p2p_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PeerList) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PeerList) ProtoMessage() {} - -func (x *PeerList) ProtoReflect() protoreflect.Message { - mi := &file_p2p_p2p_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PeerList.ProtoReflect.Descriptor instead. -func (*PeerList) Descriptor() ([]byte, []int) { - return file_p2p_p2p_proto_rawDescGZIP(), []int{7} -} - -func (x *PeerList) GetClaimedIpPorts() []*ClaimedIpPort { - if x != nil { - return x.ClaimedIpPorts - } - return nil -} - -// PeerAck acknowledges that a gossiped peer in a PeerList message will be -// tracked by the remote peer. -type PeerAck struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // P-Chain transaction that added the acknowledged peer to the validator - // set - TxId []byte `protobuf:"bytes,1,opt,name=tx_id,json=txId,proto3" json:"tx_id,omitempty"` - // Timestamp of the signed ip of the peer - Timestamp uint64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` -} - -func (x *PeerAck) Reset() { - *x = PeerAck{} +func (x *GetPeerList) Reset() { + *x = GetPeerList{} if protoimpl.UnsafeEnabled { mi := &file_p2p_p2p_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1068,13 +1081,13 @@ func (x *PeerAck) Reset() { } } -func (x *PeerAck) String() string { +func (x *GetPeerList) String() string { return protoimpl.X.MessageStringOf(x) } -func (*PeerAck) ProtoMessage() {} +func (*GetPeerList) ProtoMessage() {} -func (x *PeerAck) ProtoReflect() protoreflect.Message { +func (x *GetPeerList) ProtoReflect() protoreflect.Message { mi := &file_p2p_p2p_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1086,37 +1099,37 @@ func (x *PeerAck) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use PeerAck.ProtoReflect.Descriptor instead. -func (*PeerAck) Descriptor() ([]byte, []int) { +// Deprecated: Use GetPeerList.ProtoReflect.Descriptor instead. +func (*GetPeerList) Descriptor() ([]byte, []int) { return file_p2p_p2p_proto_rawDescGZIP(), []int{8} } -func (x *PeerAck) GetTxId() []byte { +func (x *GetPeerList) GetKnownPeers() *BloomFilter { if x != nil { - return x.TxId + return x.KnownPeers } return nil } -func (x *PeerAck) GetTimestamp() uint64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -// PeerListAck is sent in response to PeerList to acknowledge the subset of -// peers that the peer will attempt to connect to. -type PeerListAck struct { +// PeerList contains network-level metadata for a set of validators. +// +// PeerList must be sent in response to an inbound Handshake message from a +// remote peer a peer wants to connect to. Once a PeerList is received after +// a Handshake message, the p2p handshake is complete and the connection is +// established. +// +// PeerList should be sent in response to a GetPeerlist message if the handshake +// has been completed. +type PeerList struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - PeerAcks []*PeerAck `protobuf:"bytes,2,rep,name=peer_acks,json=peerAcks,proto3" json:"peer_acks,omitempty"` + ClaimedIpPorts []*ClaimedIpPort `protobuf:"bytes,1,rep,name=claimed_ip_ports,json=claimedIpPorts,proto3" json:"claimed_ip_ports,omitempty"` } -func (x *PeerListAck) Reset() { - *x = PeerListAck{} +func (x *PeerList) Reset() { + *x = PeerList{} if protoimpl.UnsafeEnabled { mi := &file_p2p_p2p_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1124,13 +1137,13 @@ func (x *PeerListAck) Reset() { } } -func (x *PeerListAck) String() string { +func (x *PeerList) String() string { return protoimpl.X.MessageStringOf(x) } -func (*PeerListAck) ProtoMessage() {} +func (*PeerList) ProtoMessage() {} -func (x *PeerListAck) ProtoReflect() protoreflect.Message { +func (x *PeerList) ProtoReflect() protoreflect.Message { mi := &file_p2p_p2p_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1142,14 +1155,14 @@ func (x *PeerListAck) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use PeerListAck.ProtoReflect.Descriptor instead. -func (*PeerListAck) Descriptor() ([]byte, []int) { +// Deprecated: Use PeerList.ProtoReflect.Descriptor instead. +func (*PeerList) Descriptor() ([]byte, []int) { return file_p2p_p2p_proto_rawDescGZIP(), []int{9} } -func (x *PeerListAck) GetPeerAcks() []*PeerAck { +func (x *PeerList) GetClaimedIpPorts() []*ClaimedIpPort { if x != nil { - return x.PeerAcks + return x.ClaimedIpPorts } return nil } @@ -2620,7 +2633,7 @@ var File_p2p_p2p_proto protoreflect.FileDescriptor var file_p2p_p2p_proto_rawDesc = []byte{ 0x0a, 0x0d, 0x70, 0x32, 0x70, 0x2f, 0x70, 0x32, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x03, 0x70, 0x32, 0x70, 0x22, 0x92, 0x0b, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x03, 0x70, 0x32, 0x70, 0x22, 0x9e, 0x0b, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x29, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x5f, 0x67, 0x7a, 0x69, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x47, 0x7a, 0x69, 0x70, 0x12, 0x29, 0x0a, 0x0f, 0x63, @@ -2633,334 +2646,337 @@ var file_p2p_p2p_proto_rawDesc = []byte{ 0x48, 0x00, 0x52, 0x04, 0x70, 0x6f, 0x6e, 0x67, 0x12, 0x2e, 0x0a, 0x09, 0x68, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x48, 0x00, 0x52, 0x09, 0x68, - 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x12, 0x2c, 0x0a, 0x09, 0x70, 0x65, 0x65, 0x72, - 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x32, - 0x70, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x00, 0x52, 0x08, 0x70, 0x65, - 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x5b, 0x0a, 0x1a, 0x67, 0x65, 0x74, 0x5f, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x66, 0x72, 0x6f, 0x6e, - 0x74, 0x69, 0x65, 0x72, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x32, 0x70, - 0x2e, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, - 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x69, 0x65, 0x72, 0x48, 0x00, 0x52, 0x17, 0x67, 0x65, 0x74, 0x53, - 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x46, 0x72, 0x6f, 0x6e, 0x74, - 0x69, 0x65, 0x72, 0x12, 0x51, 0x0a, 0x16, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x75, 0x6d, - 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x69, 0x65, 0x72, 0x18, 0x10, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, - 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x69, 0x65, 0x72, 0x48, 0x00, - 0x52, 0x14, 0x73, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x46, 0x72, - 0x6f, 0x6e, 0x74, 0x69, 0x65, 0x72, 0x12, 0x5b, 0x0a, 0x1a, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x63, - 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x75, 0x6d, - 0x6d, 0x61, 0x72, 0x79, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x32, 0x70, - 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x48, 0x00, 0x52, 0x17, 0x67, 0x65, 0x74, 0x41, - 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, - 0x61, 0x72, 0x79, 0x12, 0x51, 0x0a, 0x16, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x5f, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x12, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, - 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x48, 0x00, - 0x52, 0x14, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, - 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x4e, 0x0a, 0x15, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x63, - 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x69, 0x65, 0x72, 0x18, - 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x47, 0x65, 0x74, 0x41, - 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x69, 0x65, 0x72, 0x48, - 0x00, 0x52, 0x13, 0x67, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x46, 0x72, - 0x6f, 0x6e, 0x74, 0x69, 0x65, 0x72, 0x12, 0x44, 0x0a, 0x11, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, - 0x65, 0x64, 0x5f, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x69, 0x65, 0x72, 0x18, 0x14, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, - 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x69, 0x65, 0x72, 0x48, 0x00, 0x52, 0x10, 0x61, 0x63, 0x63, 0x65, - 0x70, 0x74, 0x65, 0x64, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x69, 0x65, 0x72, 0x12, 0x35, 0x0a, 0x0c, - 0x67, 0x65, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x18, 0x15, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, - 0x70, 0x74, 0x65, 0x64, 0x48, 0x00, 0x52, 0x0b, 0x67, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x70, - 0x74, 0x65, 0x64, 0x12, 0x2b, 0x0a, 0x08, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x18, - 0x16, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x41, 0x63, 0x63, 0x65, - 0x70, 0x74, 0x65, 0x64, 0x48, 0x00, 0x52, 0x08, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, - 0x12, 0x38, 0x0a, 0x0d, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, 0x72, - 0x73, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x47, 0x65, - 0x74, 0x41, 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x73, 0x48, 0x00, 0x52, 0x0c, 0x67, 0x65, - 0x74, 0x41, 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x2e, 0x0a, 0x09, 0x61, 0x6e, - 0x63, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x18, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, - 0x70, 0x32, 0x70, 0x2e, 0x41, 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x73, 0x48, 0x00, 0x52, - 0x09, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x1c, 0x0a, 0x03, 0x67, 0x65, - 0x74, 0x18, 0x19, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x47, 0x65, - 0x74, 0x48, 0x00, 0x52, 0x03, 0x67, 0x65, 0x74, 0x12, 0x1c, 0x0a, 0x03, 0x70, 0x75, 0x74, 0x18, - 0x1a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x50, 0x75, 0x74, 0x48, - 0x00, 0x52, 0x03, 0x70, 0x75, 0x74, 0x12, 0x2f, 0x0a, 0x0a, 0x70, 0x75, 0x73, 0x68, 0x5f, 0x71, - 0x75, 0x65, 0x72, 0x79, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x32, 0x70, - 0x2e, 0x50, 0x75, 0x73, 0x68, 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, 0x00, 0x52, 0x09, 0x70, 0x75, - 0x73, 0x68, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x2f, 0x0a, 0x0a, 0x70, 0x75, 0x6c, 0x6c, 0x5f, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x32, - 0x70, 0x2e, 0x50, 0x75, 0x6c, 0x6c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, 0x00, 0x52, 0x09, 0x70, - 0x75, 0x6c, 0x6c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x22, 0x0a, 0x05, 0x63, 0x68, 0x69, 0x74, - 0x73, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x43, 0x68, - 0x69, 0x74, 0x73, 0x48, 0x00, 0x52, 0x05, 0x63, 0x68, 0x69, 0x74, 0x73, 0x12, 0x32, 0x0a, 0x0b, - 0x61, 0x70, 0x70, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x1e, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x48, 0x00, 0x52, 0x0a, 0x61, 0x70, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x35, 0x0a, 0x0c, 0x61, 0x70, 0x70, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x41, 0x70, 0x70, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x61, 0x70, 0x70, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x0a, 0x61, 0x70, 0x70, 0x5f, 0x67, - 0x6f, 0x73, 0x73, 0x69, 0x70, 0x18, 0x20, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x32, - 0x70, 0x2e, 0x41, 0x70, 0x70, 0x47, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x48, 0x00, 0x52, 0x09, 0x61, - 0x70, 0x70, 0x47, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x12, 0x36, 0x0a, 0x0d, 0x70, 0x65, 0x65, 0x72, - 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x61, 0x63, 0x6b, 0x18, 0x21, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x10, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, - 0x6b, 0x48, 0x00, 0x52, 0x0b, 0x70, 0x65, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x6b, + 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x12, 0x36, 0x0a, 0x0d, 0x67, 0x65, 0x74, 0x5f, + 0x70, 0x65, 0x65, 0x72, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x23, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x10, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x65, 0x65, 0x72, 0x4c, 0x69, 0x73, + 0x74, 0x48, 0x00, 0x52, 0x0b, 0x67, 0x65, 0x74, 0x50, 0x65, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, + 0x12, 0x2c, 0x0a, 0x09, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x0e, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x4c, 0x69, + 0x73, 0x74, 0x48, 0x00, 0x52, 0x08, 0x70, 0x65, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x5b, + 0x0a, 0x1a, 0x67, 0x65, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x75, 0x6d, 0x6d, + 0x61, 0x72, 0x79, 0x5f, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x69, 0x65, 0x72, 0x18, 0x0f, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x69, 0x65, 0x72, + 0x48, 0x00, 0x52, 0x17, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, + 0x61, 0x72, 0x79, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x69, 0x65, 0x72, 0x12, 0x51, 0x0a, 0x16, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x66, 0x72, 0x6f, + 0x6e, 0x74, 0x69, 0x65, 0x72, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x32, + 0x70, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x46, 0x72, + 0x6f, 0x6e, 0x74, 0x69, 0x65, 0x72, 0x48, 0x00, 0x52, 0x14, 0x73, 0x74, 0x61, 0x74, 0x65, 0x53, + 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x69, 0x65, 0x72, 0x12, 0x5b, + 0x0a, 0x1a, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x5f, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x11, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, + 0x70, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, + 0x48, 0x00, 0x52, 0x17, 0x67, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x51, 0x0a, 0x16, 0x61, + 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x75, + 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x32, + 0x70, 0x2e, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, + 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x48, 0x00, 0x52, 0x14, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, + 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x4e, + 0x0a, 0x15, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x5f, 0x66, + 0x72, 0x6f, 0x6e, 0x74, 0x69, 0x65, 0x72, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, + 0x70, 0x32, 0x70, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x46, + 0x72, 0x6f, 0x6e, 0x74, 0x69, 0x65, 0x72, 0x48, 0x00, 0x52, 0x13, 0x67, 0x65, 0x74, 0x41, 0x63, + 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x69, 0x65, 0x72, 0x12, 0x44, + 0x0a, 0x11, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x72, 0x6f, 0x6e, 0x74, + 0x69, 0x65, 0x72, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x32, 0x70, 0x2e, + 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x69, 0x65, 0x72, + 0x48, 0x00, 0x52, 0x10, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x46, 0x72, 0x6f, 0x6e, + 0x74, 0x69, 0x65, 0x72, 0x12, 0x35, 0x0a, 0x0c, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x65, + 0x70, 0x74, 0x65, 0x64, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x32, 0x70, + 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x48, 0x00, 0x52, 0x0b, + 0x67, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x12, 0x2b, 0x0a, 0x08, 0x61, + 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, + 0x70, 0x32, 0x70, 0x2e, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x48, 0x00, 0x52, 0x08, + 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x12, 0x38, 0x0a, 0x0d, 0x67, 0x65, 0x74, 0x5f, + 0x61, 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x11, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, + 0x72, 0x73, 0x48, 0x00, 0x52, 0x0c, 0x67, 0x65, 0x74, 0x41, 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, + 0x72, 0x73, 0x12, 0x2e, 0x0a, 0x09, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x73, 0x18, + 0x18, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x41, 0x6e, 0x63, 0x65, + 0x73, 0x74, 0x6f, 0x72, 0x73, 0x48, 0x00, 0x52, 0x09, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, + 0x72, 0x73, 0x12, 0x1c, 0x0a, 0x03, 0x67, 0x65, 0x74, 0x18, 0x19, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x08, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x47, 0x65, 0x74, 0x48, 0x00, 0x52, 0x03, 0x67, 0x65, 0x74, + 0x12, 0x1c, 0x0a, 0x03, 0x70, 0x75, 0x74, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, + 0x70, 0x32, 0x70, 0x2e, 0x50, 0x75, 0x74, 0x48, 0x00, 0x52, 0x03, 0x70, 0x75, 0x74, 0x12, 0x2f, + 0x0a, 0x0a, 0x70, 0x75, 0x73, 0x68, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x1b, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x48, 0x00, 0x52, 0x09, 0x70, 0x75, 0x73, 0x68, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, + 0x2f, 0x0a, 0x0a, 0x70, 0x75, 0x6c, 0x6c, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x1c, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x50, 0x75, 0x6c, 0x6c, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x48, 0x00, 0x52, 0x09, 0x70, 0x75, 0x6c, 0x6c, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x12, 0x22, 0x0a, 0x05, 0x63, 0x68, 0x69, 0x74, 0x73, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0a, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x43, 0x68, 0x69, 0x74, 0x73, 0x48, 0x00, 0x52, 0x05, 0x63, + 0x68, 0x69, 0x74, 0x73, 0x12, 0x32, 0x0a, 0x0b, 0x61, 0x70, 0x70, 0x5f, 0x72, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x32, 0x70, 0x2e, + 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0a, 0x61, 0x70, + 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x35, 0x0a, 0x0c, 0x61, 0x70, 0x70, 0x5f, + 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, + 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x41, 0x70, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x48, 0x00, 0x52, 0x0b, 0x61, 0x70, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x2f, 0x0a, 0x0a, 0x61, 0x70, 0x70, 0x5f, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x18, 0x20, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x41, 0x70, 0x70, 0x47, 0x6f, 0x73, + 0x73, 0x69, 0x70, 0x48, 0x00, 0x52, 0x09, 0x61, 0x70, 0x70, 0x47, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x12, 0x2c, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x22, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x41, 0x70, 0x70, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x48, 0x00, 0x52, 0x08, 0x61, 0x70, 0x70, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x42, 0x09, - 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x58, 0x0a, 0x04, 0x50, 0x69, 0x6e, - 0x67, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x06, 0x75, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x38, 0x0a, 0x0e, 0x73, 0x75, 0x62, - 0x6e, 0x65, 0x74, 0x5f, 0x75, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x55, 0x70, - 0x74, 0x69, 0x6d, 0x65, 0x52, 0x0d, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x55, 0x70, 0x74, 0x69, - 0x6d, 0x65, 0x73, 0x22, 0x43, 0x0a, 0x0c, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x55, 0x70, 0x74, - 0x69, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x49, 0x64, - 0x12, 0x16, 0x0a, 0x06, 0x75, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x06, 0x75, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x58, 0x0a, 0x04, 0x50, 0x6f, 0x6e, 0x67, - 0x12, 0x16, 0x0a, 0x06, 0x75, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x06, 0x75, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x38, 0x0a, 0x0e, 0x73, 0x75, 0x62, 0x6e, - 0x65, 0x74, 0x5f, 0x75, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x11, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x55, 0x70, 0x74, - 0x69, 0x6d, 0x65, 0x52, 0x0d, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x55, 0x70, 0x74, 0x69, 0x6d, - 0x65, 0x73, 0x22, 0xe8, 0x02, 0x0a, 0x09, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, - 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x12, - 0x17, 0x0a, 0x07, 0x6d, 0x79, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x06, 0x6d, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x70, 0x5f, 0x61, - 0x64, 0x64, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x69, 0x70, 0x41, 0x64, 0x64, - 0x72, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x70, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x06, 0x69, 0x70, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x79, - 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x6d, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x0a, 0x0f, 0x69, 0x70, 0x5f, - 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x0d, 0x69, 0x70, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x54, 0x69, 0x6d, - 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x69, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, - 0x73, 0x69, 0x67, 0x12, 0x27, 0x0a, 0x0f, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x5f, 0x73, - 0x75, 0x62, 0x6e, 0x65, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0e, 0x74, 0x72, - 0x61, 0x63, 0x6b, 0x65, 0x64, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x73, 0x12, 0x23, 0x0a, 0x06, - 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, - 0x32, 0x70, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x63, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x61, - 0x63, 0x70, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x0d, 0x73, 0x75, 0x70, 0x70, 0x6f, - 0x72, 0x74, 0x65, 0x64, 0x41, 0x63, 0x70, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x6f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x70, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0d, 0x52, - 0x0c, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x65, 0x64, 0x41, 0x63, 0x70, 0x73, 0x22, 0x5e, 0x0a, - 0x06, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6d, - 0x61, 0x6a, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6d, 0x61, 0x6a, 0x6f, - 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, 0x22, 0xbd, 0x01, - 0x0a, 0x0d, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x49, 0x70, 0x50, 0x6f, 0x72, 0x74, 0x12, - 0x29, 0x0a, 0x10, 0x78, 0x35, 0x30, 0x39, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, - 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x78, 0x35, 0x30, 0x39, 0x43, - 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x70, - 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x69, 0x70, 0x41, - 0x64, 0x64, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x70, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x69, 0x70, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x1c, 0x0a, 0x09, - 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, - 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x13, 0x0a, 0x05, 0x74, 0x78, 0x5f, 0x69, - 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x74, 0x78, 0x49, 0x64, 0x22, 0x48, 0x0a, - 0x08, 0x50, 0x65, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x3c, 0x0a, 0x10, 0x63, 0x6c, 0x61, - 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x69, 0x70, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x65, - 0x64, 0x49, 0x70, 0x50, 0x6f, 0x72, 0x74, 0x52, 0x0e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, - 0x49, 0x70, 0x50, 0x6f, 0x72, 0x74, 0x73, 0x22, 0x3c, 0x0a, 0x07, 0x50, 0x65, 0x65, 0x72, 0x41, - 0x63, 0x6b, 0x12, 0x13, 0x0a, 0x05, 0x74, 0x78, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x04, 0x74, 0x78, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x3e, 0x0a, 0x0b, 0x50, 0x65, 0x65, 0x72, 0x4c, 0x69, 0x73, - 0x74, 0x41, 0x63, 0x6b, 0x12, 0x29, 0x0a, 0x09, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x61, 0x63, 0x6b, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x50, 0x65, - 0x65, 0x72, 0x41, 0x63, 0x6b, 0x52, 0x08, 0x70, 0x65, 0x65, 0x72, 0x41, 0x63, 0x6b, 0x73, 0x4a, - 0x04, 0x08, 0x01, 0x10, 0x02, 0x22, 0x6f, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x69, 0x65, 0x72, - 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, - 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x64, 0x65, - 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x22, 0x6a, 0x0a, 0x14, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, + 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4a, 0x04, 0x08, 0x21, 0x10, 0x22, 0x4a, + 0x04, 0x08, 0x24, 0x10, 0x25, 0x22, 0x58, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x16, 0x0a, + 0x06, 0x75, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x75, + 0x70, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x38, 0x0a, 0x0e, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x5f, + 0x75, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, + 0x70, 0x32, 0x70, 0x2e, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x55, 0x70, 0x74, 0x69, 0x6d, 0x65, + 0x52, 0x0d, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x55, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x22, + 0x43, 0x0a, 0x0c, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x55, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x12, + 0x1b, 0x0a, 0x09, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x08, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, + 0x75, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x75, 0x70, + 0x74, 0x69, 0x6d, 0x65, 0x22, 0x58, 0x0a, 0x04, 0x50, 0x6f, 0x6e, 0x67, 0x12, 0x16, 0x0a, 0x06, + 0x75, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x75, 0x70, + 0x74, 0x69, 0x6d, 0x65, 0x12, 0x38, 0x0a, 0x0e, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x5f, 0x75, + 0x70, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, + 0x32, 0x70, 0x2e, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x55, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x52, + 0x0d, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x55, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x22, 0x9b, + 0x03, 0x0a, 0x09, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x12, 0x1d, 0x0a, 0x0a, + 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x09, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x6d, + 0x79, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6d, 0x79, + 0x54, 0x69, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x69, 0x70, 0x41, 0x64, 0x64, 0x72, 0x12, 0x17, 0x0a, + 0x07, 0x69, 0x70, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, + 0x69, 0x70, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x79, 0x5f, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x79, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x0a, 0x0f, 0x69, 0x70, 0x5f, 0x73, 0x69, 0x67, 0x6e, + 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, + 0x69, 0x70, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x10, 0x0a, + 0x03, 0x73, 0x69, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x73, 0x69, 0x67, 0x12, + 0x27, 0x0a, 0x0f, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x5f, 0x73, 0x75, 0x62, 0x6e, 0x65, + 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0e, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x65, + 0x64, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x73, 0x12, 0x23, 0x0a, 0x06, 0x63, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x43, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, + 0x0e, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x70, 0x73, 0x18, + 0x0a, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x0d, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, + 0x41, 0x63, 0x70, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x65, 0x64, + 0x5f, 0x61, 0x63, 0x70, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x0c, 0x6f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x65, 0x64, 0x41, 0x63, 0x70, 0x73, 0x12, 0x31, 0x0a, 0x0b, 0x6b, 0x6e, 0x6f, + 0x77, 0x6e, 0x5f, 0x70, 0x65, 0x65, 0x72, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, + 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, + 0x52, 0x0a, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x50, 0x65, 0x65, 0x72, 0x73, 0x22, 0x5e, 0x0a, 0x06, + 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x61, + 0x6a, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6d, 0x61, 0x6a, 0x6f, 0x72, + 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, 0x22, 0x39, 0x0a, 0x0b, + 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x66, + 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x66, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x61, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x04, 0x73, 0x61, 0x6c, 0x74, 0x22, 0xbd, 0x01, 0x0a, 0x0d, 0x43, 0x6c, 0x61, 0x69, + 0x6d, 0x65, 0x64, 0x49, 0x70, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x78, 0x35, 0x30, + 0x39, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x78, 0x35, 0x30, 0x39, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x69, 0x70, 0x41, 0x64, 0x64, 0x72, 0x12, 0x17, 0x0a, + 0x07, 0x69, 0x70, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, + 0x69, 0x70, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x12, 0x13, 0x0a, 0x05, 0x74, 0x78, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x04, 0x74, 0x78, 0x49, 0x64, 0x22, 0x40, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x50, 0x65, + 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x0b, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, + 0x70, 0x65, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x32, + 0x70, 0x2e, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x0a, 0x6b, + 0x6e, 0x6f, 0x77, 0x6e, 0x50, 0x65, 0x65, 0x72, 0x73, 0x22, 0x48, 0x0a, 0x08, 0x50, 0x65, 0x65, + 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x3c, 0x0a, 0x10, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, + 0x5f, 0x69, 0x70, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x12, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x49, 0x70, 0x50, + 0x6f, 0x72, 0x74, 0x52, 0x0e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x49, 0x70, 0x50, 0x6f, + 0x72, 0x74, 0x73, 0x22, 0x6f, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x69, 0x65, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x6d, 0x6d, - 0x61, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, - 0x72, 0x79, 0x22, 0x89, 0x01, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, - 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x19, - 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x64, 0x65, 0x61, 0x64, - 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x18, - 0x04, 0x20, 0x03, 0x28, 0x04, 0x52, 0x07, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x22, 0x71, - 0x0a, 0x14, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, - 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, + 0x6c, 0x69, 0x6e, 0x65, 0x22, 0x6a, 0x0a, 0x14, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, + 0x6d, 0x61, 0x72, 0x79, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x69, 0x65, 0x72, 0x12, 0x19, 0x0a, 0x08, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, + 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, + 0x22, 0x89, 0x01, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x19, 0x0a, 0x08, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, + 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, + 0x6e, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x18, 0x04, 0x20, + 0x03, 0x28, 0x04, 0x52, 0x07, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x22, 0x71, 0x0a, 0x14, + 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, + 0x6d, 0x61, 0x72, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, + 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1f, + 0x0a, 0x0b, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0c, 0x52, 0x0a, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x49, 0x64, 0x73, 0x22, + 0x9d, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x46, + 0x72, 0x6f, 0x6e, 0x74, 0x69, 0x65, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, + 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, + 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x30, 0x0a, + 0x0b, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x54, + 0x79, 0x70, 0x65, 0x52, 0x0a, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, + 0x75, 0x0a, 0x10, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x46, 0x72, 0x6f, 0x6e, 0x74, + 0x69, 0x65, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, + 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x21, 0x0a, + 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, + 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x22, 0xba, 0x01, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x41, 0x63, + 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, - 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x69, 0x64, 0x73, 0x18, - 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0a, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x49, 0x64, - 0x73, 0x22, 0x9d, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, - 0x64, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x69, 0x65, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, - 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, - 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x12, - 0x30, 0x0a, 0x0b, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, - 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, - 0x65, 0x22, 0x75, 0x0a, 0x10, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x46, 0x72, 0x6f, - 0x6e, 0x74, 0x69, 0x65, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, + 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x23, 0x0a, 0x0d, + 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x04, 0x20, + 0x03, 0x28, 0x0c, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, + 0x73, 0x12, 0x30, 0x0a, 0x0b, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x45, 0x6e, 0x67, + 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x54, + 0x79, 0x70, 0x65, 0x22, 0x6f, 0x0a, 0x08, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x12, + 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, + 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x73, 0x4a, 0x04, + 0x08, 0x04, 0x10, 0x05, 0x22, 0xb9, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x41, 0x6e, 0x63, 0x65, + 0x73, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, - 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x49, 0x64, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x22, 0xba, 0x01, 0x0a, 0x0b, 0x47, 0x65, 0x74, - 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, + 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x30, + 0x0a, 0x0b, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, + 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, + 0x22, 0x6b, 0x0a, 0x09, 0x41, 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x19, 0x0a, + 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0a, 0x63, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x22, 0xb0, 0x01, + 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, + 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, + 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x30, + 0x0a, 0x0b, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, + 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, + 0x22, 0x8f, 0x01, 0x0a, 0x03, 0x50, 0x75, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x23, - 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x73, 0x18, - 0x04, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x49, 0x64, 0x73, 0x12, 0x30, 0x0a, 0x0b, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x5f, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x45, - 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x65, 0x6e, 0x67, 0x69, 0x6e, - 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0x6f, 0x0a, 0x08, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, - 0x64, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x0c, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x73, - 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x22, 0xb9, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x41, 0x6e, - 0x63, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, - 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, - 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x21, 0x0a, - 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, + 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x30, 0x0a, 0x0b, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x45, 0x6e, 0x67, 0x69, + 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x54, 0x79, - 0x70, 0x65, 0x22, 0x6b, 0x0a, 0x09, 0x41, 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x73, 0x12, + 0x70, 0x65, 0x22, 0xdc, 0x01, 0x0a, 0x09, 0x50, 0x75, 0x73, 0x68, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, + 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x64, 0x65, + 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x12, 0x30, 0x0a, 0x0b, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x70, 0x32, 0x70, 0x2e, + 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x65, 0x6e, 0x67, 0x69, + 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x0f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x64, 0x48, 0x65, 0x69, 0x67, 0x68, + 0x74, 0x22, 0xe1, 0x01, 0x0a, 0x09, 0x50, 0x75, 0x6c, 0x6c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0a, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x22, - 0xb0, 0x01, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, - 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, - 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x21, 0x0a, - 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, - 0x12, 0x30, 0x0a, 0x0b, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x45, 0x6e, 0x67, 0x69, - 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x54, 0x79, - 0x70, 0x65, 0x22, 0x8f, 0x01, 0x0a, 0x03, 0x50, 0x75, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, - 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, - 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x12, 0x30, 0x0a, 0x0b, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x5f, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x45, 0x6e, - 0x67, 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, - 0x54, 0x79, 0x70, 0x65, 0x22, 0xdc, 0x01, 0x0a, 0x09, 0x50, 0x75, 0x73, 0x68, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, - 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, - 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, - 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x30, 0x0a, 0x0b, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, - 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x70, 0x32, - 0x70, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x65, 0x6e, - 0x67, 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x0f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x64, 0x48, 0x65, 0x69, - 0x67, 0x68, 0x74, 0x22, 0xe1, 0x01, 0x0a, 0x09, 0x50, 0x75, 0x6c, 0x6c, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x64, - 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x64, - 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x30, 0x0a, 0x0b, 0x65, 0x6e, - 0x67, 0x69, 0x6e, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x0f, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, - 0x52, 0x0a, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x29, 0x0a, 0x10, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, - 0x64, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0xba, 0x01, 0x0a, 0x05, 0x43, 0x68, 0x69, 0x74, - 0x73, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x70, - 0x72, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x0b, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x49, 0x64, 0x12, 0x1f, - 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x49, 0x64, 0x12, - 0x33, 0x0a, 0x16, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x5f, 0x69, 0x64, 0x5f, - 0x61, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x13, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x49, 0x64, 0x41, 0x74, 0x48, 0x65, - 0x69, 0x67, 0x68, 0x74, 0x22, 0x7f, 0x0a, 0x0a, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x61, + 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x64, 0x65, 0x61, + 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x63, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x30, 0x0a, 0x0b, 0x65, 0x6e, 0x67, 0x69, + 0x6e, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, + 0x70, 0x32, 0x70, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, + 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x64, 0x48, + 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0xba, 0x01, 0x0a, 0x05, 0x43, 0x68, 0x69, 0x74, 0x73, 0x12, + 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x65, + 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x0b, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, + 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x0a, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x49, 0x64, 0x12, 0x33, 0x0a, + 0x16, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x5f, 0x69, 0x64, 0x5f, 0x61, 0x74, + 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x13, 0x70, + 0x72, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x49, 0x64, 0x41, 0x74, 0x48, 0x65, 0x69, 0x67, + 0x68, 0x74, 0x22, 0x7f, 0x0a, 0x0a, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, + 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x64, 0x65, + 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x62, 0x79, + 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x61, 0x70, 0x70, 0x42, 0x79, + 0x74, 0x65, 0x73, 0x22, 0x64, 0x0a, 0x0b, 0x41, 0x70, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, - 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, - 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, - 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x61, 0x70, 0x70, - 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x64, 0x0a, 0x0b, 0x41, 0x70, 0x70, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, - 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1b, - 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x08, 0x61, 0x70, 0x70, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x88, 0x01, 0x0a, 0x08, - 0x41, 0x70, 0x70, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, - 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, - 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x11, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, - 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x43, 0x0a, 0x09, 0x41, 0x70, 0x70, 0x47, 0x6f, 0x73, - 0x73, 0x69, 0x70, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1b, - 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x08, 0x61, 0x70, 0x70, 0x42, 0x79, 0x74, 0x65, 0x73, 0x2a, 0x5d, 0x0a, 0x0a, 0x45, - 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x45, 0x4e, 0x47, - 0x49, 0x4e, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, - 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15, 0x45, 0x4e, 0x47, 0x49, 0x4e, 0x45, - 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x41, 0x56, 0x41, 0x4c, 0x41, 0x4e, 0x43, 0x48, 0x45, 0x10, - 0x01, 0x12, 0x17, 0x0a, 0x13, 0x45, 0x4e, 0x47, 0x49, 0x4e, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, - 0x5f, 0x53, 0x4e, 0x4f, 0x57, 0x4d, 0x41, 0x4e, 0x10, 0x02, 0x42, 0x2e, 0x5a, 0x2c, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x76, 0x61, 0x2d, 0x6c, 0x61, 0x62, - 0x73, 0x2f, 0x61, 0x76, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x67, 0x6f, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x62, 0x2f, 0x70, 0x32, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, + 0x61, 0x70, 0x70, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x08, 0x61, 0x70, 0x70, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x88, 0x01, 0x0a, 0x08, 0x41, 0x70, + 0x70, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, + 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, + 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x11, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, + 0x23, 0x0a, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x22, 0x43, 0x0a, 0x09, 0x41, 0x70, 0x70, 0x47, 0x6f, 0x73, 0x73, 0x69, + 0x70, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, + 0x61, 0x70, 0x70, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x08, 0x61, 0x70, 0x70, 0x42, 0x79, 0x74, 0x65, 0x73, 0x2a, 0x5d, 0x0a, 0x0a, 0x45, 0x6e, 0x67, + 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x45, 0x4e, 0x47, 0x49, 0x4e, + 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, + 0x45, 0x44, 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15, 0x45, 0x4e, 0x47, 0x49, 0x4e, 0x45, 0x5f, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x41, 0x56, 0x41, 0x4c, 0x41, 0x4e, 0x43, 0x48, 0x45, 0x10, 0x01, 0x12, + 0x17, 0x0a, 0x13, 0x45, 0x4e, 0x47, 0x49, 0x4e, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, + 0x4e, 0x4f, 0x57, 0x4d, 0x41, 0x4e, 0x10, 0x02, 0x42, 0x2e, 0x5a, 0x2c, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x76, 0x61, 0x2d, 0x6c, 0x61, 0x62, 0x73, 0x2f, + 0x61, 0x76, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x70, 0x62, 0x2f, 0x70, 0x32, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2985,10 +3001,10 @@ var file_p2p_p2p_proto_goTypes = []interface{}{ (*Pong)(nil), // 4: p2p.Pong (*Handshake)(nil), // 5: p2p.Handshake (*Client)(nil), // 6: p2p.Client - (*ClaimedIpPort)(nil), // 7: p2p.ClaimedIpPort - (*PeerList)(nil), // 8: p2p.PeerList - (*PeerAck)(nil), // 9: p2p.PeerAck - (*PeerListAck)(nil), // 10: p2p.PeerListAck + (*BloomFilter)(nil), // 7: p2p.BloomFilter + (*ClaimedIpPort)(nil), // 8: p2p.ClaimedIpPort + (*GetPeerList)(nil), // 9: p2p.GetPeerList + (*PeerList)(nil), // 10: p2p.PeerList (*GetStateSummaryFrontier)(nil), // 11: p2p.GetStateSummaryFrontier (*StateSummaryFrontier)(nil), // 12: p2p.StateSummaryFrontier (*GetAcceptedStateSummary)(nil), // 13: p2p.GetAcceptedStateSummary @@ -3013,44 +3029,45 @@ var file_p2p_p2p_proto_depIdxs = []int32{ 2, // 0: p2p.Message.ping:type_name -> p2p.Ping 4, // 1: p2p.Message.pong:type_name -> p2p.Pong 5, // 2: p2p.Message.handshake:type_name -> p2p.Handshake - 8, // 3: p2p.Message.peer_list:type_name -> p2p.PeerList - 11, // 4: p2p.Message.get_state_summary_frontier:type_name -> p2p.GetStateSummaryFrontier - 12, // 5: p2p.Message.state_summary_frontier:type_name -> p2p.StateSummaryFrontier - 13, // 6: p2p.Message.get_accepted_state_summary:type_name -> p2p.GetAcceptedStateSummary - 14, // 7: p2p.Message.accepted_state_summary:type_name -> p2p.AcceptedStateSummary - 15, // 8: p2p.Message.get_accepted_frontier:type_name -> p2p.GetAcceptedFrontier - 16, // 9: p2p.Message.accepted_frontier:type_name -> p2p.AcceptedFrontier - 17, // 10: p2p.Message.get_accepted:type_name -> p2p.GetAccepted - 18, // 11: p2p.Message.accepted:type_name -> p2p.Accepted - 19, // 12: p2p.Message.get_ancestors:type_name -> p2p.GetAncestors - 20, // 13: p2p.Message.ancestors:type_name -> p2p.Ancestors - 21, // 14: p2p.Message.get:type_name -> p2p.Get - 22, // 15: p2p.Message.put:type_name -> p2p.Put - 23, // 16: p2p.Message.push_query:type_name -> p2p.PushQuery - 24, // 17: p2p.Message.pull_query:type_name -> p2p.PullQuery - 25, // 18: p2p.Message.chits:type_name -> p2p.Chits - 26, // 19: p2p.Message.app_request:type_name -> p2p.AppRequest - 27, // 20: p2p.Message.app_response:type_name -> p2p.AppResponse - 29, // 21: p2p.Message.app_gossip:type_name -> p2p.AppGossip - 10, // 22: p2p.Message.peer_list_ack:type_name -> p2p.PeerListAck + 9, // 3: p2p.Message.get_peer_list:type_name -> p2p.GetPeerList + 10, // 4: p2p.Message.peer_list:type_name -> p2p.PeerList + 11, // 5: p2p.Message.get_state_summary_frontier:type_name -> p2p.GetStateSummaryFrontier + 12, // 6: p2p.Message.state_summary_frontier:type_name -> p2p.StateSummaryFrontier + 13, // 7: p2p.Message.get_accepted_state_summary:type_name -> p2p.GetAcceptedStateSummary + 14, // 8: p2p.Message.accepted_state_summary:type_name -> p2p.AcceptedStateSummary + 15, // 9: p2p.Message.get_accepted_frontier:type_name -> p2p.GetAcceptedFrontier + 16, // 10: p2p.Message.accepted_frontier:type_name -> p2p.AcceptedFrontier + 17, // 11: p2p.Message.get_accepted:type_name -> p2p.GetAccepted + 18, // 12: p2p.Message.accepted:type_name -> p2p.Accepted + 19, // 13: p2p.Message.get_ancestors:type_name -> p2p.GetAncestors + 20, // 14: p2p.Message.ancestors:type_name -> p2p.Ancestors + 21, // 15: p2p.Message.get:type_name -> p2p.Get + 22, // 16: p2p.Message.put:type_name -> p2p.Put + 23, // 17: p2p.Message.push_query:type_name -> p2p.PushQuery + 24, // 18: p2p.Message.pull_query:type_name -> p2p.PullQuery + 25, // 19: p2p.Message.chits:type_name -> p2p.Chits + 26, // 20: p2p.Message.app_request:type_name -> p2p.AppRequest + 27, // 21: p2p.Message.app_response:type_name -> p2p.AppResponse + 29, // 22: p2p.Message.app_gossip:type_name -> p2p.AppGossip 28, // 23: p2p.Message.app_error:type_name -> p2p.AppError 3, // 24: p2p.Ping.subnet_uptimes:type_name -> p2p.SubnetUptime 3, // 25: p2p.Pong.subnet_uptimes:type_name -> p2p.SubnetUptime 6, // 26: p2p.Handshake.client:type_name -> p2p.Client - 7, // 27: p2p.PeerList.claimed_ip_ports:type_name -> p2p.ClaimedIpPort - 9, // 28: p2p.PeerListAck.peer_acks:type_name -> p2p.PeerAck - 0, // 29: p2p.GetAcceptedFrontier.engine_type:type_name -> p2p.EngineType - 0, // 30: p2p.GetAccepted.engine_type:type_name -> p2p.EngineType - 0, // 31: p2p.GetAncestors.engine_type:type_name -> p2p.EngineType - 0, // 32: p2p.Get.engine_type:type_name -> p2p.EngineType - 0, // 33: p2p.Put.engine_type:type_name -> p2p.EngineType - 0, // 34: p2p.PushQuery.engine_type:type_name -> p2p.EngineType - 0, // 35: p2p.PullQuery.engine_type:type_name -> p2p.EngineType - 36, // [36:36] is the sub-list for method output_type - 36, // [36:36] is the sub-list for method input_type - 36, // [36:36] is the sub-list for extension type_name - 36, // [36:36] is the sub-list for extension extendee - 0, // [0:36] is the sub-list for field type_name + 7, // 27: p2p.Handshake.known_peers:type_name -> p2p.BloomFilter + 7, // 28: p2p.GetPeerList.known_peers:type_name -> p2p.BloomFilter + 8, // 29: p2p.PeerList.claimed_ip_ports:type_name -> p2p.ClaimedIpPort + 0, // 30: p2p.GetAcceptedFrontier.engine_type:type_name -> p2p.EngineType + 0, // 31: p2p.GetAccepted.engine_type:type_name -> p2p.EngineType + 0, // 32: p2p.GetAncestors.engine_type:type_name -> p2p.EngineType + 0, // 33: p2p.Get.engine_type:type_name -> p2p.EngineType + 0, // 34: p2p.Put.engine_type:type_name -> p2p.EngineType + 0, // 35: p2p.PushQuery.engine_type:type_name -> p2p.EngineType + 0, // 36: p2p.PullQuery.engine_type:type_name -> p2p.EngineType + 37, // [37:37] is the sub-list for method output_type + 37, // [37:37] is the sub-list for method input_type + 37, // [37:37] is the sub-list for extension type_name + 37, // [37:37] is the sub-list for extension extendee + 0, // [0:37] is the sub-list for field type_name } func init() { file_p2p_p2p_proto_init() } @@ -3132,7 +3149,7 @@ func file_p2p_p2p_proto_init() { } } file_p2p_p2p_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClaimedIpPort); i { + switch v := v.(*BloomFilter); i { case 0: return &v.state case 1: @@ -3144,7 +3161,7 @@ func file_p2p_p2p_proto_init() { } } file_p2p_p2p_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PeerList); i { + switch v := v.(*ClaimedIpPort); i { case 0: return &v.state case 1: @@ -3156,7 +3173,7 @@ func file_p2p_p2p_proto_init() { } } file_p2p_p2p_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PeerAck); i { + switch v := v.(*GetPeerList); i { case 0: return &v.state case 1: @@ -3168,7 +3185,7 @@ func file_p2p_p2p_proto_init() { } } file_p2p_p2p_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PeerListAck); i { + switch v := v.(*PeerList); i { case 0: return &v.state case 1: @@ -3414,7 +3431,8 @@ func file_p2p_p2p_proto_init() { (*Message_Ping)(nil), (*Message_Pong)(nil), (*Message_Handshake)(nil), - (*Message_PeerList)(nil), + (*Message_GetPeerList)(nil), + (*Message_PeerList_)(nil), (*Message_GetStateSummaryFrontier)(nil), (*Message_StateSummaryFrontier_)(nil), (*Message_GetAcceptedStateSummary)(nil), @@ -3433,7 +3451,6 @@ func file_p2p_p2p_proto_init() { (*Message_AppRequest)(nil), (*Message_AppResponse)(nil), (*Message_AppGossip)(nil), - (*Message_PeerListAck)(nil), (*Message_AppError)(nil), } type x struct{} diff --git a/utils/bloom/read_filter.go b/utils/bloom/read_filter.go index 8c32e143b1c4..075d77ed7a38 100644 --- a/utils/bloom/read_filter.go +++ b/utils/bloom/read_filter.go @@ -8,6 +8,23 @@ import ( "fmt" ) +var ( + EmptyFilter = &ReadFilter{ + hashSeeds: make([]uint64, minHashes), + entries: make([]byte, minEntries), + } + FullFilter = &ReadFilter{ + hashSeeds: make([]uint64, minHashes), + entries: make([]byte, minEntries), + } +) + +func init() { + for i := range FullFilter.entries { + FullFilter.entries[i] = 0xFF + } +} + type ReadFilter struct { hashSeeds []uint64 entries []byte diff --git a/utils/constants/networking.go b/utils/constants/networking.go index 8d60d27af58a..7a4ea89b8241 100644 --- a/utils/constants/networking.go +++ b/utils/constants/networking.go @@ -32,6 +32,8 @@ const ( DefaultNetworkPeerListNonValidatorGossipSize = 0 DefaultNetworkPeerListPeersGossipSize = 10 DefaultNetworkPeerListGossipFreq = time.Minute + DefaultNetworkPeerListPullGossipFreq = 2 * time.Second + DefaultNetworkPeerListBloomResetFreq = time.Minute // Inbound Connection Throttling DefaultInboundConnUpgradeThrottlerCooldown = 10 * time.Second diff --git a/utils/ips/claimed_ip_port.go b/utils/ips/claimed_ip_port.go index 76920f31559d..2ef6c0a71087 100644 --- a/utils/ips/claimed_ip_port.go +++ b/utils/ips/claimed_ip_port.go @@ -6,16 +6,14 @@ package ips import ( "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/staking" + "github.com/ava-labs/avalanchego/utils/hashing" + "github.com/ava-labs/avalanchego/utils/wrappers" ) -// Can't import these from wrappers package due to circular import. const ( - intLen = 4 - longLen = 8 - ipLen = 18 - idLen = 32 // Certificate length, signature length, IP, timestamp, tx ID - baseIPCertDescLen = 2*intLen + ipLen + longLen + idLen + baseIPCertDescLen = 2*wrappers.IntLen + IPPortLen + wrappers.LongLen + ids.IDLen + preimageLen = ids.IDLen + wrappers.LongLen ) // A self contained proof that a peer is claiming ownership of an IPPort at a @@ -32,12 +30,36 @@ type ClaimedIPPort struct { // actually claimed by the peer in question, and not by a malicious peer // trying to get us to dial bogus IPPorts. Signature []byte - // The txID that added this peer into the validator set - TxID ids.ID + // NodeID derived from the peer certificate. + NodeID ids.NodeID + // GossipID derived from the nodeID and timestamp. + GossipID ids.ID } -// Returns the length of the byte representation of this ClaimedIPPort. -func (i *ClaimedIPPort) BytesLen() int { - // See wrappers.PackPeerTrackInfo. +func NewClaimedIPPort( + cert *staking.Certificate, + ipPort IPPort, + timestamp uint64, + signature []byte, +) *ClaimedIPPort { + ip := &ClaimedIPPort{ + Cert: cert, + IPPort: ipPort, + Timestamp: timestamp, + Signature: signature, + NodeID: ids.NodeIDFromCert(cert), + } + + packer := wrappers.Packer{ + Bytes: make([]byte, preimageLen), + } + packer.PackFixedBytes(ip.NodeID[:]) + packer.PackLong(timestamp) + ip.GossipID = hashing.ComputeHash256Array(packer.Bytes) + return ip +} + +// Returns the approximate size of the binary representation of this ClaimedIPPort. +func (i *ClaimedIPPort) Size() int { return baseIPCertDescLen + len(i.Cert.Raw) + len(i.Signature) } diff --git a/utils/ips/ip_port.go b/utils/ips/ip_port.go index 661747cb9cbe..a60e6300ed49 100644 --- a/utils/ips/ip_port.go +++ b/utils/ips/ip_port.go @@ -12,7 +12,10 @@ import ( "github.com/ava-labs/avalanchego/utils/wrappers" ) -const nullStr = "null" +const ( + IPPortLen = 16 + wrappers.ShortLen + nullStr = "null" +) var ( errMissingQuotes = errors.New("first and last characters should be quotes") From dc48be8c89252e09136c1b21914b9d16dc67f253 Mon Sep 17 00:00:00 2001 From: Stephen Buttolph Date: Mon, 15 Jan 2024 11:43:21 -0500 Subject: [PATCH 38/57] Log critical consensus values during health checks (#2609) --- snow/engine/common/request.go | 10 +++++++- snow/engine/common/request_test.go | 24 +++++++++++++++++ snow/engine/snowman/transitive.go | 9 +++++++ utils/bimap/bimap.go | 41 +++++++++++++++++++++++++++++- utils/bimap/bimap_test.go | 28 ++++++++++++++++++++ 5 files changed, 110 insertions(+), 2 deletions(-) create mode 100644 snow/engine/common/request_test.go diff --git a/snow/engine/common/request.go b/snow/engine/common/request.go index f9cccb3b0d29..f92e347cc73b 100644 --- a/snow/engine/common/request.go +++ b/snow/engine/common/request.go @@ -3,9 +3,17 @@ package common -import "github.com/ava-labs/avalanchego/ids" +import ( + "fmt" + + "github.com/ava-labs/avalanchego/ids" +) type Request struct { NodeID ids.NodeID RequestID uint32 } + +func (r Request) MarshalText() ([]byte, error) { + return []byte(fmt.Sprintf("%s:%d", r.NodeID, r.RequestID)), nil +} diff --git a/snow/engine/common/request_test.go b/snow/engine/common/request_test.go new file mode 100644 index 000000000000..0da4c8c438f7 --- /dev/null +++ b/snow/engine/common/request_test.go @@ -0,0 +1,24 @@ +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +package common + +import ( + "encoding/json" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/ava-labs/avalanchego/ids" +) + +func TestRequestJSONMarshal(t *testing.T) { + requestMap := map[Request]ids.ID{ + { + NodeID: ids.GenerateTestNodeID(), + RequestID: 12345, + }: ids.GenerateTestID(), + } + _, err := json.Marshal(requestMap) + require.NoError(t, err) +} diff --git a/snow/engine/snowman/transitive.go b/snow/engine/snowman/transitive.go index 34954885a66d..bf76970b5295 100644 --- a/snow/engine/snowman/transitive.go +++ b/snow/engine/snowman/transitive.go @@ -556,6 +556,15 @@ func (t *Transitive) HealthCheck(ctx context.Context) (interface{}, error) { t.Ctx.Lock.Lock() defer t.Ctx.Lock.Unlock() + t.Ctx.Log.Verbo("running health check", + zap.Uint32("requestID", t.requestID), + zap.Int("gossipCounter", t.gossipCounter), + zap.Stringer("polls", t.polls), + zap.Reflect("outstandingBlockRequests", t.blkReqs), + zap.Stringer("blockedJobs", &t.blocked), + zap.Int("pendingBuildBlocks", t.pendingBuildBlocks), + ) + consensusIntf, consensusErr := t.Consensus.HealthCheck(ctx) vmIntf, vmErr := t.VM.HealthCheck(ctx) intf := map[string]interface{}{ diff --git a/utils/bimap/bimap.go b/utils/bimap/bimap.go index c44ff0ff60a9..d0651ff36cd2 100644 --- a/utils/bimap/bimap.go +++ b/utils/bimap/bimap.go @@ -3,7 +3,21 @@ package bimap -import "github.com/ava-labs/avalanchego/utils" +import ( + "bytes" + "encoding/json" + "errors" + + "github.com/ava-labs/avalanchego/utils" +) + +var ( + _ json.Marshaler = (*BiMap[int, int])(nil) + _ json.Unmarshaler = (*BiMap[int, int])(nil) + + nullBytes = []byte("null") + errNotBijective = errors.New("map not bijective") +) type Entry[K, V any] struct { Key K @@ -100,3 +114,28 @@ func (m *BiMap[K, V]) DeleteValue(val V) (K, bool) { func (m *BiMap[K, V]) Len() int { return len(m.keyToValue) } + +func (m *BiMap[K, V]) MarshalJSON() ([]byte, error) { + return json.Marshal(m.keyToValue) +} + +func (m *BiMap[K, V]) UnmarshalJSON(b []byte) error { + if bytes.Equal(b, nullBytes) { + return nil + } + var keyToValue map[K]V + if err := json.Unmarshal(b, &keyToValue); err != nil { + return err + } + valueToKey := make(map[V]K, len(keyToValue)) + for k, v := range keyToValue { + valueToKey[v] = k + } + if len(keyToValue) != len(valueToKey) { + return errNotBijective + } + + m.keyToValue = keyToValue + m.valueToKey = valueToKey + return nil +} diff --git a/utils/bimap/bimap_test.go b/utils/bimap/bimap_test.go index dffa80dc008d..9b4433a51c70 100644 --- a/utils/bimap/bimap_test.go +++ b/utils/bimap/bimap_test.go @@ -4,6 +4,7 @@ package bimap import ( + "encoding/json" "testing" "github.com/stretchr/testify/require" @@ -326,3 +327,30 @@ func TestBiMapLen(t *testing.T) { m.DeleteKey(1) require.Zero(m.Len()) } + +func TestBiMapJSON(t *testing.T) { + require := require.New(t) + + expectedMap := New[int, int]() + expectedMap.Put(1, 2) + expectedMap.Put(2, 3) + + jsonBytes, err := json.Marshal(expectedMap) + require.NoError(err) + + expectedJSONBytes := []byte(`{"1":2,"2":3}`) + require.Equal(expectedJSONBytes, jsonBytes) + + var unmarshalledMap BiMap[int, int] + require.NoError(json.Unmarshal(jsonBytes, &unmarshalledMap)) + require.Equal(expectedMap, &unmarshalledMap) +} + +func TestBiMapInvalidJSON(t *testing.T) { + require := require.New(t) + + invalidJSONBytes := []byte(`{"1":2,"2":2}`) + var unmarshalledMap BiMap[int, int] + err := json.Unmarshal(invalidJSONBytes, &unmarshalledMap) + require.ErrorIs(err, errNotBijective) +} From 226cd2149b2bbfc38f34e0831e6127eac170f276 Mon Sep 17 00:00:00 2001 From: Stephen Buttolph Date: Mon, 15 Jan 2024 17:08:37 -0500 Subject: [PATCH 39/57] Update contributions branch to master (#2610) --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index affb43575fca..2e850274d96f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -33,7 +33,7 @@ To start developing on AvalancheGo, you'll need a few things installed. - Open a new GitHub pull request containing your changes. - Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable. -- The PR should be opened against the `dev` branch. +- The PR should be opened against the `master` branch. - If your PR isn't ready to be reviewed just yet, you can open it as a draft to collect early feedback on your changes. - Once the PR is ready for review, mark it as ready-for-review and request review from one of the maintainers. From 003ed7fbc9b1e959990c1f4f0e2dbdcc32e0e8f3 Mon Sep 17 00:00:00 2001 From: Stephen Buttolph Date: Tue, 16 Jan 2024 09:55:43 -0500 Subject: [PATCH 40/57] Add ip bloom metrics (#2614) --- network/ip_tracker.go | 79 ++++++++++++++++++++++++++++++++++++-- network/ip_tracker_test.go | 23 ++++++++++- network/network.go | 2 +- 3 files changed, 99 insertions(+), 5 deletions(-) diff --git a/network/ip_tracker.go b/network/ip_tracker.go index 7bc6cb293810..eb8dcddb6e76 100644 --- a/network/ip_tracker.go +++ b/network/ip_tracker.go @@ -7,12 +7,15 @@ import ( "crypto/rand" "sync" + "github.com/prometheus/client_golang/prometheus" + "go.uber.org/zap" "golang.org/x/exp/maps" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/snow/validators" + "github.com/ava-labs/avalanchego/utils" "github.com/ava-labs/avalanchego/utils/bloom" "github.com/ava-labs/avalanchego/utils/crypto/bls" "github.com/ava-labs/avalanchego/utils/ips" @@ -34,19 +37,77 @@ const ( var _ validators.SetCallbackListener = (*ipTracker)(nil) -func newIPTracker(log logging.Logger) (*ipTracker, error) { +func newIPTracker( + log logging.Logger, + namespace string, + registerer prometheus.Registerer, +) (*ipTracker, error) { tracker := &ipTracker{ - log: log, + log: log, + numValidatorIPs: prometheus.NewGauge(prometheus.GaugeOpts{ + Namespace: namespace, + Name: "validator_ips", + Help: "Number of known validator IPs", + }), + numGossipable: prometheus.NewGauge(prometheus.GaugeOpts{ + Namespace: namespace, + Name: "gossipable_ips", + Help: "Number of IPs this node is willing to gossip", + }), + bloomCount: prometheus.NewGauge(prometheus.GaugeOpts{ + Namespace: namespace, + Name: "ip_bloom_count", + Help: "Number of IP entries added to the bloom", + }), + bloomNumHashes: prometheus.NewGauge(prometheus.GaugeOpts{ + Namespace: namespace, + Name: "ip_bloom_hashes", + Help: "Number of hashes in the IP bloom", + }), + bloomNumEntries: prometheus.NewGauge(prometheus.GaugeOpts{ + Namespace: namespace, + Name: "ip_bloom_entries", + Help: "Number of entry slots in the IP bloom", + }), + bloomMaxCount: prometheus.NewGauge(prometheus.GaugeOpts{ + Namespace: namespace, + Name: "ip_bloom_max_count", + Help: "Maximum number of IP entries that can be added to the bloom before resetting", + }), + bloomResetCount: prometheus.NewCounter(prometheus.CounterOpts{ + Namespace: namespace, + Name: "ip_bloom_reset_count", + Help: "Number times the IP bloom has been reset", + }), connected: make(map[ids.NodeID]*ips.ClaimedIPPort), mostRecentValidatorIPs: make(map[ids.NodeID]*ips.ClaimedIPPort), gossipableIndicies: make(map[ids.NodeID]int), bloomAdditions: make(map[ids.NodeID]int), } + err := utils.Err( + registerer.Register(tracker.numValidatorIPs), + registerer.Register(tracker.numGossipable), + registerer.Register(tracker.bloomCount), + registerer.Register(tracker.bloomNumHashes), + registerer.Register(tracker.bloomNumEntries), + registerer.Register(tracker.bloomMaxCount), + registerer.Register(tracker.bloomResetCount), + ) + if err != nil { + return nil, err + } return tracker, tracker.resetBloom() } type ipTracker struct { - log logging.Logger + log logging.Logger + numValidatorIPs prometheus.Gauge + numGossipable prometheus.Gauge + bloomCount prometheus.Gauge + bloomNumHashes prometheus.Gauge + bloomNumEntries prometheus.Gauge + bloomMaxCount prometheus.Gauge + bloomResetCount prometheus.Counter lock sync.RWMutex // Manually tracked nodes are always treated like validators @@ -220,12 +281,16 @@ func (i *ipTracker) OnValidatorRemoved(nodeID ids.NodeID, _ uint64) { } delete(i.mostRecentValidatorIPs, nodeID) + i.numValidatorIPs.Set(float64(len(i.mostRecentValidatorIPs))) + i.validators.Remove(nodeID) i.removeGossipableIP(nodeID) } func (i *ipTracker) updateMostRecentValidatorIP(ip *ips.ClaimedIPPort) { i.mostRecentValidatorIPs[ip.NodeID] = ip + i.numValidatorIPs.Set(float64(len(i.mostRecentValidatorIPs))) + oldCount := i.bloomAdditions[ip.NodeID] if oldCount >= maxIPEntriesPerValidator { return @@ -250,11 +315,13 @@ func (i *ipTracker) updateMostRecentValidatorIP(ip *ips.ClaimedIPPort) { i.bloomAdditions[ip.NodeID] = oldCount + 1 bloom.Add(i.bloom, ip.GossipID[:], i.bloomSalt) + i.bloomCount.Inc() } func (i *ipTracker) addGossipableIP(ip *ips.ClaimedIPPort) { i.gossipableIndicies[ip.NodeID] = len(i.gossipableIPs) i.gossipableIPs = append(i.gossipableIPs, ip) + i.numGossipable.Inc() } func (i *ipTracker) removeGossipableIP(nodeID ids.NodeID) { @@ -273,6 +340,7 @@ func (i *ipTracker) removeGossipableIP(nodeID ids.NodeID) { delete(i.gossipableIndicies, nodeID) i.gossipableIPs[newNumGossipable] = nil i.gossipableIPs = i.gossipableIPs[:newNumGossipable] + i.numGossipable.Dec() } // GetGossipableIPs returns the latest IPs of connected validators. The returned @@ -360,5 +428,10 @@ func (i *ipTracker) resetBloom() error { bloom.Add(newFilter, ip.GossipID[:], newSalt) i.bloomAdditions[nodeID] = 1 } + i.bloomCount.Set(float64(len(i.mostRecentValidatorIPs))) + i.bloomNumHashes.Set(float64(numHashes)) + i.bloomNumEntries.Set(float64(numEntries)) + i.bloomMaxCount.Set(float64(i.maxBloomCount)) + i.bloomResetCount.Inc() return nil } diff --git a/network/ip_tracker_test.go b/network/ip_tracker_test.go index 882c0a47ce8c..921f2f33d655 100644 --- a/network/ip_tracker_test.go +++ b/network/ip_tracker_test.go @@ -6,6 +6,9 @@ package network import ( "testing" + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/testutil" + "github.com/stretchr/testify/require" "github.com/ava-labs/avalanchego/ids" @@ -15,7 +18,7 @@ import ( ) func newTestIPTracker(t *testing.T) *ipTracker { - tracker, err := newIPTracker(logging.NoLog{}) + tracker, err := newIPTracker(logging.NoLog{}, "", prometheus.NewRegistry()) require.NoError(t, err) return tracker } @@ -41,6 +44,14 @@ func requireEqual(t *testing.T, expected, actual *ipTracker) { require.Equal(expected.maxBloomCount, actual.maxBloomCount) } +func requireMetricsConsistent(t *testing.T, tracker *ipTracker) { + require := require.New(t) + require.Equal(float64(len(tracker.mostRecentValidatorIPs)), testutil.ToFloat64(tracker.numValidatorIPs)) + require.Equal(float64(len(tracker.gossipableIPs)), testutil.ToFloat64(tracker.numGossipable)) + require.Equal(float64(tracker.bloom.Count()), testutil.ToFloat64(tracker.bloomCount)) + require.Equal(float64(tracker.maxBloomCount), testutil.ToFloat64(tracker.bloomMaxCount)) +} + func TestIPTracker_ManuallyTrack(t *testing.T) { tests := []struct { name string @@ -118,6 +129,7 @@ func TestIPTracker_ManuallyTrack(t *testing.T) { t.Run(test.name, func(t *testing.T) { test.initialState.ManuallyTrack(test.nodeID) requireEqual(t, test.expectedState, test.initialState) + requireMetricsConsistent(t, test.initialState) }) } } @@ -235,6 +247,7 @@ func TestIPTracker_AddIP(t *testing.T) { updated := test.initialState.AddIP(test.ip) require.Equal(t, test.expectedUpdated, updated) requireEqual(t, test.expectedState, test.initialState) + requireMetricsConsistent(t, test.initialState) }) } } @@ -344,6 +357,7 @@ func TestIPTracker_Connected(t *testing.T) { t.Run(test.name, func(t *testing.T) { test.initialState.Connected(test.ip) requireEqual(t, test.expectedState, test.initialState) + requireMetricsConsistent(t, test.initialState) }) } } @@ -416,6 +430,7 @@ func TestIPTracker_Disconnected(t *testing.T) { t.Run(test.name, func(t *testing.T) { test.initialState.Disconnected(test.nodeID) requireEqual(t, test.expectedState, test.initialState) + requireMetricsConsistent(t, test.initialState) }) } } @@ -477,6 +492,7 @@ func TestIPTracker_OnValidatorAdded(t *testing.T) { t.Run(test.name, func(t *testing.T) { test.initialState.OnValidatorAdded(test.nodeID, nil, ids.Empty, 0) requireEqual(t, test.expectedState, test.initialState) + requireMetricsConsistent(t, test.initialState) }) } } @@ -577,6 +593,7 @@ func TestIPTracker_OnValidatorRemoved(t *testing.T) { t.Run(test.name, func(t *testing.T) { test.initialState.OnValidatorRemoved(test.nodeID, 0) requireEqual(t, test.expectedState, test.initialState) + requireMetricsConsistent(t, test.initialState) }) } } @@ -637,9 +654,11 @@ func TestIPTracker_BloomGrowsWithValidatorSet(t *testing.T) { for i := 0; i < 2048; i++ { tracker.onValidatorAdded(ids.GenerateTestNodeID()) } + requireMetricsConsistent(t, tracker) require.NoError(tracker.ResetBloom()) require.Greater(tracker.maxBloomCount, initialMaxBloomCount) + requireMetricsConsistent(t, tracker) } func TestIPTracker_BloomResetsDynamically(t *testing.T) { @@ -652,6 +671,7 @@ func TestIPTracker_BloomResetsDynamically(t *testing.T) { tracker.maxBloomCount = 1 tracker.Connected(otherIP) tracker.onValidatorAdded(otherIP.NodeID) + requireMetricsConsistent(t, tracker) bloomBytes, salt := tracker.Bloom() readFilter, err := bloom.Parse(bloomBytes) @@ -673,6 +693,7 @@ func TestIPTracker_PreventBloomFilterAddition(t *testing.T) { require.True(tracker.AddIP(newerIP)) require.True(tracker.AddIP(newestIP)) require.Equal(maxIPEntriesPerValidator, tracker.bloomAdditions[ip.NodeID]) + requireMetricsConsistent(t, tracker) } func TestIPTracker_ShouldVerifyIP(t *testing.T) { diff --git a/network/network.go b/network/network.go index 374038883ba7..51c2d223829e 100644 --- a/network/network.go +++ b/network/network.go @@ -237,7 +237,7 @@ func NewNetwork( return nil, fmt.Errorf("initializing network metrics failed with: %w", err) } - ipTracker, err := newIPTracker(log) + ipTracker, err := newIPTracker(log, config.Namespace, metricsRegisterer) if err != nil { return nil, fmt.Errorf("initializing ip tracker failed with: %w", err) } From 68986d301a0e7f7b50238ccef8daf54e364cec41 Mon Sep 17 00:00:00 2001 From: Dhruba Basu <7675102+dhrubabasu@users.noreply.github.com> Date: Wed, 17 Jan 2024 10:33:39 -0500 Subject: [PATCH 41/57] `x/sync`: Auto-generate `MockNetworkClient` (#2617) --- scripts/mocks.mockgen.txt | 1 + x/sync/client_test.go | 3 --- x/sync/mock_network_client.go | 32 ++++++++++---------------------- 3 files changed, 11 insertions(+), 25 deletions(-) diff --git a/scripts/mocks.mockgen.txt b/scripts/mocks.mockgen.txt index c3bb7d3ffd24..84c44c2966e6 100644 --- a/scripts/mocks.mockgen.txt +++ b/scripts/mocks.mockgen.txt @@ -42,3 +42,4 @@ github.com/ava-labs/avalanchego/vms/registry=VMRegisterer=vms/registry/mock_vm_r github.com/ava-labs/avalanchego/vms/registry=VMRegistry=vms/registry/mock_vm_registry.go github.com/ava-labs/avalanchego/vms=Factory,Manager=vms/mock_manager.go github.com/ava-labs/avalanchego/x/sync=Client=x/sync/mock_client.go +github.com/ava-labs/avalanchego/x/sync=NetworkClient=x/sync/mock_network_client.go diff --git a/x/sync/client_test.go b/x/sync/client_test.go index e81d1a44010c..d394aa654c14 100644 --- a/x/sync/client_test.go +++ b/x/sync/client_test.go @@ -123,9 +123,6 @@ func sendRangeProofRequest( }, ).AnyTimes() - // Handle bandwidth tracking calls from client. - networkClient.EXPECT().TrackBandwidth(gomock.Any(), gomock.Any()).AnyTimes() - // The server should expect to "send" a response to the client. sender.EXPECT().SendAppResponse( gomock.Any(), // ctx diff --git a/x/sync/mock_network_client.go b/x/sync/mock_network_client.go index 8021a015f062..027b4f549366 100644 --- a/x/sync/mock_network_client.go +++ b/x/sync/mock_network_client.go @@ -1,7 +1,7 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: x/sync/network_client.go +// Source: github.com/ava-labs/avalanchego/x/sync (interfaces: NetworkClient) -// Package mock_sync is a generated GoMock package. +// Package sync is a generated GoMock package. package sync import ( @@ -93,24 +93,24 @@ func (mr *MockNetworkClientMockRecorder) Disconnected(arg0, arg1 interface{}) *g } // Request mocks base method. -func (m *MockNetworkClient) Request(ctx context.Context, nodeID ids.NodeID, request []byte) ([]byte, error) { +func (m *MockNetworkClient) Request(arg0 context.Context, arg1 ids.NodeID, arg2 []byte) ([]byte, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Request", ctx, nodeID, request) + ret := m.ctrl.Call(m, "Request", arg0, arg1, arg2) ret0, _ := ret[0].([]byte) ret1, _ := ret[1].(error) return ret0, ret1 } // Request indicates an expected call of Request. -func (mr *MockNetworkClientMockRecorder) Request(ctx, nodeID, request interface{}) *gomock.Call { +func (mr *MockNetworkClientMockRecorder) Request(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Request", reflect.TypeOf((*MockNetworkClient)(nil).Request), ctx, nodeID, request) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Request", reflect.TypeOf((*MockNetworkClient)(nil).Request), arg0, arg1, arg2) } // RequestAny mocks base method. -func (m *MockNetworkClient) RequestAny(ctx context.Context, minVersion *version.Application, request []byte) (ids.NodeID, []byte, error) { +func (m *MockNetworkClient) RequestAny(arg0 context.Context, arg1 *version.Application, arg2 []byte) (ids.NodeID, []byte, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "RequestAny", ctx, minVersion, request) + ret := m.ctrl.Call(m, "RequestAny", arg0, arg1, arg2) ret0, _ := ret[0].(ids.NodeID) ret1, _ := ret[1].([]byte) ret2, _ := ret[2].(error) @@ -118,19 +118,7 @@ func (m *MockNetworkClient) RequestAny(ctx context.Context, minVersion *version. } // RequestAny indicates an expected call of RequestAny. -func (mr *MockNetworkClientMockRecorder) RequestAny(ctx, minVersion, request interface{}) *gomock.Call { +func (mr *MockNetworkClientMockRecorder) RequestAny(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RequestAny", reflect.TypeOf((*MockNetworkClient)(nil).RequestAny), ctx, minVersion, request) -} - -// TrackBandwidth mocks base method. -func (m *MockNetworkClient) TrackBandwidth(nodeID ids.NodeID, bandwidth float64) { - m.ctrl.T.Helper() - m.ctrl.Call(m, "TrackBandwidth", nodeID, bandwidth) -} - -// TrackBandwidth indicates an expected call of TrackBandwidth. -func (mr *MockNetworkClientMockRecorder) TrackBandwidth(nodeID, bandwidth interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TrackBandwidth", reflect.TypeOf((*MockNetworkClient)(nil).TrackBandwidth), nodeID, bandwidth) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RequestAny", reflect.TypeOf((*MockNetworkClient)(nil).RequestAny), arg0, arg1, arg2) } From fdaee4a6910f0ac078602b642a5d7b4c95c35bf9 Mon Sep 17 00:00:00 2001 From: Joshua Kim <20001595+joshua-kim@users.noreply.github.com> Date: Wed, 17 Jan 2024 10:36:00 -0500 Subject: [PATCH 42/57] Remove CreateStaticHandlers from VM interface (#2589) Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com> --- api/admin/service.go | 2 +- api/admin/service_test.go | 6 +- node/node.go | 15 +- proto/pb/vm/vm.pb.go | 1471 ++++++++++---------- proto/pb/vm/vm_grpc.pb.go | 49 - proto/vm/vm.proto | 11 - scripts/mocks.mockgen.txt | 1 - snow/engine/avalanche/vertex/mock_vm.go | 15 - snow/engine/common/test_vm.go | 15 +- snow/engine/common/vm.go | 17 - snow/engine/snowman/block/mock_chain_vm.go | 15 - tests/e2e/e2e_test.go | 1 - tests/e2e/static-handlers/suites.go | 169 --- utils/constants/aliases.go | 9 +- vms/avm/static_client.go | 36 - vms/avm/static_service_test.go | 103 -- vms/avm/vm.go | 11 - vms/example/xsvm/vm.go | 4 - vms/platformvm/api/static_client.go | 44 - vms/platformvm/vm.go | 13 - vms/registry/mock_vm_registerer.go | 65 - vms/registry/mock_vm_registry.go | 16 - vms/registry/vm_registerer.go | 164 --- vms/registry/vm_registerer_test.go | 436 ------ vms/registry/vm_registry.go | 20 +- vms/registry/vm_registry_test.go | 134 +- vms/rpcchainvm/vm_client.go | 19 - vms/rpcchainvm/vm_server.go | 26 - 28 files changed, 733 insertions(+), 2154 deletions(-) delete mode 100644 tests/e2e/static-handlers/suites.go delete mode 100644 vms/avm/static_client.go delete mode 100644 vms/avm/static_service_test.go delete mode 100644 vms/platformvm/api/static_client.go delete mode 100644 vms/registry/mock_vm_registerer.go delete mode 100644 vms/registry/vm_registerer.go delete mode 100644 vms/registry/vm_registerer_test.go diff --git a/api/admin/service.go b/api/admin/service.go index 5a60193acce8..cf57a28264e7 100644 --- a/api/admin/service.go +++ b/api/admin/service.go @@ -334,7 +334,7 @@ func (a *Admin) LoadVMs(r *http.Request, _ *struct{}, reply *LoadVMsReply) error defer a.lock.Unlock() ctx := r.Context() - loadedVMs, failedVMs, err := a.VMRegistry.ReloadWithReadLock(ctx) + loadedVMs, failedVMs, err := a.VMRegistry.Reload(ctx) if err != nil { return err } diff --git a/api/admin/service_test.go b/api/admin/service_test.go index 2076a5756b0b..ea159c655c63 100644 --- a/api/admin/service_test.go +++ b/api/admin/service_test.go @@ -64,7 +64,7 @@ func TestLoadVMsSuccess(t *testing.T) { id2: alias2[1:], } - resources.mockVMRegistry.EXPECT().ReloadWithReadLock(gomock.Any()).Times(1).Return(newVMs, failedVMs, nil) + resources.mockVMRegistry.EXPECT().Reload(gomock.Any()).Times(1).Return(newVMs, failedVMs, nil) resources.mockVMManager.EXPECT().Aliases(id1).Times(1).Return(alias1, nil) resources.mockVMManager.EXPECT().Aliases(id2).Times(1).Return(alias2, nil) @@ -81,7 +81,7 @@ func TestLoadVMsReloadFails(t *testing.T) { resources := initLoadVMsTest(t) // Reload fails - resources.mockVMRegistry.EXPECT().ReloadWithReadLock(gomock.Any()).Times(1).Return(nil, nil, errTest) + resources.mockVMRegistry.EXPECT().Reload(gomock.Any()).Times(1).Return(nil, nil, errTest) reply := LoadVMsReply{} err := resources.admin.LoadVMs(&http.Request{}, nil, &reply) @@ -103,7 +103,7 @@ func TestLoadVMsGetAliasesFails(t *testing.T) { // every vm is at least aliased to itself. alias1 := []string{id1.String(), "vm1-alias-1", "vm1-alias-2"} - resources.mockVMRegistry.EXPECT().ReloadWithReadLock(gomock.Any()).Times(1).Return(newVMs, failedVMs, nil) + resources.mockVMRegistry.EXPECT().Reload(gomock.Any()).Times(1).Return(newVMs, failedVMs, nil) resources.mockVMManager.EXPECT().Aliases(id1).Times(1).Return(alias1, nil) resources.mockVMManager.EXPECT().Aliases(id2).Times(1).Return(nil, errTest) diff --git a/node/node.go b/node/node.go index 24f5c1711767..1aeaddcf6245 100644 --- a/node/node.go +++ b/node/node.go @@ -1172,13 +1172,6 @@ func (n *Node) initVMs() error { vdrs = validators.NewManager() } - vmRegisterer := registry.NewVMRegisterer(registry.VMRegistererConfig{ - APIServer: n.APIServer, - Log: n.Log, - VMFactoryLog: n.VMFactoryLog, - VMManager: n.VMManager, - }) - durangoTime := version.GetDurangoTime(n.Config.NetworkID) if err := txs.InitCodec(durangoTime); err != nil { return err @@ -1192,7 +1185,7 @@ func (n *Node) initVMs() error { // Register the VMs that Avalanche supports err := utils.Err( - vmRegisterer.Register(context.TODO(), constants.PlatformVMID, &platformvm.Factory{ + n.VMManager.RegisterFactory(context.TODO(), constants.PlatformVMID, &platformvm.Factory{ Config: platformconfig.Config{ Chains: n.chainManager, Validators: vdrs, @@ -1225,14 +1218,14 @@ func (n *Node) initVMs() error { UseCurrentHeight: n.Config.UseCurrentHeight, }, }), - vmRegisterer.Register(context.TODO(), constants.AVMID, &avm.Factory{ + n.VMManager.RegisterFactory(context.TODO(), constants.AVMID, &avm.Factory{ Config: avmconfig.Config{ TxFee: n.Config.TxFee, CreateAssetTxFee: n.Config.CreateAssetTxFee, DurangoTime: durangoTime, }, }), - vmRegisterer.Register(context.TODO(), constants.EVMID, &coreth.Factory{}), + n.VMManager.RegisterFactory(context.TODO(), constants.EVMID, &coreth.Factory{}), n.VMManager.RegisterFactory(context.TODO(), secp256k1fx.ID, &secp256k1fx.Factory{}), n.VMManager.RegisterFactory(context.TODO(), nftfx.ID, &nftfx.Factory{}), n.VMManager.RegisterFactory(context.TODO(), propertyfx.ID, &propertyfx.Factory{}), @@ -1253,7 +1246,7 @@ func (n *Node) initVMs() error { CPUTracker: n.resourceManager, RuntimeTracker: n.runtimeManager, }), - VMRegisterer: vmRegisterer, + VMManager: n.VMManager, }) // register any vms that need to be installed as plugins from disk diff --git a/proto/pb/vm/vm.pb.go b/proto/pb/vm/vm.pb.go index f7d48de642d7..7f38e5bbf4a7 100644 --- a/proto/pb/vm/vm.pb.go +++ b/proto/pb/vm/vm.pb.go @@ -232,7 +232,7 @@ func (x StateSummaryAcceptResponse_Mode) Number() protoreflect.EnumNumber { // Deprecated: Use StateSummaryAcceptResponse_Mode.Descriptor instead. func (StateSummaryAcceptResponse_Mode) EnumDescriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{45, 0} + return file_vm_vm_proto_rawDescGZIP(), []int{44, 0} } type InitializeRequest struct { @@ -643,53 +643,6 @@ func (x *CreateHandlersResponse) GetHandlers() []*Handler { return nil } -type CreateStaticHandlersResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Handlers []*Handler `protobuf:"bytes,1,rep,name=handlers,proto3" json:"handlers,omitempty"` -} - -func (x *CreateStaticHandlersResponse) Reset() { - *x = CreateStaticHandlersResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateStaticHandlersResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateStaticHandlersResponse) ProtoMessage() {} - -func (x *CreateStaticHandlersResponse) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateStaticHandlersResponse.ProtoReflect.Descriptor instead. -func (*CreateStaticHandlersResponse) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{5} -} - -func (x *CreateStaticHandlersResponse) GetHandlers() []*Handler { - if x != nil { - return x.Handlers - } - return nil -} - type Handler struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -704,7 +657,7 @@ type Handler struct { func (x *Handler) Reset() { *x = Handler{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[6] + mi := &file_vm_vm_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -717,7 +670,7 @@ func (x *Handler) String() string { func (*Handler) ProtoMessage() {} func (x *Handler) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[6] + mi := &file_vm_vm_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -730,7 +683,7 @@ func (x *Handler) ProtoReflect() protoreflect.Message { // Deprecated: Use Handler.ProtoReflect.Descriptor instead. func (*Handler) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{6} + return file_vm_vm_proto_rawDescGZIP(), []int{5} } func (x *Handler) GetPrefix() string { @@ -758,7 +711,7 @@ type BuildBlockRequest struct { func (x *BuildBlockRequest) Reset() { *x = BuildBlockRequest{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[7] + mi := &file_vm_vm_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -771,7 +724,7 @@ func (x *BuildBlockRequest) String() string { func (*BuildBlockRequest) ProtoMessage() {} func (x *BuildBlockRequest) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[7] + mi := &file_vm_vm_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -784,7 +737,7 @@ func (x *BuildBlockRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use BuildBlockRequest.ProtoReflect.Descriptor instead. func (*BuildBlockRequest) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{7} + return file_vm_vm_proto_rawDescGZIP(), []int{6} } func (x *BuildBlockRequest) GetPChainHeight() uint64 { @@ -811,7 +764,7 @@ type BuildBlockResponse struct { func (x *BuildBlockResponse) Reset() { *x = BuildBlockResponse{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[8] + mi := &file_vm_vm_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -824,7 +777,7 @@ func (x *BuildBlockResponse) String() string { func (*BuildBlockResponse) ProtoMessage() {} func (x *BuildBlockResponse) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[8] + mi := &file_vm_vm_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -837,7 +790,7 @@ func (x *BuildBlockResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use BuildBlockResponse.ProtoReflect.Descriptor instead. func (*BuildBlockResponse) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{8} + return file_vm_vm_proto_rawDescGZIP(), []int{7} } func (x *BuildBlockResponse) GetId() []byte { @@ -893,7 +846,7 @@ type ParseBlockRequest struct { func (x *ParseBlockRequest) Reset() { *x = ParseBlockRequest{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[9] + mi := &file_vm_vm_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -906,7 +859,7 @@ func (x *ParseBlockRequest) String() string { func (*ParseBlockRequest) ProtoMessage() {} func (x *ParseBlockRequest) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[9] + mi := &file_vm_vm_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -919,7 +872,7 @@ func (x *ParseBlockRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ParseBlockRequest.ProtoReflect.Descriptor instead. func (*ParseBlockRequest) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{9} + return file_vm_vm_proto_rawDescGZIP(), []int{8} } func (x *ParseBlockRequest) GetBytes() []byte { @@ -945,7 +898,7 @@ type ParseBlockResponse struct { func (x *ParseBlockResponse) Reset() { *x = ParseBlockResponse{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[10] + mi := &file_vm_vm_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -958,7 +911,7 @@ func (x *ParseBlockResponse) String() string { func (*ParseBlockResponse) ProtoMessage() {} func (x *ParseBlockResponse) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[10] + mi := &file_vm_vm_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -971,7 +924,7 @@ func (x *ParseBlockResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ParseBlockResponse.ProtoReflect.Descriptor instead. func (*ParseBlockResponse) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{10} + return file_vm_vm_proto_rawDescGZIP(), []int{9} } func (x *ParseBlockResponse) GetId() []byte { @@ -1027,7 +980,7 @@ type GetBlockRequest struct { func (x *GetBlockRequest) Reset() { *x = GetBlockRequest{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[11] + mi := &file_vm_vm_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1040,7 +993,7 @@ func (x *GetBlockRequest) String() string { func (*GetBlockRequest) ProtoMessage() {} func (x *GetBlockRequest) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[11] + mi := &file_vm_vm_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1053,7 +1006,7 @@ func (x *GetBlockRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetBlockRequest.ProtoReflect.Descriptor instead. func (*GetBlockRequest) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{11} + return file_vm_vm_proto_rawDescGZIP(), []int{10} } func (x *GetBlockRequest) GetId() []byte { @@ -1081,7 +1034,7 @@ type GetBlockResponse struct { func (x *GetBlockResponse) Reset() { *x = GetBlockResponse{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[12] + mi := &file_vm_vm_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1094,7 +1047,7 @@ func (x *GetBlockResponse) String() string { func (*GetBlockResponse) ProtoMessage() {} func (x *GetBlockResponse) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[12] + mi := &file_vm_vm_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1107,7 +1060,7 @@ func (x *GetBlockResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetBlockResponse.ProtoReflect.Descriptor instead. func (*GetBlockResponse) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{12} + return file_vm_vm_proto_rawDescGZIP(), []int{11} } func (x *GetBlockResponse) GetParentId() []byte { @@ -1170,7 +1123,7 @@ type SetPreferenceRequest struct { func (x *SetPreferenceRequest) Reset() { *x = SetPreferenceRequest{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[13] + mi := &file_vm_vm_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1183,7 +1136,7 @@ func (x *SetPreferenceRequest) String() string { func (*SetPreferenceRequest) ProtoMessage() {} func (x *SetPreferenceRequest) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[13] + mi := &file_vm_vm_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1196,7 +1149,7 @@ func (x *SetPreferenceRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SetPreferenceRequest.ProtoReflect.Descriptor instead. func (*SetPreferenceRequest) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{13} + return file_vm_vm_proto_rawDescGZIP(), []int{12} } func (x *SetPreferenceRequest) GetId() []byte { @@ -1220,7 +1173,7 @@ type BlockVerifyRequest struct { func (x *BlockVerifyRequest) Reset() { *x = BlockVerifyRequest{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[14] + mi := &file_vm_vm_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1233,7 +1186,7 @@ func (x *BlockVerifyRequest) String() string { func (*BlockVerifyRequest) ProtoMessage() {} func (x *BlockVerifyRequest) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[14] + mi := &file_vm_vm_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1246,7 +1199,7 @@ func (x *BlockVerifyRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use BlockVerifyRequest.ProtoReflect.Descriptor instead. func (*BlockVerifyRequest) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{14} + return file_vm_vm_proto_rawDescGZIP(), []int{13} } func (x *BlockVerifyRequest) GetBytes() []byte { @@ -1274,7 +1227,7 @@ type BlockVerifyResponse struct { func (x *BlockVerifyResponse) Reset() { *x = BlockVerifyResponse{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[15] + mi := &file_vm_vm_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1287,7 +1240,7 @@ func (x *BlockVerifyResponse) String() string { func (*BlockVerifyResponse) ProtoMessage() {} func (x *BlockVerifyResponse) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[15] + mi := &file_vm_vm_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1300,7 +1253,7 @@ func (x *BlockVerifyResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use BlockVerifyResponse.ProtoReflect.Descriptor instead. func (*BlockVerifyResponse) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{15} + return file_vm_vm_proto_rawDescGZIP(), []int{14} } func (x *BlockVerifyResponse) GetTimestamp() *timestamppb.Timestamp { @@ -1321,7 +1274,7 @@ type BlockAcceptRequest struct { func (x *BlockAcceptRequest) Reset() { *x = BlockAcceptRequest{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[16] + mi := &file_vm_vm_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1334,7 +1287,7 @@ func (x *BlockAcceptRequest) String() string { func (*BlockAcceptRequest) ProtoMessage() {} func (x *BlockAcceptRequest) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[16] + mi := &file_vm_vm_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1347,7 +1300,7 @@ func (x *BlockAcceptRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use BlockAcceptRequest.ProtoReflect.Descriptor instead. func (*BlockAcceptRequest) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{16} + return file_vm_vm_proto_rawDescGZIP(), []int{15} } func (x *BlockAcceptRequest) GetId() []byte { @@ -1368,7 +1321,7 @@ type BlockRejectRequest struct { func (x *BlockRejectRequest) Reset() { *x = BlockRejectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[17] + mi := &file_vm_vm_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1381,7 +1334,7 @@ func (x *BlockRejectRequest) String() string { func (*BlockRejectRequest) ProtoMessage() {} func (x *BlockRejectRequest) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[17] + mi := &file_vm_vm_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1394,7 +1347,7 @@ func (x *BlockRejectRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use BlockRejectRequest.ProtoReflect.Descriptor instead. func (*BlockRejectRequest) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{17} + return file_vm_vm_proto_rawDescGZIP(), []int{16} } func (x *BlockRejectRequest) GetId() []byte { @@ -1415,7 +1368,7 @@ type HealthResponse struct { func (x *HealthResponse) Reset() { *x = HealthResponse{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[18] + mi := &file_vm_vm_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1428,7 +1381,7 @@ func (x *HealthResponse) String() string { func (*HealthResponse) ProtoMessage() {} func (x *HealthResponse) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[18] + mi := &file_vm_vm_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1441,7 +1394,7 @@ func (x *HealthResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use HealthResponse.ProtoReflect.Descriptor instead. func (*HealthResponse) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{18} + return file_vm_vm_proto_rawDescGZIP(), []int{17} } func (x *HealthResponse) GetDetails() []byte { @@ -1462,7 +1415,7 @@ type VersionResponse struct { func (x *VersionResponse) Reset() { *x = VersionResponse{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[19] + mi := &file_vm_vm_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1475,7 +1428,7 @@ func (x *VersionResponse) String() string { func (*VersionResponse) ProtoMessage() {} func (x *VersionResponse) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[19] + mi := &file_vm_vm_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1488,7 +1441,7 @@ func (x *VersionResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use VersionResponse.ProtoReflect.Descriptor instead. func (*VersionResponse) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{19} + return file_vm_vm_proto_rawDescGZIP(), []int{18} } func (x *VersionResponse) GetVersion() string { @@ -1516,7 +1469,7 @@ type AppRequestMsg struct { func (x *AppRequestMsg) Reset() { *x = AppRequestMsg{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[20] + mi := &file_vm_vm_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1529,7 +1482,7 @@ func (x *AppRequestMsg) String() string { func (*AppRequestMsg) ProtoMessage() {} func (x *AppRequestMsg) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[20] + mi := &file_vm_vm_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1542,7 +1495,7 @@ func (x *AppRequestMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use AppRequestMsg.ProtoReflect.Descriptor instead. func (*AppRequestMsg) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{20} + return file_vm_vm_proto_rawDescGZIP(), []int{19} } func (x *AppRequestMsg) GetNodeId() []byte { @@ -1591,7 +1544,7 @@ type AppRequestFailedMsg struct { func (x *AppRequestFailedMsg) Reset() { *x = AppRequestFailedMsg{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[21] + mi := &file_vm_vm_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1604,7 +1557,7 @@ func (x *AppRequestFailedMsg) String() string { func (*AppRequestFailedMsg) ProtoMessage() {} func (x *AppRequestFailedMsg) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[21] + mi := &file_vm_vm_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1617,7 +1570,7 @@ func (x *AppRequestFailedMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use AppRequestFailedMsg.ProtoReflect.Descriptor instead. func (*AppRequestFailedMsg) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{21} + return file_vm_vm_proto_rawDescGZIP(), []int{20} } func (x *AppRequestFailedMsg) GetNodeId() []byte { @@ -1664,7 +1617,7 @@ type AppResponseMsg struct { func (x *AppResponseMsg) Reset() { *x = AppResponseMsg{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[22] + mi := &file_vm_vm_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1677,7 +1630,7 @@ func (x *AppResponseMsg) String() string { func (*AppResponseMsg) ProtoMessage() {} func (x *AppResponseMsg) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[22] + mi := &file_vm_vm_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1690,7 +1643,7 @@ func (x *AppResponseMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use AppResponseMsg.ProtoReflect.Descriptor instead. func (*AppResponseMsg) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{22} + return file_vm_vm_proto_rawDescGZIP(), []int{21} } func (x *AppResponseMsg) GetNodeId() []byte { @@ -1728,7 +1681,7 @@ type AppGossipMsg struct { func (x *AppGossipMsg) Reset() { *x = AppGossipMsg{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[23] + mi := &file_vm_vm_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1741,7 +1694,7 @@ func (x *AppGossipMsg) String() string { func (*AppGossipMsg) ProtoMessage() {} func (x *AppGossipMsg) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[23] + mi := &file_vm_vm_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1754,7 +1707,7 @@ func (x *AppGossipMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use AppGossipMsg.ProtoReflect.Descriptor instead. func (*AppGossipMsg) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{23} + return file_vm_vm_proto_rawDescGZIP(), []int{22} } func (x *AppGossipMsg) GetNodeId() []byte { @@ -1789,7 +1742,7 @@ type CrossChainAppRequestMsg struct { func (x *CrossChainAppRequestMsg) Reset() { *x = CrossChainAppRequestMsg{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[24] + mi := &file_vm_vm_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1802,7 +1755,7 @@ func (x *CrossChainAppRequestMsg) String() string { func (*CrossChainAppRequestMsg) ProtoMessage() {} func (x *CrossChainAppRequestMsg) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[24] + mi := &file_vm_vm_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1815,7 +1768,7 @@ func (x *CrossChainAppRequestMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use CrossChainAppRequestMsg.ProtoReflect.Descriptor instead. func (*CrossChainAppRequestMsg) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{24} + return file_vm_vm_proto_rawDescGZIP(), []int{23} } func (x *CrossChainAppRequestMsg) GetChainId() []byte { @@ -1864,7 +1817,7 @@ type CrossChainAppRequestFailedMsg struct { func (x *CrossChainAppRequestFailedMsg) Reset() { *x = CrossChainAppRequestFailedMsg{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[25] + mi := &file_vm_vm_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1877,7 +1830,7 @@ func (x *CrossChainAppRequestFailedMsg) String() string { func (*CrossChainAppRequestFailedMsg) ProtoMessage() {} func (x *CrossChainAppRequestFailedMsg) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[25] + mi := &file_vm_vm_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1890,7 +1843,7 @@ func (x *CrossChainAppRequestFailedMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use CrossChainAppRequestFailedMsg.ProtoReflect.Descriptor instead. func (*CrossChainAppRequestFailedMsg) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{25} + return file_vm_vm_proto_rawDescGZIP(), []int{24} } func (x *CrossChainAppRequestFailedMsg) GetChainId() []byte { @@ -1937,7 +1890,7 @@ type CrossChainAppResponseMsg struct { func (x *CrossChainAppResponseMsg) Reset() { *x = CrossChainAppResponseMsg{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[26] + mi := &file_vm_vm_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1950,7 +1903,7 @@ func (x *CrossChainAppResponseMsg) String() string { func (*CrossChainAppResponseMsg) ProtoMessage() {} func (x *CrossChainAppResponseMsg) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[26] + mi := &file_vm_vm_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1963,7 +1916,7 @@ func (x *CrossChainAppResponseMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use CrossChainAppResponseMsg.ProtoReflect.Descriptor instead. func (*CrossChainAppResponseMsg) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{26} + return file_vm_vm_proto_rawDescGZIP(), []int{25} } func (x *CrossChainAppResponseMsg) GetChainId() []byte { @@ -2004,7 +1957,7 @@ type ConnectedRequest struct { func (x *ConnectedRequest) Reset() { *x = ConnectedRequest{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[27] + mi := &file_vm_vm_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2017,7 +1970,7 @@ func (x *ConnectedRequest) String() string { func (*ConnectedRequest) ProtoMessage() {} func (x *ConnectedRequest) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[27] + mi := &file_vm_vm_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2030,7 +1983,7 @@ func (x *ConnectedRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ConnectedRequest.ProtoReflect.Descriptor instead. func (*ConnectedRequest) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{27} + return file_vm_vm_proto_rawDescGZIP(), []int{26} } func (x *ConnectedRequest) GetNodeId() []byte { @@ -2079,7 +2032,7 @@ type DisconnectedRequest struct { func (x *DisconnectedRequest) Reset() { *x = DisconnectedRequest{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[28] + mi := &file_vm_vm_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2092,7 +2045,7 @@ func (x *DisconnectedRequest) String() string { func (*DisconnectedRequest) ProtoMessage() {} func (x *DisconnectedRequest) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[28] + mi := &file_vm_vm_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2105,7 +2058,7 @@ func (x *DisconnectedRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DisconnectedRequest.ProtoReflect.Descriptor instead. func (*DisconnectedRequest) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{28} + return file_vm_vm_proto_rawDescGZIP(), []int{27} } func (x *DisconnectedRequest) GetNodeId() []byte { @@ -2129,7 +2082,7 @@ type GetAncestorsRequest struct { func (x *GetAncestorsRequest) Reset() { *x = GetAncestorsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[29] + mi := &file_vm_vm_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2142,7 +2095,7 @@ func (x *GetAncestorsRequest) String() string { func (*GetAncestorsRequest) ProtoMessage() {} func (x *GetAncestorsRequest) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[29] + mi := &file_vm_vm_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2155,7 +2108,7 @@ func (x *GetAncestorsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetAncestorsRequest.ProtoReflect.Descriptor instead. func (*GetAncestorsRequest) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{29} + return file_vm_vm_proto_rawDescGZIP(), []int{28} } func (x *GetAncestorsRequest) GetBlkId() []byte { @@ -2197,7 +2150,7 @@ type GetAncestorsResponse struct { func (x *GetAncestorsResponse) Reset() { *x = GetAncestorsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[30] + mi := &file_vm_vm_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2210,7 +2163,7 @@ func (x *GetAncestorsResponse) String() string { func (*GetAncestorsResponse) ProtoMessage() {} func (x *GetAncestorsResponse) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[30] + mi := &file_vm_vm_proto_msgTypes[29] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2223,7 +2176,7 @@ func (x *GetAncestorsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetAncestorsResponse.ProtoReflect.Descriptor instead. func (*GetAncestorsResponse) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{30} + return file_vm_vm_proto_rawDescGZIP(), []int{29} } func (x *GetAncestorsResponse) GetBlksBytes() [][]byte { @@ -2244,7 +2197,7 @@ type BatchedParseBlockRequest struct { func (x *BatchedParseBlockRequest) Reset() { *x = BatchedParseBlockRequest{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[31] + mi := &file_vm_vm_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2257,7 +2210,7 @@ func (x *BatchedParseBlockRequest) String() string { func (*BatchedParseBlockRequest) ProtoMessage() {} func (x *BatchedParseBlockRequest) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[31] + mi := &file_vm_vm_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2270,7 +2223,7 @@ func (x *BatchedParseBlockRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use BatchedParseBlockRequest.ProtoReflect.Descriptor instead. func (*BatchedParseBlockRequest) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{31} + return file_vm_vm_proto_rawDescGZIP(), []int{30} } func (x *BatchedParseBlockRequest) GetRequest() [][]byte { @@ -2291,7 +2244,7 @@ type BatchedParseBlockResponse struct { func (x *BatchedParseBlockResponse) Reset() { *x = BatchedParseBlockResponse{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[32] + mi := &file_vm_vm_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2304,7 +2257,7 @@ func (x *BatchedParseBlockResponse) String() string { func (*BatchedParseBlockResponse) ProtoMessage() {} func (x *BatchedParseBlockResponse) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[32] + mi := &file_vm_vm_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2317,7 +2270,7 @@ func (x *BatchedParseBlockResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use BatchedParseBlockResponse.ProtoReflect.Descriptor instead. func (*BatchedParseBlockResponse) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{32} + return file_vm_vm_proto_rawDescGZIP(), []int{31} } func (x *BatchedParseBlockResponse) GetResponse() []*ParseBlockResponse { @@ -2338,7 +2291,7 @@ type VerifyHeightIndexResponse struct { func (x *VerifyHeightIndexResponse) Reset() { *x = VerifyHeightIndexResponse{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[33] + mi := &file_vm_vm_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2351,7 +2304,7 @@ func (x *VerifyHeightIndexResponse) String() string { func (*VerifyHeightIndexResponse) ProtoMessage() {} func (x *VerifyHeightIndexResponse) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[33] + mi := &file_vm_vm_proto_msgTypes[32] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2364,7 +2317,7 @@ func (x *VerifyHeightIndexResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use VerifyHeightIndexResponse.ProtoReflect.Descriptor instead. func (*VerifyHeightIndexResponse) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{33} + return file_vm_vm_proto_rawDescGZIP(), []int{32} } func (x *VerifyHeightIndexResponse) GetErr() Error { @@ -2385,7 +2338,7 @@ type GetBlockIDAtHeightRequest struct { func (x *GetBlockIDAtHeightRequest) Reset() { *x = GetBlockIDAtHeightRequest{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[34] + mi := &file_vm_vm_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2398,7 +2351,7 @@ func (x *GetBlockIDAtHeightRequest) String() string { func (*GetBlockIDAtHeightRequest) ProtoMessage() {} func (x *GetBlockIDAtHeightRequest) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[34] + mi := &file_vm_vm_proto_msgTypes[33] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2411,7 +2364,7 @@ func (x *GetBlockIDAtHeightRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetBlockIDAtHeightRequest.ProtoReflect.Descriptor instead. func (*GetBlockIDAtHeightRequest) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{34} + return file_vm_vm_proto_rawDescGZIP(), []int{33} } func (x *GetBlockIDAtHeightRequest) GetHeight() uint64 { @@ -2433,7 +2386,7 @@ type GetBlockIDAtHeightResponse struct { func (x *GetBlockIDAtHeightResponse) Reset() { *x = GetBlockIDAtHeightResponse{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[35] + mi := &file_vm_vm_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2446,7 +2399,7 @@ func (x *GetBlockIDAtHeightResponse) String() string { func (*GetBlockIDAtHeightResponse) ProtoMessage() {} func (x *GetBlockIDAtHeightResponse) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[35] + mi := &file_vm_vm_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2459,7 +2412,7 @@ func (x *GetBlockIDAtHeightResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetBlockIDAtHeightResponse.ProtoReflect.Descriptor instead. func (*GetBlockIDAtHeightResponse) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{35} + return file_vm_vm_proto_rawDescGZIP(), []int{34} } func (x *GetBlockIDAtHeightResponse) GetBlkId() []byte { @@ -2487,7 +2440,7 @@ type GatherResponse struct { func (x *GatherResponse) Reset() { *x = GatherResponse{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[36] + mi := &file_vm_vm_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2500,7 +2453,7 @@ func (x *GatherResponse) String() string { func (*GatherResponse) ProtoMessage() {} func (x *GatherResponse) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[36] + mi := &file_vm_vm_proto_msgTypes[35] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2513,7 +2466,7 @@ func (x *GatherResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GatherResponse.ProtoReflect.Descriptor instead. func (*GatherResponse) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{36} + return file_vm_vm_proto_rawDescGZIP(), []int{35} } func (x *GatherResponse) GetMetricFamilies() []*_go.MetricFamily { @@ -2535,7 +2488,7 @@ type StateSyncEnabledResponse struct { func (x *StateSyncEnabledResponse) Reset() { *x = StateSyncEnabledResponse{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[37] + mi := &file_vm_vm_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2548,7 +2501,7 @@ func (x *StateSyncEnabledResponse) String() string { func (*StateSyncEnabledResponse) ProtoMessage() {} func (x *StateSyncEnabledResponse) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[37] + mi := &file_vm_vm_proto_msgTypes[36] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2561,7 +2514,7 @@ func (x *StateSyncEnabledResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use StateSyncEnabledResponse.ProtoReflect.Descriptor instead. func (*StateSyncEnabledResponse) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{37} + return file_vm_vm_proto_rawDescGZIP(), []int{36} } func (x *StateSyncEnabledResponse) GetEnabled() bool { @@ -2592,7 +2545,7 @@ type GetOngoingSyncStateSummaryResponse struct { func (x *GetOngoingSyncStateSummaryResponse) Reset() { *x = GetOngoingSyncStateSummaryResponse{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[38] + mi := &file_vm_vm_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2605,7 +2558,7 @@ func (x *GetOngoingSyncStateSummaryResponse) String() string { func (*GetOngoingSyncStateSummaryResponse) ProtoMessage() {} func (x *GetOngoingSyncStateSummaryResponse) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[38] + mi := &file_vm_vm_proto_msgTypes[37] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2618,7 +2571,7 @@ func (x *GetOngoingSyncStateSummaryResponse) ProtoReflect() protoreflect.Message // Deprecated: Use GetOngoingSyncStateSummaryResponse.ProtoReflect.Descriptor instead. func (*GetOngoingSyncStateSummaryResponse) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{38} + return file_vm_vm_proto_rawDescGZIP(), []int{37} } func (x *GetOngoingSyncStateSummaryResponse) GetId() []byte { @@ -2663,7 +2616,7 @@ type GetLastStateSummaryResponse struct { func (x *GetLastStateSummaryResponse) Reset() { *x = GetLastStateSummaryResponse{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[39] + mi := &file_vm_vm_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2676,7 +2629,7 @@ func (x *GetLastStateSummaryResponse) String() string { func (*GetLastStateSummaryResponse) ProtoMessage() {} func (x *GetLastStateSummaryResponse) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[39] + mi := &file_vm_vm_proto_msgTypes[38] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2689,7 +2642,7 @@ func (x *GetLastStateSummaryResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetLastStateSummaryResponse.ProtoReflect.Descriptor instead. func (*GetLastStateSummaryResponse) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{39} + return file_vm_vm_proto_rawDescGZIP(), []int{38} } func (x *GetLastStateSummaryResponse) GetId() []byte { @@ -2731,7 +2684,7 @@ type ParseStateSummaryRequest struct { func (x *ParseStateSummaryRequest) Reset() { *x = ParseStateSummaryRequest{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[40] + mi := &file_vm_vm_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2744,7 +2697,7 @@ func (x *ParseStateSummaryRequest) String() string { func (*ParseStateSummaryRequest) ProtoMessage() {} func (x *ParseStateSummaryRequest) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[40] + mi := &file_vm_vm_proto_msgTypes[39] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2757,7 +2710,7 @@ func (x *ParseStateSummaryRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ParseStateSummaryRequest.ProtoReflect.Descriptor instead. func (*ParseStateSummaryRequest) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{40} + return file_vm_vm_proto_rawDescGZIP(), []int{39} } func (x *ParseStateSummaryRequest) GetBytes() []byte { @@ -2780,7 +2733,7 @@ type ParseStateSummaryResponse struct { func (x *ParseStateSummaryResponse) Reset() { *x = ParseStateSummaryResponse{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[41] + mi := &file_vm_vm_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2793,7 +2746,7 @@ func (x *ParseStateSummaryResponse) String() string { func (*ParseStateSummaryResponse) ProtoMessage() {} func (x *ParseStateSummaryResponse) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[41] + mi := &file_vm_vm_proto_msgTypes[40] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2806,7 +2759,7 @@ func (x *ParseStateSummaryResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ParseStateSummaryResponse.ProtoReflect.Descriptor instead. func (*ParseStateSummaryResponse) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{41} + return file_vm_vm_proto_rawDescGZIP(), []int{40} } func (x *ParseStateSummaryResponse) GetId() []byte { @@ -2841,7 +2794,7 @@ type GetStateSummaryRequest struct { func (x *GetStateSummaryRequest) Reset() { *x = GetStateSummaryRequest{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[42] + mi := &file_vm_vm_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2854,7 +2807,7 @@ func (x *GetStateSummaryRequest) String() string { func (*GetStateSummaryRequest) ProtoMessage() {} func (x *GetStateSummaryRequest) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[42] + mi := &file_vm_vm_proto_msgTypes[41] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2867,7 +2820,7 @@ func (x *GetStateSummaryRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetStateSummaryRequest.ProtoReflect.Descriptor instead. func (*GetStateSummaryRequest) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{42} + return file_vm_vm_proto_rawDescGZIP(), []int{41} } func (x *GetStateSummaryRequest) GetHeight() uint64 { @@ -2890,7 +2843,7 @@ type GetStateSummaryResponse struct { func (x *GetStateSummaryResponse) Reset() { *x = GetStateSummaryResponse{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[43] + mi := &file_vm_vm_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2903,7 +2856,7 @@ func (x *GetStateSummaryResponse) String() string { func (*GetStateSummaryResponse) ProtoMessage() {} func (x *GetStateSummaryResponse) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[43] + mi := &file_vm_vm_proto_msgTypes[42] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2916,7 +2869,7 @@ func (x *GetStateSummaryResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetStateSummaryResponse.ProtoReflect.Descriptor instead. func (*GetStateSummaryResponse) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{43} + return file_vm_vm_proto_rawDescGZIP(), []int{42} } func (x *GetStateSummaryResponse) GetId() []byte { @@ -2951,7 +2904,7 @@ type StateSummaryAcceptRequest struct { func (x *StateSummaryAcceptRequest) Reset() { *x = StateSummaryAcceptRequest{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[44] + mi := &file_vm_vm_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2964,7 +2917,7 @@ func (x *StateSummaryAcceptRequest) String() string { func (*StateSummaryAcceptRequest) ProtoMessage() {} func (x *StateSummaryAcceptRequest) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[44] + mi := &file_vm_vm_proto_msgTypes[43] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2977,7 +2930,7 @@ func (x *StateSummaryAcceptRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StateSummaryAcceptRequest.ProtoReflect.Descriptor instead. func (*StateSummaryAcceptRequest) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{44} + return file_vm_vm_proto_rawDescGZIP(), []int{43} } func (x *StateSummaryAcceptRequest) GetBytes() []byte { @@ -2999,7 +2952,7 @@ type StateSummaryAcceptResponse struct { func (x *StateSummaryAcceptResponse) Reset() { *x = StateSummaryAcceptResponse{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[45] + mi := &file_vm_vm_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3012,7 +2965,7 @@ func (x *StateSummaryAcceptResponse) String() string { func (*StateSummaryAcceptResponse) ProtoMessage() {} func (x *StateSummaryAcceptResponse) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[45] + mi := &file_vm_vm_proto_msgTypes[44] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3025,7 +2978,7 @@ func (x *StateSummaryAcceptResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use StateSummaryAcceptResponse.ProtoReflect.Descriptor instead. func (*StateSummaryAcceptResponse) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{45} + return file_vm_vm_proto_rawDescGZIP(), []int{44} } func (x *StateSummaryAcceptResponse) GetMode() StateSummaryAcceptResponse_Mode { @@ -3117,431 +3070,421 @@ var file_vm_vm_proto_rawDesc = []byte{ 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x08, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x76, 0x6d, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x52, 0x08, 0x68, - 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x22, 0x47, 0x0a, 0x1c, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x53, 0x74, 0x61, 0x74, 0x69, 0x63, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x08, 0x68, 0x61, 0x6e, 0x64, 0x6c, - 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x76, 0x6d, 0x2e, 0x48, - 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x52, 0x08, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, - 0x22, 0x42, 0x0a, 0x07, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x70, - 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x72, 0x65, - 0x66, 0x69, 0x78, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x64, - 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x41, 0x64, 0x64, 0x72, 0x22, 0x51, 0x0a, 0x11, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x0e, 0x70, 0x5f, 0x63, - 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x04, 0x48, 0x00, 0x52, 0x0c, 0x70, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, - 0x74, 0x88, 0x01, 0x01, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x70, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, - 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0xd9, 0x01, 0x0a, 0x12, 0x42, 0x75, 0x69, 0x6c, - 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, - 0x0a, 0x09, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x08, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x62, - 0x79, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, - 0x73, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x12, 0x2e, 0x0a, 0x13, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x77, 0x69, - 0x74, 0x68, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x11, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x57, 0x69, 0x74, 0x68, 0x43, 0x6f, 0x6e, 0x74, - 0x65, 0x78, 0x74, 0x22, 0x29, 0x0a, 0x11, 0x50, 0x61, 0x72, 0x73, 0x65, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x22, 0xe7, - 0x01, 0x0a, 0x12, 0x50, 0x61, 0x72, 0x73, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, + 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x22, 0x42, 0x0a, 0x07, 0x48, 0x61, 0x6e, 0x64, 0x6c, + 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x22, 0x51, 0x0a, 0x11, 0x42, + 0x75, 0x69, 0x6c, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x29, 0x0a, 0x0e, 0x70, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x68, 0x65, 0x69, 0x67, + 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x0c, 0x70, 0x43, 0x68, 0x61, + 0x69, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x88, 0x01, 0x01, 0x42, 0x11, 0x0a, 0x0f, 0x5f, + 0x70, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0xd9, + 0x01, 0x0a, 0x12, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, - 0x49, 0x64, 0x12, 0x22, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x76, 0x6d, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x38, - 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2e, 0x0a, 0x13, 0x76, 0x65, 0x72, 0x69, - 0x66, 0x79, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x57, 0x69, 0x74, - 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0x21, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x69, 0x64, 0x22, 0x88, 0x02, 0x0a, 0x10, - 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x08, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x14, 0x0a, - 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, 0x79, - 0x74, 0x65, 0x73, 0x12, 0x22, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x76, 0x6d, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, - 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, - 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, - 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, - 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1b, 0x0a, 0x03, 0x65, 0x72, 0x72, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x09, 0x2e, 0x76, 0x6d, 0x2e, 0x45, 0x72, 0x72, 0x6f, - 0x72, 0x52, 0x03, 0x65, 0x72, 0x72, 0x12, 0x2e, 0x0a, 0x13, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, - 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x11, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x57, 0x69, 0x74, 0x68, 0x43, - 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0x26, 0x0a, 0x14, 0x53, 0x65, 0x74, 0x50, 0x72, 0x65, - 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x69, 0x64, 0x22, 0x68, - 0x0a, 0x12, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x12, 0x29, 0x0a, 0x0e, 0x70, 0x5f, - 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x04, 0x48, 0x00, 0x52, 0x0c, 0x70, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x48, 0x65, 0x69, 0x67, - 0x68, 0x74, 0x88, 0x01, 0x01, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x70, 0x5f, 0x63, 0x68, 0x61, 0x69, - 0x6e, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x4f, 0x0a, 0x13, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, - 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x24, 0x0a, 0x12, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x69, 0x64, 0x22, - 0x24, 0x0a, 0x12, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, + 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, + 0x68, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, + 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, + 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2e, 0x0a, 0x13, 0x76, 0x65, + 0x72, 0x69, 0x66, 0x79, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, + 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x57, + 0x69, 0x74, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0x29, 0x0a, 0x11, 0x50, 0x61, + 0x72, 0x73, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x14, 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, + 0x62, 0x79, 0x74, 0x65, 0x73, 0x22, 0xe7, 0x01, 0x0a, 0x12, 0x50, 0x61, 0x72, 0x73, 0x65, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, + 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x08, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x76, 0x6d, 0x2e, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, + 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x68, + 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, + 0x2e, 0x0a, 0x13, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x76, 0x65, + 0x72, 0x69, 0x66, 0x79, 0x57, 0x69, 0x74, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, + 0x21, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, + 0x69, 0x64, 0x22, 0x88, 0x02, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x65, 0x6e, + 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x70, 0x61, 0x72, 0x65, + 0x6e, 0x74, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x12, 0x22, 0x0a, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x76, 0x6d, 0x2e, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, + 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, + 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x12, 0x1b, 0x0a, 0x03, 0x65, 0x72, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x09, 0x2e, + 0x76, 0x6d, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x03, 0x65, 0x72, 0x72, 0x12, 0x2e, 0x0a, + 0x13, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x78, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x76, 0x65, 0x72, 0x69, + 0x66, 0x79, 0x57, 0x69, 0x74, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0x26, 0x0a, + 0x14, 0x53, 0x65, 0x74, 0x50, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x02, 0x69, 0x64, 0x22, 0x2a, 0x0a, 0x0e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, - 0x6c, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, - 0x73, 0x22, 0x2b, 0x0a, 0x0f, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x99, - 0x01, 0x0a, 0x0d, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x73, 0x67, - 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x08, 0x64, 0x65, 0x61, 0x64, - 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, - 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x91, 0x01, 0x0a, 0x13, 0x41, - 0x70, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x4d, - 0x73, 0x67, 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, + 0x0c, 0x52, 0x02, 0x69, 0x64, 0x22, 0x68, 0x0a, 0x12, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x56, 0x65, + 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x62, + 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, + 0x73, 0x12, 0x29, 0x0a, 0x0e, 0x70, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x68, 0x65, 0x69, + 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x0c, 0x70, 0x43, 0x68, + 0x61, 0x69, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x88, 0x01, 0x01, 0x42, 0x11, 0x0a, 0x0f, + 0x5f, 0x70, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, + 0x4f, 0x0a, 0x13, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x22, 0x24, 0x0a, 0x12, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x02, 0x69, 0x64, 0x22, 0x24, 0x0a, 0x12, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, + 0x65, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x69, 0x64, 0x22, 0x2a, 0x0a, 0x0e, + 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x2b, 0x0a, 0x0f, 0x56, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x99, 0x01, 0x0a, 0x0d, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x4d, 0x73, 0x67, 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, + 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, + 0x36, 0x0a, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x08, 0x64, + 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x22, 0x91, 0x01, 0x0a, 0x13, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x4d, 0x73, 0x67, 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x6f, 0x64, + 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, + 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, + 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x11, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, + 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x64, 0x0a, 0x0e, 0x41, 0x70, 0x70, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x73, 0x67, 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, + 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, + 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x39, 0x0a, 0x0c, 0x41, + 0x70, 0x70, 0x47, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x4d, 0x73, 0x67, 0x12, 0x17, 0x0a, 0x07, 0x6e, + 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6e, 0x6f, + 0x64, 0x65, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x22, 0xa5, 0x01, 0x0a, 0x17, 0x43, 0x72, 0x6f, 0x73, 0x73, + 0x43, 0x68, 0x61, 0x69, 0x6e, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, + 0x73, 0x67, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, + 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x08, + 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x08, 0x64, 0x65, 0x61, 0x64, + 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x9d, + 0x01, 0x0a, 0x1d, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x41, 0x70, 0x70, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x4d, 0x73, 0x67, + 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x11, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x64, - 0x0a, 0x0e, 0x41, 0x70, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x73, 0x67, - 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x39, 0x0a, 0x0c, 0x41, 0x70, 0x70, 0x47, 0x6f, 0x73, 0x73, 0x69, - 0x70, 0x4d, 0x73, 0x67, 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x10, 0x0a, - 0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x22, - 0xa5, 0x01, 0x0a, 0x17, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x41, 0x70, - 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x73, 0x67, 0x12, 0x19, 0x0a, 0x08, 0x63, - 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, - 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x52, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x18, 0x0a, - 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x9d, 0x01, 0x0a, 0x1d, 0x43, 0x72, 0x6f, 0x73, - 0x73, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x4d, 0x73, 0x67, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, - 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, - 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x11, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, - 0x64, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x70, 0x0a, 0x18, 0x43, 0x72, 0x6f, 0x73, 0x73, - 0x43, 0x68, 0x61, 0x69, 0x6e, 0x41, 0x70, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x4d, 0x73, 0x67, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, - 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, - 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x81, 0x01, 0x0a, 0x10, 0x43, 0x6f, - 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, - 0x0a, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6d, - 0x61, 0x6a, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6d, 0x61, 0x6a, 0x6f, - 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, 0x22, 0x2e, 0x0a, - 0x13, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x22, 0xb3, 0x01, - 0x0a, 0x13, 0x47, 0x65, 0x74, 0x41, 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x6c, 0x6b, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, 0x6c, 0x6b, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0e, - 0x6d, 0x61, 0x78, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6d, 0x61, 0x78, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x4e, - 0x75, 0x6d, 0x12, 0x26, 0x0a, 0x0f, 0x6d, 0x61, 0x78, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, - 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x6d, 0x61, 0x78, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x37, 0x0a, 0x18, 0x6d, 0x61, - 0x78, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x5f, 0x72, 0x65, 0x74, 0x72, 0x69, 0x76, 0x61, - 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x15, 0x6d, 0x61, - 0x78, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x74, 0x72, 0x69, 0x76, 0x61, 0x6c, 0x54, - 0x69, 0x6d, 0x65, 0x22, 0x35, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x41, 0x6e, 0x63, 0x65, 0x73, 0x74, - 0x6f, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x62, - 0x6c, 0x6b, 0x73, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, - 0x09, 0x62, 0x6c, 0x6b, 0x73, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x34, 0x0a, 0x18, 0x42, 0x61, - 0x74, 0x63, 0x68, 0x65, 0x64, 0x50, 0x61, 0x72, 0x73, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x22, 0x4f, 0x0a, 0x19, 0x42, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 0x50, 0x61, 0x72, 0x73, 0x65, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, - 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x16, 0x2e, 0x76, 0x6d, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x38, 0x0a, 0x19, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x69, 0x67, 0x68, - 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, - 0x0a, 0x03, 0x65, 0x72, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x09, 0x2e, 0x76, 0x6d, - 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x03, 0x65, 0x72, 0x72, 0x22, 0x33, 0x0a, 0x19, 0x47, - 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x44, 0x41, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, - 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, - 0x22, 0x50, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x44, 0x41, 0x74, - 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x15, - 0x0a, 0x06, 0x62, 0x6c, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, - 0x62, 0x6c, 0x6b, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x03, 0x65, 0x72, 0x72, 0x18, 0x02, 0x20, 0x01, + 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x70, + 0x0a, 0x18, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x41, 0x70, 0x70, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x73, 0x67, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x81, 0x01, 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x05, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x69, 0x6e, 0x6f, + 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x12, 0x14, + 0x0a, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x70, + 0x61, 0x74, 0x63, 0x68, 0x22, 0x2e, 0x0a, 0x13, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, 0x65, + 0x63, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x6e, + 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6e, 0x6f, + 0x64, 0x65, 0x49, 0x64, 0x22, 0xb3, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x41, 0x6e, 0x63, 0x65, + 0x73, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x15, 0x0a, 0x06, + 0x62, 0x6c, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, 0x6c, + 0x6b, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x6d, 0x61, 0x78, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x73, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6d, 0x61, 0x78, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x4e, 0x75, 0x6d, 0x12, 0x26, 0x0a, 0x0f, 0x6d, 0x61, 0x78, + 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x0d, 0x6d, 0x61, 0x78, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x53, 0x69, 0x7a, + 0x65, 0x12, 0x37, 0x0a, 0x18, 0x6d, 0x61, 0x78, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x5f, + 0x72, 0x65, 0x74, 0x72, 0x69, 0x76, 0x61, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x15, 0x6d, 0x61, 0x78, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, + 0x74, 0x72, 0x69, 0x76, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x35, 0x0a, 0x14, 0x47, 0x65, + 0x74, 0x41, 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6c, 0x6b, 0x73, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x09, 0x62, 0x6c, 0x6b, 0x73, 0x42, 0x79, 0x74, 0x65, + 0x73, 0x22, 0x34, 0x0a, 0x18, 0x42, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 0x50, 0x61, 0x72, 0x73, + 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, + 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x07, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x4f, 0x0a, 0x19, 0x42, 0x61, 0x74, 0x63, 0x68, + 0x65, 0x64, 0x50, 0x61, 0x72, 0x73, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x76, 0x6d, 0x2e, 0x50, 0x61, 0x72, 0x73, + 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x08, + 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x0a, 0x19, 0x56, 0x65, 0x72, 0x69, + 0x66, 0x79, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x03, 0x65, 0x72, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x09, 0x2e, 0x76, 0x6d, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x03, 0x65, - 0x72, 0x72, 0x22, 0x5d, 0x0a, 0x0e, 0x47, 0x61, 0x74, 0x68, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x0f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x5f, 0x66, - 0x61, 0x6d, 0x69, 0x6c, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, - 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, - 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x46, 0x61, 0x6d, 0x69, 0x6c, - 0x79, 0x52, 0x0e, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x46, 0x61, 0x6d, 0x69, 0x6c, 0x69, 0x65, - 0x73, 0x22, 0x51, 0x0a, 0x18, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x79, 0x6e, 0x63, 0x45, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, - 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, - 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x1b, 0x0a, 0x03, 0x65, 0x72, 0x72, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x09, 0x2e, 0x76, 0x6d, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, - 0x03, 0x65, 0x72, 0x72, 0x22, 0x7f, 0x0a, 0x22, 0x47, 0x65, 0x74, 0x4f, 0x6e, 0x67, 0x6f, 0x69, - 0x6e, 0x67, 0x53, 0x79, 0x6e, 0x63, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, - 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, - 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, - 0x68, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x03, 0x65, 0x72, 0x72, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x09, 0x2e, 0x76, 0x6d, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, - 0x52, 0x03, 0x65, 0x72, 0x72, 0x22, 0x78, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x73, 0x74, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x14, 0x0a, 0x05, - 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, 0x79, 0x74, - 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x03, 0x65, 0x72, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x09, 0x2e, 0x76, 0x6d, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x03, 0x65, 0x72, 0x72, 0x22, - 0x30, 0x0a, 0x18, 0x50, 0x61, 0x72, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, - 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x62, - 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, - 0x73, 0x22, 0x60, 0x0a, 0x19, 0x50, 0x61, 0x72, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, - 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, - 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, - 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x1b, 0x0a, 0x03, 0x65, 0x72, 0x72, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x09, 0x2e, 0x76, 0x6d, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x03, - 0x65, 0x72, 0x72, 0x22, 0x30, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, - 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, - 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x68, - 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x5c, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x69, 0x64, - 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x03, 0x65, 0x72, 0x72, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x09, 0x2e, 0x76, 0x6d, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x03, - 0x65, 0x72, 0x72, 0x22, 0x31, 0x0a, 0x19, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, - 0x61, 0x72, 0x79, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x22, 0xc5, 0x01, 0x0a, 0x1a, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x76, 0x6d, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, - 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x12, 0x1b, + 0x72, 0x72, 0x22, 0x33, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x44, + 0x41, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x50, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x49, 0x44, 0x41, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x6c, 0x6b, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, 0x6c, 0x6b, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x03, + 0x65, 0x72, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x09, 0x2e, 0x76, 0x6d, 0x2e, 0x45, + 0x72, 0x72, 0x6f, 0x72, 0x52, 0x03, 0x65, 0x72, 0x72, 0x22, 0x5d, 0x0a, 0x0e, 0x47, 0x61, 0x74, + 0x68, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x0f, 0x6d, + 0x65, 0x74, 0x72, 0x69, 0x63, 0x5f, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x69, 0x65, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, + 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x4d, 0x65, 0x74, 0x72, + 0x69, 0x63, 0x46, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x52, 0x0e, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, + 0x46, 0x61, 0x6d, 0x69, 0x6c, 0x69, 0x65, 0x73, 0x22, 0x51, 0x0a, 0x18, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x53, 0x79, 0x6e, 0x63, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x1b, 0x0a, 0x03, 0x65, 0x72, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x09, 0x2e, 0x76, 0x6d, - 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x03, 0x65, 0x72, 0x72, 0x22, 0x51, 0x0a, 0x04, 0x4d, - 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, - 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x4d, 0x4f, 0x44, - 0x45, 0x5f, 0x53, 0x4b, 0x49, 0x50, 0x50, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x4d, - 0x4f, 0x44, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x49, 0x43, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, - 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x44, 0x59, 0x4e, 0x41, 0x4d, 0x49, 0x43, 0x10, 0x03, 0x2a, 0x65, - 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x54, 0x41, 0x54, 0x45, - 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x17, - 0x0a, 0x13, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x59, - 0x4e, 0x43, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x53, 0x54, 0x41, 0x54, 0x45, - 0x5f, 0x42, 0x4f, 0x4f, 0x54, 0x53, 0x54, 0x52, 0x41, 0x50, 0x50, 0x49, 0x4e, 0x47, 0x10, 0x02, - 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, - 0x5f, 0x4f, 0x50, 0x10, 0x03, 0x2a, 0x61, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, - 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, - 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x54, 0x41, 0x54, 0x55, - 0x53, 0x5f, 0x50, 0x52, 0x4f, 0x43, 0x45, 0x53, 0x53, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x13, - 0x0a, 0x0f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x45, - 0x44, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x41, 0x43, - 0x43, 0x45, 0x50, 0x54, 0x45, 0x44, 0x10, 0x03, 0x2a, 0x8e, 0x01, 0x0a, 0x05, 0x45, 0x72, 0x72, - 0x6f, 0x72, 0x12, 0x15, 0x0a, 0x11, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, - 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x45, 0x52, 0x52, - 0x4f, 0x52, 0x5f, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x44, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x45, - 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x02, - 0x12, 0x21, 0x0a, 0x1d, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x48, 0x45, 0x49, 0x47, 0x48, 0x54, - 0x5f, 0x49, 0x4e, 0x44, 0x45, 0x58, 0x5f, 0x49, 0x4e, 0x43, 0x4f, 0x4d, 0x50, 0x4c, 0x45, 0x54, - 0x45, 0x10, 0x03, 0x12, 0x24, 0x0a, 0x20, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x53, 0x54, 0x41, - 0x54, 0x45, 0x5f, 0x53, 0x59, 0x4e, 0x43, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x49, 0x4d, 0x50, 0x4c, - 0x45, 0x4d, 0x45, 0x4e, 0x54, 0x45, 0x44, 0x10, 0x04, 0x32, 0xa4, 0x12, 0x0a, 0x02, 0x56, 0x4d, - 0x12, 0x3b, 0x0a, 0x0a, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x12, 0x15, - 0x2e, 0x76, 0x6d, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x76, 0x6d, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x69, - 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, - 0x08, 0x53, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x13, 0x2e, 0x76, 0x6d, 0x2e, 0x53, - 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, - 0x2e, 0x76, 0x6d, 0x2e, 0x53, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x08, 0x53, 0x68, 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, - 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x12, 0x44, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, - 0x72, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1a, 0x2e, 0x76, 0x6d, 0x2e, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x53, 0x74, 0x61, 0x74, 0x69, 0x63, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x12, 0x16, + 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x03, 0x65, 0x72, 0x72, 0x22, 0x7f, 0x0a, 0x22, 0x47, + 0x65, 0x74, 0x4f, 0x6e, 0x67, 0x6f, 0x69, 0x6e, 0x67, 0x53, 0x79, 0x6e, 0x63, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, 0x74, + 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x12, + 0x1b, 0x0a, 0x03, 0x65, 0x72, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x09, 0x2e, 0x76, + 0x6d, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x03, 0x65, 0x72, 0x72, 0x22, 0x78, 0x0a, 0x1b, + 0x47, 0x65, 0x74, 0x4c, 0x61, 0x73, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, + 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x68, + 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x68, 0x65, 0x69, + 0x67, 0x68, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x03, 0x65, 0x72, 0x72, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x09, 0x2e, 0x76, 0x6d, 0x2e, 0x45, 0x72, 0x72, 0x6f, + 0x72, 0x52, 0x03, 0x65, 0x72, 0x72, 0x22, 0x30, 0x0a, 0x18, 0x50, 0x61, 0x72, 0x73, 0x65, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x22, 0x60, 0x0a, 0x19, 0x50, 0x61, 0x72, 0x73, + 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x1b, 0x0a, + 0x03, 0x65, 0x72, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x09, 0x2e, 0x76, 0x6d, 0x2e, + 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x03, 0x65, 0x72, 0x72, 0x22, 0x30, 0x0a, 0x16, 0x47, 0x65, + 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x5c, 0x0a, 0x17, + 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x12, 0x1b, 0x0a, + 0x03, 0x65, 0x72, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x09, 0x2e, 0x76, 0x6d, 0x2e, + 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x03, 0x65, 0x72, 0x72, 0x22, 0x31, 0x0a, 0x19, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x22, 0xc5, 0x01, + 0x0a, 0x1a, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x41, 0x63, + 0x63, 0x65, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x04, + 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x76, 0x6d, 0x2e, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x41, 0x63, 0x63, 0x65, + 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x52, + 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x12, 0x1b, 0x0a, 0x03, 0x65, 0x72, 0x72, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x09, 0x2e, 0x76, 0x6d, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x03, 0x65, + 0x72, 0x72, 0x22, 0x51, 0x0a, 0x04, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x4d, 0x4f, + 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, + 0x12, 0x10, 0x0a, 0x0c, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x53, 0x4b, 0x49, 0x50, 0x50, 0x45, 0x44, + 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x49, + 0x43, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x44, 0x59, 0x4e, 0x41, + 0x4d, 0x49, 0x43, 0x10, 0x03, 0x2a, 0x65, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x15, + 0x0a, 0x11, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, + 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x53, + 0x54, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x59, 0x4e, 0x43, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x17, + 0x0a, 0x13, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x42, 0x4f, 0x4f, 0x54, 0x53, 0x54, 0x52, 0x41, + 0x50, 0x50, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x54, 0x41, 0x54, 0x45, + 0x5f, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x5f, 0x4f, 0x50, 0x10, 0x03, 0x2a, 0x61, 0x0a, 0x06, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, + 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, + 0x0a, 0x11, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, 0x52, 0x4f, 0x43, 0x45, 0x53, 0x53, + 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, + 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x45, 0x44, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x54, + 0x41, 0x54, 0x55, 0x53, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x50, 0x54, 0x45, 0x44, 0x10, 0x03, 0x2a, + 0x8e, 0x01, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x15, 0x0a, 0x11, 0x45, 0x52, 0x52, + 0x4f, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, + 0x12, 0x10, 0x0a, 0x0c, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x44, + 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, + 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x02, 0x12, 0x21, 0x0a, 0x1d, 0x45, 0x52, 0x52, 0x4f, 0x52, + 0x5f, 0x48, 0x45, 0x49, 0x47, 0x48, 0x54, 0x5f, 0x49, 0x4e, 0x44, 0x45, 0x58, 0x5f, 0x49, 0x4e, + 0x43, 0x4f, 0x4d, 0x50, 0x4c, 0x45, 0x54, 0x45, 0x10, 0x03, 0x12, 0x24, 0x0a, 0x20, 0x45, 0x52, + 0x52, 0x4f, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x59, 0x4e, 0x43, 0x5f, 0x4e, + 0x4f, 0x54, 0x5f, 0x49, 0x4d, 0x50, 0x4c, 0x45, 0x4d, 0x45, 0x4e, 0x54, 0x45, 0x44, 0x10, 0x04, + 0x32, 0xd2, 0x11, 0x0a, 0x02, 0x56, 0x4d, 0x12, 0x3b, 0x0a, 0x0a, 0x49, 0x6e, 0x69, 0x74, 0x69, + 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x12, 0x15, 0x2e, 0x76, 0x6d, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x69, + 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x76, + 0x6d, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x53, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, + 0x12, 0x13, 0x2e, 0x76, 0x6d, 0x2e, 0x53, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x76, 0x6d, 0x2e, 0x53, 0x65, 0x74, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x08, 0x53, + 0x68, 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, + 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x44, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x1a, 0x1a, 0x2e, 0x76, 0x6d, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x61, 0x6e, + 0x64, 0x6c, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, + 0x09, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x12, 0x14, 0x2e, 0x76, 0x6d, 0x2e, + 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3f, 0x0a, 0x0c, 0x44, 0x69, 0x73, 0x63, + 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x12, 0x17, 0x2e, 0x76, 0x6d, 0x2e, 0x44, 0x69, + 0x73, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3b, 0x0a, 0x0a, 0x42, 0x75, 0x69, + 0x6c, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x15, 0x2e, 0x76, 0x6d, 0x2e, 0x42, 0x75, 0x69, + 0x6c, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, + 0x2e, 0x76, 0x6d, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x0a, 0x50, 0x61, 0x72, 0x73, 0x65, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x15, 0x2e, 0x76, 0x6d, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x76, 0x6d, + 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, + 0x13, 0x2e, 0x76, 0x6d, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x76, 0x6d, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x0d, 0x53, 0x65, + 0x74, 0x50, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x18, 0x2e, 0x76, 0x6d, + 0x2e, 0x53, 0x65, 0x74, 0x50, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x34, 0x0a, + 0x06, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, + 0x12, 0x2e, 0x76, 0x6d, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x20, 0x2e, 0x76, 0x6d, 0x2e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x69, 0x63, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x6e, - 0x65, 0x63, 0x74, 0x65, 0x64, 0x12, 0x14, 0x2e, 0x76, 0x6d, 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, - 0x63, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, - 0x70, 0x74, 0x79, 0x12, 0x3f, 0x0a, 0x0c, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, - 0x74, 0x65, 0x64, 0x12, 0x17, 0x2e, 0x76, 0x6d, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, - 0x65, 0x63, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x13, 0x2e, 0x76, 0x6d, 0x2e, 0x56, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x0a, 0x41, + 0x70, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x11, 0x2e, 0x76, 0x6d, 0x2e, 0x41, + 0x70, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x73, 0x67, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3b, 0x0a, 0x0a, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x12, 0x15, 0x2e, 0x76, 0x6d, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x76, 0x6d, 0x2e, 0x42, - 0x75, 0x69, 0x6c, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x3b, 0x0a, 0x0a, 0x50, 0x61, 0x72, 0x73, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, - 0x15, 0x2e, 0x76, 0x6d, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x76, 0x6d, 0x2e, 0x50, 0x61, 0x72, 0x73, - 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, - 0x0a, 0x08, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x13, 0x2e, 0x76, 0x6d, 0x2e, - 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x14, 0x2e, 0x76, 0x6d, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x0d, 0x53, 0x65, 0x74, 0x50, 0x72, 0x65, 0x66, - 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x18, 0x2e, 0x76, 0x6d, 0x2e, 0x53, 0x65, 0x74, 0x50, - 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x34, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x6c, - 0x74, 0x68, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x12, 0x2e, 0x76, 0x6d, 0x2e, - 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, - 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, - 0x79, 0x1a, 0x13, 0x2e, 0x76, 0x6d, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x0a, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x11, 0x2e, 0x76, 0x6d, 0x2e, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x4d, 0x73, 0x67, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, - 0x43, 0x0a, 0x10, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x46, 0x61, 0x69, - 0x6c, 0x65, 0x64, 0x12, 0x17, 0x2e, 0x76, 0x6d, 0x2e, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x4d, 0x73, 0x67, 0x1a, 0x16, 0x2e, 0x67, + 0x6d, 0x70, 0x74, 0x79, 0x12, 0x43, 0x0a, 0x10, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x17, 0x2e, 0x76, 0x6d, 0x2e, 0x41, 0x70, + 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x4d, 0x73, + 0x67, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x39, 0x0a, 0x0b, 0x41, 0x70, 0x70, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x2e, 0x76, 0x6d, 0x2e, 0x41, 0x70, + 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x73, 0x67, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x12, 0x39, 0x0a, 0x0b, 0x41, 0x70, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x12, 0x2e, 0x76, 0x6d, 0x2e, 0x41, 0x70, 0x70, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x73, 0x67, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, - 0x35, 0x0a, 0x09, 0x41, 0x70, 0x70, 0x47, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x12, 0x10, 0x2e, 0x76, - 0x6d, 0x2e, 0x41, 0x70, 0x70, 0x47, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x4d, 0x73, 0x67, 0x1a, 0x16, + 0x6d, 0x70, 0x74, 0x79, 0x12, 0x35, 0x0a, 0x09, 0x41, 0x70, 0x70, 0x47, 0x6f, 0x73, 0x73, 0x69, + 0x70, 0x12, 0x10, 0x2e, 0x76, 0x6d, 0x2e, 0x41, 0x70, 0x70, 0x47, 0x6f, 0x73, 0x73, 0x69, 0x70, + 0x4d, 0x73, 0x67, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x34, 0x0a, 0x06, 0x47, + 0x61, 0x74, 0x68, 0x65, 0x72, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x12, 0x2e, + 0x76, 0x6d, 0x2e, 0x47, 0x61, 0x74, 0x68, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x4b, 0x0a, 0x14, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x41, + 0x70, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x2e, 0x76, 0x6d, 0x2e, 0x43, + 0x72, 0x6f, 0x73, 0x73, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x4d, 0x73, 0x67, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x57, + 0x0a, 0x1a, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x41, 0x70, 0x70, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x21, 0x2e, 0x76, + 0x6d, 0x2e, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x41, 0x70, 0x70, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x4d, 0x73, 0x67, 0x1a, + 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x4d, 0x0a, 0x15, 0x43, 0x72, 0x6f, 0x73, 0x73, + 0x43, 0x68, 0x61, 0x69, 0x6e, 0x41, 0x70, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x1c, 0x2e, 0x76, 0x6d, 0x2e, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x43, 0x68, 0x61, 0x69, 0x6e, + 0x41, 0x70, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x73, 0x67, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x34, 0x0a, 0x06, 0x47, 0x61, 0x74, 0x68, 0x65, 0x72, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x41, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x41, 0x6e, 0x63, + 0x65, 0x73, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x17, 0x2e, 0x76, 0x6d, 0x2e, 0x47, 0x65, 0x74, 0x41, + 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x18, 0x2e, 0x76, 0x6d, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, 0x72, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x11, 0x42, 0x61, 0x74, + 0x63, 0x68, 0x65, 0x64, 0x50, 0x61, 0x72, 0x73, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1c, + 0x2e, 0x76, 0x6d, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 0x50, 0x61, 0x72, 0x73, 0x65, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x76, + 0x6d, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 0x50, 0x61, 0x72, 0x73, 0x65, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x11, 0x56, + 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x12, 0x2e, 0x76, 0x6d, 0x2e, 0x47, 0x61, - 0x74, 0x68, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x14, - 0x43, 0x72, 0x6f, 0x73, 0x73, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x2e, 0x76, 0x6d, 0x2e, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x43, - 0x68, 0x61, 0x69, 0x6e, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x73, - 0x67, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x57, 0x0a, 0x1a, 0x43, 0x72, 0x6f, - 0x73, 0x73, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x21, 0x2e, 0x76, 0x6d, 0x2e, 0x43, 0x72, 0x6f, - 0x73, 0x73, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x4d, 0x73, 0x67, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x12, 0x4d, 0x0a, 0x15, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x43, 0x68, 0x61, 0x69, 0x6e, - 0x41, 0x70, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x2e, 0x76, 0x6d, - 0x2e, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x41, 0x70, 0x70, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x73, 0x67, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, - 0x79, 0x12, 0x41, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x41, 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, 0x72, - 0x73, 0x12, 0x17, 0x2e, 0x76, 0x6d, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6e, 0x63, 0x65, 0x73, 0x74, - 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x76, 0x6d, 0x2e, - 0x47, 0x65, 0x74, 0x41, 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x11, 0x42, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 0x50, - 0x61, 0x72, 0x73, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1c, 0x2e, 0x76, 0x6d, 0x2e, 0x42, - 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 0x50, 0x61, 0x72, 0x73, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x76, 0x6d, 0x2e, 0x42, 0x61, 0x74, - 0x63, 0x68, 0x65, 0x64, 0x50, 0x61, 0x72, 0x73, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x11, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, - 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x16, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, - 0x70, 0x74, 0x79, 0x1a, 0x1d, 0x2e, 0x76, 0x6d, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, - 0x65, 0x69, 0x67, 0x68, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x53, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x44, - 0x41, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x1d, 0x2e, 0x76, 0x6d, 0x2e, 0x47, 0x65, - 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x44, 0x41, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x76, 0x6d, 0x2e, 0x47, 0x65, 0x74, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x44, 0x41, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x10, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x53, 0x79, 0x6e, 0x63, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x16, 0x2e, 0x67, 0x6f, + 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1d, 0x2e, 0x76, 0x6d, 0x2e, 0x56, 0x65, + 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x49, 0x44, 0x41, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x1d, 0x2e, + 0x76, 0x6d, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x44, 0x41, 0x74, 0x48, + 0x65, 0x69, 0x67, 0x68, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x76, + 0x6d, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x44, 0x41, 0x74, 0x48, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x10, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x79, 0x6e, 0x63, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, + 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1c, 0x2e, 0x76, 0x6d, 0x2e, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x53, 0x79, 0x6e, 0x63, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x4f, 0x6e, 0x67, + 0x6f, 0x69, 0x6e, 0x67, 0x53, 0x79, 0x6e, 0x63, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, + 0x6d, 0x61, 0x72, 0x79, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x26, 0x2e, 0x76, + 0x6d, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x6e, 0x67, 0x6f, 0x69, 0x6e, 0x67, 0x53, 0x79, 0x6e, 0x63, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x73, 0x74, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, - 0x70, 0x74, 0x79, 0x1a, 0x1c, 0x2e, 0x76, 0x6d, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x79, - 0x6e, 0x63, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x5c, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x4f, 0x6e, 0x67, 0x6f, 0x69, 0x6e, 0x67, 0x53, - 0x79, 0x6e, 0x63, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, - 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x26, 0x2e, 0x76, 0x6d, 0x2e, 0x47, 0x65, 0x74, - 0x4f, 0x6e, 0x67, 0x6f, 0x69, 0x6e, 0x67, 0x53, 0x79, 0x6e, 0x63, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x4e, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x73, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, - 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1f, - 0x2e, 0x76, 0x6d, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x73, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x50, 0x0a, 0x11, 0x50, 0x61, 0x72, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, - 0x6d, 0x61, 0x72, 0x79, 0x12, 0x1c, 0x2e, 0x76, 0x6d, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x53, - 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x76, 0x6d, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x53, 0x74, 0x61, - 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x4a, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, - 0x6d, 0x61, 0x72, 0x79, 0x12, 0x1a, 0x2e, 0x76, 0x6d, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, - 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1b, 0x2e, 0x76, 0x6d, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, - 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, - 0x0b, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x12, 0x16, 0x2e, 0x76, - 0x6d, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x76, 0x6d, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x56, - 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, - 0x0b, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x12, 0x16, 0x2e, 0x76, - 0x6d, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3d, 0x0a, 0x0b, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x16, 0x2e, 0x76, 0x6d, - 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x53, 0x0a, 0x12, 0x53, - 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x41, 0x63, 0x63, 0x65, 0x70, - 0x74, 0x12, 0x1d, 0x2e, 0x76, 0x6d, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, - 0x61, 0x72, 0x79, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1e, 0x2e, 0x76, 0x6d, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, - 0x72, 0x79, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x42, 0x2d, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, - 0x76, 0x61, 0x2d, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x61, 0x76, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x68, - 0x65, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x62, 0x2f, 0x76, 0x6d, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x70, 0x74, 0x79, 0x1a, 0x1f, 0x2e, 0x76, 0x6d, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x73, 0x74, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x11, 0x50, 0x61, 0x72, 0x73, 0x65, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x1c, 0x2e, 0x76, 0x6d, 0x2e, 0x50, + 0x61, 0x72, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x76, 0x6d, 0x2e, 0x50, 0x61, 0x72, + 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x1a, 0x2e, 0x76, 0x6d, 0x2e, 0x47, + 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x76, 0x6d, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x0b, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x56, 0x65, 0x72, 0x69, 0x66, + 0x79, 0x12, 0x16, 0x2e, 0x76, 0x6d, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x56, 0x65, 0x72, 0x69, + 0x66, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x76, 0x6d, 0x2e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x0b, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x63, 0x63, 0x65, 0x70, + 0x74, 0x12, 0x16, 0x2e, 0x76, 0x6d, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x63, 0x63, 0x65, + 0x70, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x12, 0x3d, 0x0a, 0x0b, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74, + 0x12, 0x16, 0x2e, 0x76, 0x6d, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x6a, 0x65, 0x63, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x12, 0x53, 0x0a, 0x12, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, + 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x12, 0x1d, 0x2e, 0x76, 0x6d, 0x2e, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x76, 0x6d, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, + 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x2d, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x76, 0x61, 0x2d, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x61, 0x76, 0x61, + 0x6c, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, + 0x62, 0x2f, 0x76, 0x6d, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3557,7 +3500,7 @@ func file_vm_vm_proto_rawDescGZIP() []byte { } var file_vm_vm_proto_enumTypes = make([]protoimpl.EnumInfo, 4) -var file_vm_vm_proto_msgTypes = make([]protoimpl.MessageInfo, 46) +var file_vm_vm_proto_msgTypes = make([]protoimpl.MessageInfo, 45) var file_vm_vm_proto_goTypes = []interface{}{ (State)(0), // 0: vm.State (Status)(0), // 1: vm.Status @@ -3568,150 +3511,146 @@ var file_vm_vm_proto_goTypes = []interface{}{ (*SetStateRequest)(nil), // 6: vm.SetStateRequest (*SetStateResponse)(nil), // 7: vm.SetStateResponse (*CreateHandlersResponse)(nil), // 8: vm.CreateHandlersResponse - (*CreateStaticHandlersResponse)(nil), // 9: vm.CreateStaticHandlersResponse - (*Handler)(nil), // 10: vm.Handler - (*BuildBlockRequest)(nil), // 11: vm.BuildBlockRequest - (*BuildBlockResponse)(nil), // 12: vm.BuildBlockResponse - (*ParseBlockRequest)(nil), // 13: vm.ParseBlockRequest - (*ParseBlockResponse)(nil), // 14: vm.ParseBlockResponse - (*GetBlockRequest)(nil), // 15: vm.GetBlockRequest - (*GetBlockResponse)(nil), // 16: vm.GetBlockResponse - (*SetPreferenceRequest)(nil), // 17: vm.SetPreferenceRequest - (*BlockVerifyRequest)(nil), // 18: vm.BlockVerifyRequest - (*BlockVerifyResponse)(nil), // 19: vm.BlockVerifyResponse - (*BlockAcceptRequest)(nil), // 20: vm.BlockAcceptRequest - (*BlockRejectRequest)(nil), // 21: vm.BlockRejectRequest - (*HealthResponse)(nil), // 22: vm.HealthResponse - (*VersionResponse)(nil), // 23: vm.VersionResponse - (*AppRequestMsg)(nil), // 24: vm.AppRequestMsg - (*AppRequestFailedMsg)(nil), // 25: vm.AppRequestFailedMsg - (*AppResponseMsg)(nil), // 26: vm.AppResponseMsg - (*AppGossipMsg)(nil), // 27: vm.AppGossipMsg - (*CrossChainAppRequestMsg)(nil), // 28: vm.CrossChainAppRequestMsg - (*CrossChainAppRequestFailedMsg)(nil), // 29: vm.CrossChainAppRequestFailedMsg - (*CrossChainAppResponseMsg)(nil), // 30: vm.CrossChainAppResponseMsg - (*ConnectedRequest)(nil), // 31: vm.ConnectedRequest - (*DisconnectedRequest)(nil), // 32: vm.DisconnectedRequest - (*GetAncestorsRequest)(nil), // 33: vm.GetAncestorsRequest - (*GetAncestorsResponse)(nil), // 34: vm.GetAncestorsResponse - (*BatchedParseBlockRequest)(nil), // 35: vm.BatchedParseBlockRequest - (*BatchedParseBlockResponse)(nil), // 36: vm.BatchedParseBlockResponse - (*VerifyHeightIndexResponse)(nil), // 37: vm.VerifyHeightIndexResponse - (*GetBlockIDAtHeightRequest)(nil), // 38: vm.GetBlockIDAtHeightRequest - (*GetBlockIDAtHeightResponse)(nil), // 39: vm.GetBlockIDAtHeightResponse - (*GatherResponse)(nil), // 40: vm.GatherResponse - (*StateSyncEnabledResponse)(nil), // 41: vm.StateSyncEnabledResponse - (*GetOngoingSyncStateSummaryResponse)(nil), // 42: vm.GetOngoingSyncStateSummaryResponse - (*GetLastStateSummaryResponse)(nil), // 43: vm.GetLastStateSummaryResponse - (*ParseStateSummaryRequest)(nil), // 44: vm.ParseStateSummaryRequest - (*ParseStateSummaryResponse)(nil), // 45: vm.ParseStateSummaryResponse - (*GetStateSummaryRequest)(nil), // 46: vm.GetStateSummaryRequest - (*GetStateSummaryResponse)(nil), // 47: vm.GetStateSummaryResponse - (*StateSummaryAcceptRequest)(nil), // 48: vm.StateSummaryAcceptRequest - (*StateSummaryAcceptResponse)(nil), // 49: vm.StateSummaryAcceptResponse - (*timestamppb.Timestamp)(nil), // 50: google.protobuf.Timestamp - (*_go.MetricFamily)(nil), // 51: io.prometheus.client.MetricFamily - (*emptypb.Empty)(nil), // 52: google.protobuf.Empty + (*Handler)(nil), // 9: vm.Handler + (*BuildBlockRequest)(nil), // 10: vm.BuildBlockRequest + (*BuildBlockResponse)(nil), // 11: vm.BuildBlockResponse + (*ParseBlockRequest)(nil), // 12: vm.ParseBlockRequest + (*ParseBlockResponse)(nil), // 13: vm.ParseBlockResponse + (*GetBlockRequest)(nil), // 14: vm.GetBlockRequest + (*GetBlockResponse)(nil), // 15: vm.GetBlockResponse + (*SetPreferenceRequest)(nil), // 16: vm.SetPreferenceRequest + (*BlockVerifyRequest)(nil), // 17: vm.BlockVerifyRequest + (*BlockVerifyResponse)(nil), // 18: vm.BlockVerifyResponse + (*BlockAcceptRequest)(nil), // 19: vm.BlockAcceptRequest + (*BlockRejectRequest)(nil), // 20: vm.BlockRejectRequest + (*HealthResponse)(nil), // 21: vm.HealthResponse + (*VersionResponse)(nil), // 22: vm.VersionResponse + (*AppRequestMsg)(nil), // 23: vm.AppRequestMsg + (*AppRequestFailedMsg)(nil), // 24: vm.AppRequestFailedMsg + (*AppResponseMsg)(nil), // 25: vm.AppResponseMsg + (*AppGossipMsg)(nil), // 26: vm.AppGossipMsg + (*CrossChainAppRequestMsg)(nil), // 27: vm.CrossChainAppRequestMsg + (*CrossChainAppRequestFailedMsg)(nil), // 28: vm.CrossChainAppRequestFailedMsg + (*CrossChainAppResponseMsg)(nil), // 29: vm.CrossChainAppResponseMsg + (*ConnectedRequest)(nil), // 30: vm.ConnectedRequest + (*DisconnectedRequest)(nil), // 31: vm.DisconnectedRequest + (*GetAncestorsRequest)(nil), // 32: vm.GetAncestorsRequest + (*GetAncestorsResponse)(nil), // 33: vm.GetAncestorsResponse + (*BatchedParseBlockRequest)(nil), // 34: vm.BatchedParseBlockRequest + (*BatchedParseBlockResponse)(nil), // 35: vm.BatchedParseBlockResponse + (*VerifyHeightIndexResponse)(nil), // 36: vm.VerifyHeightIndexResponse + (*GetBlockIDAtHeightRequest)(nil), // 37: vm.GetBlockIDAtHeightRequest + (*GetBlockIDAtHeightResponse)(nil), // 38: vm.GetBlockIDAtHeightResponse + (*GatherResponse)(nil), // 39: vm.GatherResponse + (*StateSyncEnabledResponse)(nil), // 40: vm.StateSyncEnabledResponse + (*GetOngoingSyncStateSummaryResponse)(nil), // 41: vm.GetOngoingSyncStateSummaryResponse + (*GetLastStateSummaryResponse)(nil), // 42: vm.GetLastStateSummaryResponse + (*ParseStateSummaryRequest)(nil), // 43: vm.ParseStateSummaryRequest + (*ParseStateSummaryResponse)(nil), // 44: vm.ParseStateSummaryResponse + (*GetStateSummaryRequest)(nil), // 45: vm.GetStateSummaryRequest + (*GetStateSummaryResponse)(nil), // 46: vm.GetStateSummaryResponse + (*StateSummaryAcceptRequest)(nil), // 47: vm.StateSummaryAcceptRequest + (*StateSummaryAcceptResponse)(nil), // 48: vm.StateSummaryAcceptResponse + (*timestamppb.Timestamp)(nil), // 49: google.protobuf.Timestamp + (*_go.MetricFamily)(nil), // 50: io.prometheus.client.MetricFamily + (*emptypb.Empty)(nil), // 51: google.protobuf.Empty } var file_vm_vm_proto_depIdxs = []int32{ - 50, // 0: vm.InitializeResponse.timestamp:type_name -> google.protobuf.Timestamp + 49, // 0: vm.InitializeResponse.timestamp:type_name -> google.protobuf.Timestamp 0, // 1: vm.SetStateRequest.state:type_name -> vm.State - 50, // 2: vm.SetStateResponse.timestamp:type_name -> google.protobuf.Timestamp - 10, // 3: vm.CreateHandlersResponse.handlers:type_name -> vm.Handler - 10, // 4: vm.CreateStaticHandlersResponse.handlers:type_name -> vm.Handler - 50, // 5: vm.BuildBlockResponse.timestamp:type_name -> google.protobuf.Timestamp - 1, // 6: vm.ParseBlockResponse.status:type_name -> vm.Status - 50, // 7: vm.ParseBlockResponse.timestamp:type_name -> google.protobuf.Timestamp - 1, // 8: vm.GetBlockResponse.status:type_name -> vm.Status - 50, // 9: vm.GetBlockResponse.timestamp:type_name -> google.protobuf.Timestamp - 2, // 10: vm.GetBlockResponse.err:type_name -> vm.Error - 50, // 11: vm.BlockVerifyResponse.timestamp:type_name -> google.protobuf.Timestamp - 50, // 12: vm.AppRequestMsg.deadline:type_name -> google.protobuf.Timestamp - 50, // 13: vm.CrossChainAppRequestMsg.deadline:type_name -> google.protobuf.Timestamp - 14, // 14: vm.BatchedParseBlockResponse.response:type_name -> vm.ParseBlockResponse - 2, // 15: vm.VerifyHeightIndexResponse.err:type_name -> vm.Error - 2, // 16: vm.GetBlockIDAtHeightResponse.err:type_name -> vm.Error - 51, // 17: vm.GatherResponse.metric_families:type_name -> io.prometheus.client.MetricFamily - 2, // 18: vm.StateSyncEnabledResponse.err:type_name -> vm.Error - 2, // 19: vm.GetOngoingSyncStateSummaryResponse.err:type_name -> vm.Error - 2, // 20: vm.GetLastStateSummaryResponse.err:type_name -> vm.Error - 2, // 21: vm.ParseStateSummaryResponse.err:type_name -> vm.Error - 2, // 22: vm.GetStateSummaryResponse.err:type_name -> vm.Error - 3, // 23: vm.StateSummaryAcceptResponse.mode:type_name -> vm.StateSummaryAcceptResponse.Mode - 2, // 24: vm.StateSummaryAcceptResponse.err:type_name -> vm.Error - 4, // 25: vm.VM.Initialize:input_type -> vm.InitializeRequest - 6, // 26: vm.VM.SetState:input_type -> vm.SetStateRequest - 52, // 27: vm.VM.Shutdown:input_type -> google.protobuf.Empty - 52, // 28: vm.VM.CreateHandlers:input_type -> google.protobuf.Empty - 52, // 29: vm.VM.CreateStaticHandlers:input_type -> google.protobuf.Empty - 31, // 30: vm.VM.Connected:input_type -> vm.ConnectedRequest - 32, // 31: vm.VM.Disconnected:input_type -> vm.DisconnectedRequest - 11, // 32: vm.VM.BuildBlock:input_type -> vm.BuildBlockRequest - 13, // 33: vm.VM.ParseBlock:input_type -> vm.ParseBlockRequest - 15, // 34: vm.VM.GetBlock:input_type -> vm.GetBlockRequest - 17, // 35: vm.VM.SetPreference:input_type -> vm.SetPreferenceRequest - 52, // 36: vm.VM.Health:input_type -> google.protobuf.Empty - 52, // 37: vm.VM.Version:input_type -> google.protobuf.Empty - 24, // 38: vm.VM.AppRequest:input_type -> vm.AppRequestMsg - 25, // 39: vm.VM.AppRequestFailed:input_type -> vm.AppRequestFailedMsg - 26, // 40: vm.VM.AppResponse:input_type -> vm.AppResponseMsg - 27, // 41: vm.VM.AppGossip:input_type -> vm.AppGossipMsg - 52, // 42: vm.VM.Gather:input_type -> google.protobuf.Empty - 28, // 43: vm.VM.CrossChainAppRequest:input_type -> vm.CrossChainAppRequestMsg - 29, // 44: vm.VM.CrossChainAppRequestFailed:input_type -> vm.CrossChainAppRequestFailedMsg - 30, // 45: vm.VM.CrossChainAppResponse:input_type -> vm.CrossChainAppResponseMsg - 33, // 46: vm.VM.GetAncestors:input_type -> vm.GetAncestorsRequest - 35, // 47: vm.VM.BatchedParseBlock:input_type -> vm.BatchedParseBlockRequest - 52, // 48: vm.VM.VerifyHeightIndex:input_type -> google.protobuf.Empty - 38, // 49: vm.VM.GetBlockIDAtHeight:input_type -> vm.GetBlockIDAtHeightRequest - 52, // 50: vm.VM.StateSyncEnabled:input_type -> google.protobuf.Empty - 52, // 51: vm.VM.GetOngoingSyncStateSummary:input_type -> google.protobuf.Empty - 52, // 52: vm.VM.GetLastStateSummary:input_type -> google.protobuf.Empty - 44, // 53: vm.VM.ParseStateSummary:input_type -> vm.ParseStateSummaryRequest - 46, // 54: vm.VM.GetStateSummary:input_type -> vm.GetStateSummaryRequest - 18, // 55: vm.VM.BlockVerify:input_type -> vm.BlockVerifyRequest - 20, // 56: vm.VM.BlockAccept:input_type -> vm.BlockAcceptRequest - 21, // 57: vm.VM.BlockReject:input_type -> vm.BlockRejectRequest - 48, // 58: vm.VM.StateSummaryAccept:input_type -> vm.StateSummaryAcceptRequest - 5, // 59: vm.VM.Initialize:output_type -> vm.InitializeResponse - 7, // 60: vm.VM.SetState:output_type -> vm.SetStateResponse - 52, // 61: vm.VM.Shutdown:output_type -> google.protobuf.Empty - 8, // 62: vm.VM.CreateHandlers:output_type -> vm.CreateHandlersResponse - 9, // 63: vm.VM.CreateStaticHandlers:output_type -> vm.CreateStaticHandlersResponse - 52, // 64: vm.VM.Connected:output_type -> google.protobuf.Empty - 52, // 65: vm.VM.Disconnected:output_type -> google.protobuf.Empty - 12, // 66: vm.VM.BuildBlock:output_type -> vm.BuildBlockResponse - 14, // 67: vm.VM.ParseBlock:output_type -> vm.ParseBlockResponse - 16, // 68: vm.VM.GetBlock:output_type -> vm.GetBlockResponse - 52, // 69: vm.VM.SetPreference:output_type -> google.protobuf.Empty - 22, // 70: vm.VM.Health:output_type -> vm.HealthResponse - 23, // 71: vm.VM.Version:output_type -> vm.VersionResponse - 52, // 72: vm.VM.AppRequest:output_type -> google.protobuf.Empty - 52, // 73: vm.VM.AppRequestFailed:output_type -> google.protobuf.Empty - 52, // 74: vm.VM.AppResponse:output_type -> google.protobuf.Empty - 52, // 75: vm.VM.AppGossip:output_type -> google.protobuf.Empty - 40, // 76: vm.VM.Gather:output_type -> vm.GatherResponse - 52, // 77: vm.VM.CrossChainAppRequest:output_type -> google.protobuf.Empty - 52, // 78: vm.VM.CrossChainAppRequestFailed:output_type -> google.protobuf.Empty - 52, // 79: vm.VM.CrossChainAppResponse:output_type -> google.protobuf.Empty - 34, // 80: vm.VM.GetAncestors:output_type -> vm.GetAncestorsResponse - 36, // 81: vm.VM.BatchedParseBlock:output_type -> vm.BatchedParseBlockResponse - 37, // 82: vm.VM.VerifyHeightIndex:output_type -> vm.VerifyHeightIndexResponse - 39, // 83: vm.VM.GetBlockIDAtHeight:output_type -> vm.GetBlockIDAtHeightResponse - 41, // 84: vm.VM.StateSyncEnabled:output_type -> vm.StateSyncEnabledResponse - 42, // 85: vm.VM.GetOngoingSyncStateSummary:output_type -> vm.GetOngoingSyncStateSummaryResponse - 43, // 86: vm.VM.GetLastStateSummary:output_type -> vm.GetLastStateSummaryResponse - 45, // 87: vm.VM.ParseStateSummary:output_type -> vm.ParseStateSummaryResponse - 47, // 88: vm.VM.GetStateSummary:output_type -> vm.GetStateSummaryResponse - 19, // 89: vm.VM.BlockVerify:output_type -> vm.BlockVerifyResponse - 52, // 90: vm.VM.BlockAccept:output_type -> google.protobuf.Empty - 52, // 91: vm.VM.BlockReject:output_type -> google.protobuf.Empty - 49, // 92: vm.VM.StateSummaryAccept:output_type -> vm.StateSummaryAcceptResponse - 59, // [59:93] is the sub-list for method output_type - 25, // [25:59] is the sub-list for method input_type - 25, // [25:25] is the sub-list for extension type_name - 25, // [25:25] is the sub-list for extension extendee - 0, // [0:25] is the sub-list for field type_name + 49, // 2: vm.SetStateResponse.timestamp:type_name -> google.protobuf.Timestamp + 9, // 3: vm.CreateHandlersResponse.handlers:type_name -> vm.Handler + 49, // 4: vm.BuildBlockResponse.timestamp:type_name -> google.protobuf.Timestamp + 1, // 5: vm.ParseBlockResponse.status:type_name -> vm.Status + 49, // 6: vm.ParseBlockResponse.timestamp:type_name -> google.protobuf.Timestamp + 1, // 7: vm.GetBlockResponse.status:type_name -> vm.Status + 49, // 8: vm.GetBlockResponse.timestamp:type_name -> google.protobuf.Timestamp + 2, // 9: vm.GetBlockResponse.err:type_name -> vm.Error + 49, // 10: vm.BlockVerifyResponse.timestamp:type_name -> google.protobuf.Timestamp + 49, // 11: vm.AppRequestMsg.deadline:type_name -> google.protobuf.Timestamp + 49, // 12: vm.CrossChainAppRequestMsg.deadline:type_name -> google.protobuf.Timestamp + 13, // 13: vm.BatchedParseBlockResponse.response:type_name -> vm.ParseBlockResponse + 2, // 14: vm.VerifyHeightIndexResponse.err:type_name -> vm.Error + 2, // 15: vm.GetBlockIDAtHeightResponse.err:type_name -> vm.Error + 50, // 16: vm.GatherResponse.metric_families:type_name -> io.prometheus.client.MetricFamily + 2, // 17: vm.StateSyncEnabledResponse.err:type_name -> vm.Error + 2, // 18: vm.GetOngoingSyncStateSummaryResponse.err:type_name -> vm.Error + 2, // 19: vm.GetLastStateSummaryResponse.err:type_name -> vm.Error + 2, // 20: vm.ParseStateSummaryResponse.err:type_name -> vm.Error + 2, // 21: vm.GetStateSummaryResponse.err:type_name -> vm.Error + 3, // 22: vm.StateSummaryAcceptResponse.mode:type_name -> vm.StateSummaryAcceptResponse.Mode + 2, // 23: vm.StateSummaryAcceptResponse.err:type_name -> vm.Error + 4, // 24: vm.VM.Initialize:input_type -> vm.InitializeRequest + 6, // 25: vm.VM.SetState:input_type -> vm.SetStateRequest + 51, // 26: vm.VM.Shutdown:input_type -> google.protobuf.Empty + 51, // 27: vm.VM.CreateHandlers:input_type -> google.protobuf.Empty + 30, // 28: vm.VM.Connected:input_type -> vm.ConnectedRequest + 31, // 29: vm.VM.Disconnected:input_type -> vm.DisconnectedRequest + 10, // 30: vm.VM.BuildBlock:input_type -> vm.BuildBlockRequest + 12, // 31: vm.VM.ParseBlock:input_type -> vm.ParseBlockRequest + 14, // 32: vm.VM.GetBlock:input_type -> vm.GetBlockRequest + 16, // 33: vm.VM.SetPreference:input_type -> vm.SetPreferenceRequest + 51, // 34: vm.VM.Health:input_type -> google.protobuf.Empty + 51, // 35: vm.VM.Version:input_type -> google.protobuf.Empty + 23, // 36: vm.VM.AppRequest:input_type -> vm.AppRequestMsg + 24, // 37: vm.VM.AppRequestFailed:input_type -> vm.AppRequestFailedMsg + 25, // 38: vm.VM.AppResponse:input_type -> vm.AppResponseMsg + 26, // 39: vm.VM.AppGossip:input_type -> vm.AppGossipMsg + 51, // 40: vm.VM.Gather:input_type -> google.protobuf.Empty + 27, // 41: vm.VM.CrossChainAppRequest:input_type -> vm.CrossChainAppRequestMsg + 28, // 42: vm.VM.CrossChainAppRequestFailed:input_type -> vm.CrossChainAppRequestFailedMsg + 29, // 43: vm.VM.CrossChainAppResponse:input_type -> vm.CrossChainAppResponseMsg + 32, // 44: vm.VM.GetAncestors:input_type -> vm.GetAncestorsRequest + 34, // 45: vm.VM.BatchedParseBlock:input_type -> vm.BatchedParseBlockRequest + 51, // 46: vm.VM.VerifyHeightIndex:input_type -> google.protobuf.Empty + 37, // 47: vm.VM.GetBlockIDAtHeight:input_type -> vm.GetBlockIDAtHeightRequest + 51, // 48: vm.VM.StateSyncEnabled:input_type -> google.protobuf.Empty + 51, // 49: vm.VM.GetOngoingSyncStateSummary:input_type -> google.protobuf.Empty + 51, // 50: vm.VM.GetLastStateSummary:input_type -> google.protobuf.Empty + 43, // 51: vm.VM.ParseStateSummary:input_type -> vm.ParseStateSummaryRequest + 45, // 52: vm.VM.GetStateSummary:input_type -> vm.GetStateSummaryRequest + 17, // 53: vm.VM.BlockVerify:input_type -> vm.BlockVerifyRequest + 19, // 54: vm.VM.BlockAccept:input_type -> vm.BlockAcceptRequest + 20, // 55: vm.VM.BlockReject:input_type -> vm.BlockRejectRequest + 47, // 56: vm.VM.StateSummaryAccept:input_type -> vm.StateSummaryAcceptRequest + 5, // 57: vm.VM.Initialize:output_type -> vm.InitializeResponse + 7, // 58: vm.VM.SetState:output_type -> vm.SetStateResponse + 51, // 59: vm.VM.Shutdown:output_type -> google.protobuf.Empty + 8, // 60: vm.VM.CreateHandlers:output_type -> vm.CreateHandlersResponse + 51, // 61: vm.VM.Connected:output_type -> google.protobuf.Empty + 51, // 62: vm.VM.Disconnected:output_type -> google.protobuf.Empty + 11, // 63: vm.VM.BuildBlock:output_type -> vm.BuildBlockResponse + 13, // 64: vm.VM.ParseBlock:output_type -> vm.ParseBlockResponse + 15, // 65: vm.VM.GetBlock:output_type -> vm.GetBlockResponse + 51, // 66: vm.VM.SetPreference:output_type -> google.protobuf.Empty + 21, // 67: vm.VM.Health:output_type -> vm.HealthResponse + 22, // 68: vm.VM.Version:output_type -> vm.VersionResponse + 51, // 69: vm.VM.AppRequest:output_type -> google.protobuf.Empty + 51, // 70: vm.VM.AppRequestFailed:output_type -> google.protobuf.Empty + 51, // 71: vm.VM.AppResponse:output_type -> google.protobuf.Empty + 51, // 72: vm.VM.AppGossip:output_type -> google.protobuf.Empty + 39, // 73: vm.VM.Gather:output_type -> vm.GatherResponse + 51, // 74: vm.VM.CrossChainAppRequest:output_type -> google.protobuf.Empty + 51, // 75: vm.VM.CrossChainAppRequestFailed:output_type -> google.protobuf.Empty + 51, // 76: vm.VM.CrossChainAppResponse:output_type -> google.protobuf.Empty + 33, // 77: vm.VM.GetAncestors:output_type -> vm.GetAncestorsResponse + 35, // 78: vm.VM.BatchedParseBlock:output_type -> vm.BatchedParseBlockResponse + 36, // 79: vm.VM.VerifyHeightIndex:output_type -> vm.VerifyHeightIndexResponse + 38, // 80: vm.VM.GetBlockIDAtHeight:output_type -> vm.GetBlockIDAtHeightResponse + 40, // 81: vm.VM.StateSyncEnabled:output_type -> vm.StateSyncEnabledResponse + 41, // 82: vm.VM.GetOngoingSyncStateSummary:output_type -> vm.GetOngoingSyncStateSummaryResponse + 42, // 83: vm.VM.GetLastStateSummary:output_type -> vm.GetLastStateSummaryResponse + 44, // 84: vm.VM.ParseStateSummary:output_type -> vm.ParseStateSummaryResponse + 46, // 85: vm.VM.GetStateSummary:output_type -> vm.GetStateSummaryResponse + 18, // 86: vm.VM.BlockVerify:output_type -> vm.BlockVerifyResponse + 51, // 87: vm.VM.BlockAccept:output_type -> google.protobuf.Empty + 51, // 88: vm.VM.BlockReject:output_type -> google.protobuf.Empty + 48, // 89: vm.VM.StateSummaryAccept:output_type -> vm.StateSummaryAcceptResponse + 57, // [57:90] is the sub-list for method output_type + 24, // [24:57] is the sub-list for method input_type + 24, // [24:24] is the sub-list for extension type_name + 24, // [24:24] is the sub-list for extension extendee + 0, // [0:24] is the sub-list for field type_name } func init() { file_vm_vm_proto_init() } @@ -3781,18 +3720,6 @@ func file_vm_vm_proto_init() { } } file_vm_vm_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateStaticHandlersResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_vm_vm_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Handler); i { case 0: return &v.state @@ -3804,7 +3731,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BuildBlockRequest); i { case 0: return &v.state @@ -3816,7 +3743,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BuildBlockResponse); i { case 0: return &v.state @@ -3828,7 +3755,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ParseBlockRequest); i { case 0: return &v.state @@ -3840,7 +3767,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ParseBlockResponse); i { case 0: return &v.state @@ -3852,7 +3779,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetBlockRequest); i { case 0: return &v.state @@ -3864,7 +3791,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetBlockResponse); i { case 0: return &v.state @@ -3876,7 +3803,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SetPreferenceRequest); i { case 0: return &v.state @@ -3888,7 +3815,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BlockVerifyRequest); i { case 0: return &v.state @@ -3900,7 +3827,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BlockVerifyResponse); i { case 0: return &v.state @@ -3912,7 +3839,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BlockAcceptRequest); i { case 0: return &v.state @@ -3924,7 +3851,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BlockRejectRequest); i { case 0: return &v.state @@ -3936,7 +3863,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*HealthResponse); i { case 0: return &v.state @@ -3948,7 +3875,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*VersionResponse); i { case 0: return &v.state @@ -3960,7 +3887,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AppRequestMsg); i { case 0: return &v.state @@ -3972,7 +3899,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AppRequestFailedMsg); i { case 0: return &v.state @@ -3984,7 +3911,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AppResponseMsg); i { case 0: return &v.state @@ -3996,7 +3923,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AppGossipMsg); i { case 0: return &v.state @@ -4008,7 +3935,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CrossChainAppRequestMsg); i { case 0: return &v.state @@ -4020,7 +3947,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CrossChainAppRequestFailedMsg); i { case 0: return &v.state @@ -4032,7 +3959,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CrossChainAppResponseMsg); i { case 0: return &v.state @@ -4044,7 +3971,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ConnectedRequest); i { case 0: return &v.state @@ -4056,7 +3983,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DisconnectedRequest); i { case 0: return &v.state @@ -4068,7 +3995,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetAncestorsRequest); i { case 0: return &v.state @@ -4080,7 +4007,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetAncestorsResponse); i { case 0: return &v.state @@ -4092,7 +4019,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BatchedParseBlockRequest); i { case 0: return &v.state @@ -4104,7 +4031,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BatchedParseBlockResponse); i { case 0: return &v.state @@ -4116,7 +4043,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*VerifyHeightIndexResponse); i { case 0: return &v.state @@ -4128,7 +4055,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetBlockIDAtHeightRequest); i { case 0: return &v.state @@ -4140,7 +4067,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetBlockIDAtHeightResponse); i { case 0: return &v.state @@ -4152,7 +4079,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GatherResponse); i { case 0: return &v.state @@ -4164,7 +4091,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StateSyncEnabledResponse); i { case 0: return &v.state @@ -4176,7 +4103,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetOngoingSyncStateSummaryResponse); i { case 0: return &v.state @@ -4188,7 +4115,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetLastStateSummaryResponse); i { case 0: return &v.state @@ -4200,7 +4127,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ParseStateSummaryRequest); i { case 0: return &v.state @@ -4212,7 +4139,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ParseStateSummaryResponse); i { case 0: return &v.state @@ -4224,7 +4151,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetStateSummaryRequest); i { case 0: return &v.state @@ -4236,7 +4163,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetStateSummaryResponse); i { case 0: return &v.state @@ -4248,7 +4175,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StateSummaryAcceptRequest); i { case 0: return &v.state @@ -4260,7 +4187,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StateSummaryAcceptResponse); i { case 0: return &v.state @@ -4273,15 +4200,15 @@ func file_vm_vm_proto_init() { } } } - file_vm_vm_proto_msgTypes[7].OneofWrappers = []interface{}{} - file_vm_vm_proto_msgTypes[14].OneofWrappers = []interface{}{} + file_vm_vm_proto_msgTypes[6].OneofWrappers = []interface{}{} + file_vm_vm_proto_msgTypes[13].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_vm_vm_proto_rawDesc, NumEnums: 4, - NumMessages: 46, + NumMessages: 45, NumExtensions: 0, NumServices: 1, }, diff --git a/proto/pb/vm/vm_grpc.pb.go b/proto/pb/vm/vm_grpc.pb.go index 917e04d25e96..6d7bb17f6c33 100644 --- a/proto/pb/vm/vm_grpc.pb.go +++ b/proto/pb/vm/vm_grpc.pb.go @@ -24,7 +24,6 @@ const ( VM_SetState_FullMethodName = "/vm.VM/SetState" VM_Shutdown_FullMethodName = "/vm.VM/Shutdown" VM_CreateHandlers_FullMethodName = "/vm.VM/CreateHandlers" - VM_CreateStaticHandlers_FullMethodName = "/vm.VM/CreateStaticHandlers" VM_Connected_FullMethodName = "/vm.VM/Connected" VM_Disconnected_FullMethodName = "/vm.VM/Disconnected" VM_BuildBlock_FullMethodName = "/vm.VM/BuildBlock" @@ -70,13 +69,6 @@ type VMClient interface { Shutdown(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) // Creates the HTTP handlers for custom chain network calls. CreateHandlers(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*CreateHandlersResponse, error) - // Creates the HTTP handlers for custom VM network calls. - // - // Note: RPC Chain VM Factory will start a new instance of the VM in a - // separate process which will populate the static handlers. After this - // process is created other processes will be created to populate blockchains, - // but they will not have the static handlers be called again. - CreateStaticHandlers(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*CreateStaticHandlersResponse, error) Connected(ctx context.Context, in *ConnectedRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) Disconnected(ctx context.Context, in *DisconnectedRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) // Attempt to create a new block from data contained in the VM. @@ -177,15 +169,6 @@ func (c *vMClient) CreateHandlers(ctx context.Context, in *emptypb.Empty, opts . return out, nil } -func (c *vMClient) CreateStaticHandlers(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*CreateStaticHandlersResponse, error) { - out := new(CreateStaticHandlersResponse) - err := c.cc.Invoke(ctx, VM_CreateStaticHandlers_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *vMClient) Connected(ctx context.Context, in *ConnectedRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) err := c.cc.Invoke(ctx, VM_Connected_FullMethodName, in, out, opts...) @@ -461,13 +444,6 @@ type VMServer interface { Shutdown(context.Context, *emptypb.Empty) (*emptypb.Empty, error) // Creates the HTTP handlers for custom chain network calls. CreateHandlers(context.Context, *emptypb.Empty) (*CreateHandlersResponse, error) - // Creates the HTTP handlers for custom VM network calls. - // - // Note: RPC Chain VM Factory will start a new instance of the VM in a - // separate process which will populate the static handlers. After this - // process is created other processes will be created to populate blockchains, - // but they will not have the static handlers be called again. - CreateStaticHandlers(context.Context, *emptypb.Empty) (*CreateStaticHandlersResponse, error) Connected(context.Context, *ConnectedRequest) (*emptypb.Empty, error) Disconnected(context.Context, *DisconnectedRequest) (*emptypb.Empty, error) // Attempt to create a new block from data contained in the VM. @@ -541,9 +517,6 @@ func (UnimplementedVMServer) Shutdown(context.Context, *emptypb.Empty) (*emptypb func (UnimplementedVMServer) CreateHandlers(context.Context, *emptypb.Empty) (*CreateHandlersResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateHandlers not implemented") } -func (UnimplementedVMServer) CreateStaticHandlers(context.Context, *emptypb.Empty) (*CreateStaticHandlersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateStaticHandlers not implemented") -} func (UnimplementedVMServer) Connected(context.Context, *ConnectedRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method Connected not implemented") } @@ -716,24 +689,6 @@ func _VM_CreateHandlers_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } -func _VM_CreateStaticHandlers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(emptypb.Empty) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(VMServer).CreateStaticHandlers(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: VM_CreateStaticHandlers_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(VMServer).CreateStaticHandlers(ctx, req.(*emptypb.Empty)) - } - return interceptor(ctx, in, info, handler) -} - func _VM_Connected_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ConnectedRequest) if err := dec(in); err != nil { @@ -1279,10 +1234,6 @@ var VM_ServiceDesc = grpc.ServiceDesc{ MethodName: "CreateHandlers", Handler: _VM_CreateHandlers_Handler, }, - { - MethodName: "CreateStaticHandlers", - Handler: _VM_CreateStaticHandlers_Handler, - }, { MethodName: "Connected", Handler: _VM_Connected_Handler, diff --git a/proto/vm/vm.proto b/proto/vm/vm.proto index ff50de1eb6cb..4a0557ba4e67 100644 --- a/proto/vm/vm.proto +++ b/proto/vm/vm.proto @@ -21,13 +21,6 @@ service VM { rpc Shutdown(google.protobuf.Empty) returns (google.protobuf.Empty); // Creates the HTTP handlers for custom chain network calls. rpc CreateHandlers(google.protobuf.Empty) returns (CreateHandlersResponse); - // Creates the HTTP handlers for custom VM network calls. - // - // Note: RPC Chain VM Factory will start a new instance of the VM in a - // separate process which will populate the static handlers. After this - // process is created other processes will be created to populate blockchains, - // but they will not have the static handlers be called again. - rpc CreateStaticHandlers(google.protobuf.Empty) returns (CreateStaticHandlersResponse); rpc Connected(ConnectedRequest) returns (google.protobuf.Empty); rpc Disconnected(DisconnectedRequest) returns (google.protobuf.Empty); // Attempt to create a new block from data contained in the VM. @@ -158,10 +151,6 @@ message CreateHandlersResponse { repeated Handler handlers = 1; } -message CreateStaticHandlersResponse { - repeated Handler handlers = 1; -} - message Handler { string prefix = 1; // server_addr is the address of the gRPC server which serves the diff --git a/scripts/mocks.mockgen.txt b/scripts/mocks.mockgen.txt index 84c44c2966e6..ba2be886b0b6 100644 --- a/scripts/mocks.mockgen.txt +++ b/scripts/mocks.mockgen.txt @@ -38,7 +38,6 @@ github.com/ava-labs/avalanchego/vms/proposervm/scheduler=Scheduler=vms/proposerv github.com/ava-labs/avalanchego/vms/proposervm/state=State=vms/proposervm/state/mock_state.go github.com/ava-labs/avalanchego/vms/proposervm=PostForkBlock=vms/proposervm/mock_post_fork_block.go github.com/ava-labs/avalanchego/vms/registry=VMGetter=vms/registry/mock_vm_getter.go -github.com/ava-labs/avalanchego/vms/registry=VMRegisterer=vms/registry/mock_vm_registerer.go github.com/ava-labs/avalanchego/vms/registry=VMRegistry=vms/registry/mock_vm_registry.go github.com/ava-labs/avalanchego/vms=Factory,Manager=vms/mock_manager.go github.com/ava-labs/avalanchego/x/sync=Client=x/sync/mock_client.go diff --git a/snow/engine/avalanche/vertex/mock_vm.go b/snow/engine/avalanche/vertex/mock_vm.go index b0c4362b4551..c1b67c7421c6 100644 --- a/snow/engine/avalanche/vertex/mock_vm.go +++ b/snow/engine/avalanche/vertex/mock_vm.go @@ -143,21 +143,6 @@ func (mr *MockLinearizableVMMockRecorder) CreateHandlers(arg0 interface{}) *gomo return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateHandlers", reflect.TypeOf((*MockLinearizableVM)(nil).CreateHandlers), arg0) } -// CreateStaticHandlers mocks base method. -func (m *MockLinearizableVM) CreateStaticHandlers(arg0 context.Context) (map[string]http.Handler, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "CreateStaticHandlers", arg0) - ret0, _ := ret[0].(map[string]http.Handler) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// CreateStaticHandlers indicates an expected call of CreateStaticHandlers. -func (mr *MockLinearizableVMMockRecorder) CreateStaticHandlers(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateStaticHandlers", reflect.TypeOf((*MockLinearizableVM)(nil).CreateStaticHandlers), arg0) -} - // CrossChainAppRequest mocks base method. func (m *MockLinearizableVM) CrossChainAppRequest(arg0 context.Context, arg1 ids.ID, arg2 uint32, arg3 time.Time, arg4 []byte) error { m.ctrl.T.Helper() diff --git a/snow/engine/common/test_vm.go b/snow/engine/common/test_vm.go index b576e8e389c7..828b49f5e1fe 100644 --- a/snow/engine/common/test_vm.go +++ b/snow/engine/common/test_vm.go @@ -23,7 +23,6 @@ var ( errSetState = errors.New("unexpectedly called SetState") errShutdown = errors.New("unexpectedly called Shutdown") errCreateHandlers = errors.New("unexpectedly called CreateHandlers") - errCreateStaticHandlers = errors.New("unexpectedly called CreateStaticHandlers") errHealthCheck = errors.New("unexpectedly called HealthCheck") errConnected = errors.New("unexpectedly called Connected") errDisconnected = errors.New("unexpectedly called Disconnected") @@ -44,7 +43,7 @@ type TestVM struct { T *testing.T CantInitialize, CantSetState, - CantShutdown, CantCreateHandlers, CantCreateStaticHandlers, + CantShutdown, CantCreateHandlers, CantHealthCheck, CantConnected, CantDisconnected, CantVersion, CantAppRequest, CantAppResponse, CantAppGossip, CantAppRequestFailed, CantCrossChainAppRequest, CantCrossChainAppResponse, CantCrossChainAppRequestFailed bool @@ -53,7 +52,6 @@ type TestVM struct { SetStateF func(ctx context.Context, state snow.State) error ShutdownF func(context.Context) error CreateHandlersF func(context.Context) (map[string]http.Handler, error) - CreateStaticHandlersF func(context.Context) (map[string]http.Handler, error) ConnectedF func(ctx context.Context, nodeID ids.NodeID, nodeVersion *version.Application) error DisconnectedF func(ctx context.Context, nodeID ids.NodeID) error HealthCheckF func(context.Context) (interface{}, error) @@ -72,7 +70,6 @@ func (vm *TestVM) Default(cant bool) { vm.CantSetState = cant vm.CantShutdown = cant vm.CantCreateHandlers = cant - vm.CantCreateStaticHandlers = cant vm.CantHealthCheck = cant vm.CantAppRequest = cant vm.CantAppRequestFailed = cant @@ -152,16 +149,6 @@ func (vm *TestVM) CreateHandlers(ctx context.Context) (map[string]http.Handler, return nil, nil } -func (vm *TestVM) CreateStaticHandlers(ctx context.Context) (map[string]http.Handler, error) { - if vm.CreateStaticHandlersF != nil { - return vm.CreateStaticHandlersF(ctx) - } - if vm.CantCreateStaticHandlers && vm.T != nil { - require.FailNow(vm.T, errCreateStaticHandlers.Error()) - } - return nil, nil -} - func (vm *TestVM) HealthCheck(ctx context.Context) (interface{}, error) { if vm.HealthCheckF != nil { return vm.HealthCheckF(ctx) diff --git a/snow/engine/common/vm.go b/snow/engine/common/vm.go index dc201c95602f..65cbfb158656 100644 --- a/snow/engine/common/vm.go +++ b/snow/engine/common/vm.go @@ -65,23 +65,6 @@ type VM interface { // Version returns the version of the VM. Version(context.Context) (string, error) - // Creates the HTTP handlers for custom VM network calls. - // - // This exposes handlers that the outside world can use to communicate with - // a static reference to the VM. Each handler has the path: - // [Address of node]/ext/VM/[VM ID]/[extension] - // - // Returns a mapping from [extension]s to HTTP handlers. - // - // For example, it might make sense to have an extension for creating - // genesis bytes this VM can interpret. - // - // Note: If this method is called, no other method will be called on this VM. - // Each registered VM will have a single instance created to handle static - // APIs. This instance will be handled separately from instances created to - // service an instance of a chain. - CreateStaticHandlers(context.Context) (map[string]http.Handler, error) - // Creates the HTTP handlers for custom chain network calls. // // This exposes handlers that the outside world can use to communicate with diff --git a/snow/engine/snowman/block/mock_chain_vm.go b/snow/engine/snowman/block/mock_chain_vm.go index 27b6aef75ed6..8cb9acb75ed0 100644 --- a/snow/engine/snowman/block/mock_chain_vm.go +++ b/snow/engine/snowman/block/mock_chain_vm.go @@ -142,21 +142,6 @@ func (mr *MockChainVMMockRecorder) CreateHandlers(arg0 interface{}) *gomock.Call return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateHandlers", reflect.TypeOf((*MockChainVM)(nil).CreateHandlers), arg0) } -// CreateStaticHandlers mocks base method. -func (m *MockChainVM) CreateStaticHandlers(arg0 context.Context) (map[string]http.Handler, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "CreateStaticHandlers", arg0) - ret0, _ := ret[0].(map[string]http.Handler) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// CreateStaticHandlers indicates an expected call of CreateStaticHandlers. -func (mr *MockChainVMMockRecorder) CreateStaticHandlers(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateStaticHandlers", reflect.TypeOf((*MockChainVM)(nil).CreateStaticHandlers), arg0) -} - // CrossChainAppRequest mocks base method. func (m *MockChainVM) CrossChainAppRequest(arg0 context.Context, arg1 ids.ID, arg2 uint32, arg3 time.Time, arg4 []byte) error { m.ctrl.T.Helper() diff --git a/tests/e2e/e2e_test.go b/tests/e2e/e2e_test.go index 7b9677dd7fc9..aec783441e80 100644 --- a/tests/e2e/e2e_test.go +++ b/tests/e2e/e2e_test.go @@ -17,7 +17,6 @@ import ( _ "github.com/ava-labs/avalanchego/tests/e2e/c" _ "github.com/ava-labs/avalanchego/tests/e2e/faultinjection" _ "github.com/ava-labs/avalanchego/tests/e2e/p" - _ "github.com/ava-labs/avalanchego/tests/e2e/static-handlers" _ "github.com/ava-labs/avalanchego/tests/e2e/x" _ "github.com/ava-labs/avalanchego/tests/e2e/x/transfer" ) diff --git a/tests/e2e/static-handlers/suites.go b/tests/e2e/static-handlers/suites.go deleted file mode 100644 index e18f16adaebf..000000000000 --- a/tests/e2e/static-handlers/suites.go +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - -// Implements static handlers tests for avm and platformvm -package statichandlers - -import ( - "time" - - ginkgo "github.com/onsi/ginkgo/v2" - - "github.com/stretchr/testify/require" - - "github.com/ava-labs/avalanchego/ids" - "github.com/ava-labs/avalanchego/tests/fixture/e2e" - "github.com/ava-labs/avalanchego/utils/constants" - "github.com/ava-labs/avalanchego/utils/crypto/secp256k1" - "github.com/ava-labs/avalanchego/utils/formatting" - "github.com/ava-labs/avalanchego/utils/formatting/address" - "github.com/ava-labs/avalanchego/utils/json" - "github.com/ava-labs/avalanchego/utils/units" - "github.com/ava-labs/avalanchego/vms/avm" - "github.com/ava-labs/avalanchego/vms/platformvm/api" - "github.com/ava-labs/avalanchego/vms/platformvm/reward" -) - -var _ = ginkgo.Describe("[StaticHandlers]", func() { - require := require.New(ginkgo.GinkgoT()) - - ginkgo.It("can make calls to avm static api", - func() { - addrMap := map[string]string{} - for _, addrStr := range []string{ - "A9bTQjfYGBFK3JPRJqF2eh3JYL7cHocvy", - "6mxBGnjGDCKgkVe7yfrmvMA7xE7qCv3vv", - "6ncQ19Q2U4MamkCYzshhD8XFjfwAWFzTa", - "Jz9ayEDt7dx9hDx45aXALujWmL9ZUuqe7", - } { - addr, err := ids.ShortFromString(addrStr) - require.NoError(err) - addrMap[addrStr], err = address.FormatBech32(constants.NetworkIDToHRP[constants.LocalID], addr[:]) - require.NoError(err) - } - avmArgs := avm.BuildGenesisArgs{ - Encoding: formatting.Hex, - GenesisData: map[string]avm.AssetDefinition{ - "asset1": { - Name: "myFixedCapAsset", - Symbol: "MFCA", - Denomination: 8, - InitialState: map[string][]interface{}{ - "fixedCap": { - avm.Holder{ - Amount: 100000, - Address: addrMap["A9bTQjfYGBFK3JPRJqF2eh3JYL7cHocvy"], - }, - avm.Holder{ - Amount: 100000, - Address: addrMap["6mxBGnjGDCKgkVe7yfrmvMA7xE7qCv3vv"], - }, - avm.Holder{ - Amount: json.Uint64(50000), - Address: addrMap["6ncQ19Q2U4MamkCYzshhD8XFjfwAWFzTa"], - }, - avm.Holder{ - Amount: json.Uint64(50000), - Address: addrMap["Jz9ayEDt7dx9hDx45aXALujWmL9ZUuqe7"], - }, - }, - }, - }, - "asset2": { - Name: "myVarCapAsset", - Symbol: "MVCA", - InitialState: map[string][]interface{}{ - "variableCap": { - avm.Owners{ - Threshold: 1, - Minters: []string{ - addrMap["A9bTQjfYGBFK3JPRJqF2eh3JYL7cHocvy"], - addrMap["6mxBGnjGDCKgkVe7yfrmvMA7xE7qCv3vv"], - }, - }, - avm.Owners{ - Threshold: 2, - Minters: []string{ - addrMap["6ncQ19Q2U4MamkCYzshhD8XFjfwAWFzTa"], - addrMap["Jz9ayEDt7dx9hDx45aXALujWmL9ZUuqe7"], - }, - }, - }, - }, - }, - "asset3": { - Name: "myOtherVarCapAsset", - InitialState: map[string][]interface{}{ - "variableCap": { - avm.Owners{ - Threshold: 1, - Minters: []string{ - addrMap["A9bTQjfYGBFK3JPRJqF2eh3JYL7cHocvy"], - }, - }, - }, - }, - }, - }, - } - staticClient := avm.NewStaticClient(e2e.Env.GetRandomNodeURI().URI) - resp, err := staticClient.BuildGenesis(e2e.DefaultContext(), &avmArgs) - require.NoError(err) - require.Equal(resp.Bytes, "0x0000000000030006617373657431000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f6d794669786564436170417373657400044d4643410800000001000000000000000400000007000000000000c350000000000000000000000001000000013f78e510df62bc48b0829ec06d6a6b98062d695300000007000000000000c35000000000000000000000000100000001c54903de5177a16f7811771ef2f4659d9e8646710000000700000000000186a0000000000000000000000001000000013f58fda2e9ea8d9e4b181832a07b26dae286f2cb0000000700000000000186a000000000000000000000000100000001645938bb7ae2193270e6ffef009e3664d11e07c10006617373657432000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d6d79566172436170417373657400044d5643410000000001000000000000000200000006000000000000000000000001000000023f58fda2e9ea8d9e4b181832a07b26dae286f2cb645938bb7ae2193270e6ffef009e3664d11e07c100000006000000000000000000000001000000023f78e510df62bc48b0829ec06d6a6b98062d6953c54903de5177a16f7811771ef2f4659d9e864671000661737365743300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000126d794f7468657256617243617041737365740000000000000100000000000000010000000600000000000000000000000100000001645938bb7ae2193270e6ffef009e3664d11e07c1279fa028") - }) - - ginkgo.It("can make calls to platformvm static api", func() { - keys := secp256k1.TestKeys() - - genesisUTXOs := make([]api.UTXO, len(keys)) - hrp := constants.NetworkIDToHRP[constants.UnitTestID] - for i, key := range keys { - id := key.PublicKey().Address() - addr, err := address.FormatBech32(hrp, id.Bytes()) - require.NoError(err) - genesisUTXOs[i] = api.UTXO{ - Amount: json.Uint64(50000 * units.MilliAvax), - Address: addr, - } - } - - genesisValidators := make([]api.GenesisPermissionlessValidator, len(keys)) - for i, key := range keys { - id := key.PublicKey().Address() - addr, err := address.FormatBech32(hrp, id.Bytes()) - require.NoError(err) - genesisValidators[i] = api.GenesisPermissionlessValidator{ - GenesisValidator: api.GenesisValidator{ - StartTime: json.Uint64(time.Date(1997, 1, 1, 0, 0, 0, 0, time.UTC).Unix()), - EndTime: json.Uint64(time.Date(1997, 1, 30, 0, 0, 0, 0, time.UTC).Unix()), - NodeID: ids.BuildTestNodeID(id[:]), - }, - RewardOwner: &api.Owner{ - Threshold: 1, - Addresses: []string{addr}, - }, - Staked: []api.UTXO{{ - Amount: json.Uint64(10000), - Address: addr, - }}, - DelegationFee: reward.PercentDenominator, - } - } - - buildGenesisArgs := api.BuildGenesisArgs{ - NetworkID: json.Uint32(constants.UnitTestID), - AvaxAssetID: ids.ID{'a', 'v', 'a', 'x'}, - UTXOs: genesisUTXOs, - Validators: genesisValidators, - Chains: nil, - Time: json.Uint64(time.Date(1997, 1, 1, 0, 0, 0, 0, time.UTC).Unix()), - InitialSupply: json.Uint64(360 * units.MegaAvax), - Encoding: formatting.Hex, - } - - staticClient := api.NewStaticClient(e2e.Env.GetRandomNodeURI().URI) - resp, err := staticClient.BuildGenesis(e2e.DefaultContext(), &buildGenesisArgs) - require.NoError(err) - require.Equal(resp.Bytes, "0x0000000000050000000000000000000000000000000000000000000000000000000000000000000000006176617800000000000000000000000000000000000000000000000000000000000000070000000ba43b740000000000000000000000000100000001fceda8f90fcb5d30614b99d79fc4baa293077626000000000000000000000000000000000000000000000000000000000000000000000000000000016176617800000000000000000000000000000000000000000000000000000000000000070000000ba43b7400000000000000000000000001000000016ead693c17abb1be422bb50b30b9711ff98d667e000000000000000000000000000000000000000000000000000000000000000000000000000000026176617800000000000000000000000000000000000000000000000000000000000000070000000ba43b740000000000000000000000000100000001f2420846876e69f473dda256172967e992f0ee31000000000000000000000000000000000000000000000000000000000000000000000000000000036176617800000000000000000000000000000000000000000000000000000000000000070000000ba43b7400000000000000000000000001000000013cb7d3842e8cee6a0ebd09f1fe884f6861e1b29c000000000000000000000000000000000000000000000000000000000000000000000000000000046176617800000000000000000000000000000000000000000000000000000000000000070000000ba43b74000000000000000000000000010000000187c4ec0736fdad03fd9ec8c3ba609de958601a7b00000000000000050000000c0000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fceda8f90fcb5d30614b99d79fc4baa2930776260000000032c9a9000000000032efe480000000000000271000000001617661780000000000000000000000000000000000000000000000000000000000000007000000000000271000000000000000000000000100000001fceda8f90fcb5d30614b99d79fc4baa2930776260000000b00000000000000000000000100000001fceda8f90fcb5d30614b99d79fc4baa29307762600000000000000000000000c0000000a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000006ead693c17abb1be422bb50b30b9711ff98d667e0000000032c9a9000000000032efe4800000000000002710000000016176617800000000000000000000000000000000000000000000000000000000000000070000000000002710000000000000000000000001000000016ead693c17abb1be422bb50b30b9711ff98d667e0000000b000000000000000000000001000000016ead693c17abb1be422bb50b30b9711ff98d667e00000000000000000000000c0000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f2420846876e69f473dda256172967e992f0ee310000000032c9a9000000000032efe480000000000000271000000001617661780000000000000000000000000000000000000000000000000000000000000007000000000000271000000000000000000000000100000001f2420846876e69f473dda256172967e992f0ee310000000b00000000000000000000000100000001f2420846876e69f473dda256172967e992f0ee3100000000000000000000000c0000000a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000003cb7d3842e8cee6a0ebd09f1fe884f6861e1b29c0000000032c9a9000000000032efe4800000000000002710000000016176617800000000000000000000000000000000000000000000000000000000000000070000000000002710000000000000000000000001000000013cb7d3842e8cee6a0ebd09f1fe884f6861e1b29c0000000b000000000000000000000001000000013cb7d3842e8cee6a0ebd09f1fe884f6861e1b29c00000000000000000000000c0000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000087c4ec0736fdad03fd9ec8c3ba609de958601a7b0000000032c9a9000000000032efe48000000000000027100000000161766178000000000000000000000000000000000000000000000000000000000000000700000000000027100000000000000000000000010000000187c4ec0736fdad03fd9ec8c3ba609de958601a7b0000000b0000000000000000000000010000000187c4ec0736fdad03fd9ec8c3ba609de958601a7b0000000000000000000000000000000032c9a90004fefa17b724000000008e96cbef") - }) -}) diff --git a/utils/constants/aliases.go b/utils/constants/aliases.go index 494165019688..dd8388246d39 100644 --- a/utils/constants/aliases.go +++ b/utils/constants/aliases.go @@ -3,10 +3,5 @@ package constants -const ( - // ChainAliasPrefix denotes a prefix for an alias that belongs to a blockchain ID. - ChainAliasPrefix string = "bc" - - // VMAliasPrefix denotes a prefix for an alias that belongs to a VM ID. - VMAliasPrefix string = "vm" -) +// ChainAliasPrefix denotes a prefix for an alias that belongs to a blockchain ID. +const ChainAliasPrefix string = "bc" diff --git a/vms/avm/static_client.go b/vms/avm/static_client.go deleted file mode 100644 index f31634313aac..000000000000 --- a/vms/avm/static_client.go +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - -package avm - -import ( - "context" - - "github.com/ava-labs/avalanchego/utils/rpc" -) - -var _ StaticClient = (*staticClient)(nil) - -// StaticClient for interacting with the AVM static api -type StaticClient interface { - BuildGenesis(ctx context.Context, args *BuildGenesisArgs, options ...rpc.Option) (*BuildGenesisReply, error) -} - -// staticClient is an implementation of an AVM client for interacting with the -// avm static api -type staticClient struct { - requester rpc.EndpointRequester -} - -// NewClient returns an AVM client for interacting with the avm static api -func NewStaticClient(uri string) StaticClient { - return &staticClient{requester: rpc.NewEndpointRequester( - uri + "/ext/vm/avm", - )} -} - -func (c *staticClient) BuildGenesis(ctx context.Context, args *BuildGenesisArgs, options ...rpc.Option) (resp *BuildGenesisReply, err error) { - resp = &BuildGenesisReply{} - err = c.requester.SendRequest(ctx, "avm.buildGenesis", args, resp, options...) - return resp, err -} diff --git a/vms/avm/static_service_test.go b/vms/avm/static_service_test.go deleted file mode 100644 index d5bd645190a2..000000000000 --- a/vms/avm/static_service_test.go +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - -package avm - -import ( - "testing" - - "github.com/stretchr/testify/require" - - "github.com/ava-labs/avalanchego/ids" - "github.com/ava-labs/avalanchego/utils/constants" - "github.com/ava-labs/avalanchego/utils/formatting" - "github.com/ava-labs/avalanchego/utils/formatting/address" - "github.com/ava-labs/avalanchego/utils/json" -) - -var addrStrArray = []string{ - "A9bTQjfYGBFK3JPRJqF2eh3JYL7cHocvy", - "6mxBGnjGDCKgkVe7yfrmvMA7xE7qCv3vv", - "6ncQ19Q2U4MamkCYzshhD8XFjfwAWFzTa", - "Jz9ayEDt7dx9hDx45aXALujWmL9ZUuqe7", -} - -func TestBuildGenesis(t *testing.T) { - require := require.New(t) - - ss := CreateStaticService() - addrMap := map[string]string{} - for _, addrStr := range addrStrArray { - addr, err := ids.ShortFromString(addrStr) - require.NoError(err) - addrMap[addrStr], err = address.FormatBech32(constants.UnitTestHRP, addr[:]) - require.NoError(err) - } - args := BuildGenesisArgs{ - Encoding: formatting.Hex, - GenesisData: map[string]AssetDefinition{ - "asset1": { - Name: "myFixedCapAsset", - Symbol: "MFCA", - Denomination: 8, - InitialState: map[string][]interface{}{ - "fixedCap": { - Holder{ - Amount: 100000, - Address: addrMap["A9bTQjfYGBFK3JPRJqF2eh3JYL7cHocvy"], - }, - Holder{ - Amount: 100000, - Address: addrMap["6mxBGnjGDCKgkVe7yfrmvMA7xE7qCv3vv"], - }, - Holder{ - Amount: json.Uint64(startBalance), - Address: addrMap["6ncQ19Q2U4MamkCYzshhD8XFjfwAWFzTa"], - }, - Holder{ - Amount: json.Uint64(startBalance), - Address: addrMap["Jz9ayEDt7dx9hDx45aXALujWmL9ZUuqe7"], - }, - }, - }, - }, - "asset2": { - Name: "myVarCapAsset", - Symbol: "MVCA", - InitialState: map[string][]interface{}{ - "variableCap": { - Owners{ - Threshold: 1, - Minters: []string{ - addrMap["A9bTQjfYGBFK3JPRJqF2eh3JYL7cHocvy"], - addrMap["6mxBGnjGDCKgkVe7yfrmvMA7xE7qCv3vv"], - }, - }, - Owners{ - Threshold: 2, - Minters: []string{ - addrMap["6ncQ19Q2U4MamkCYzshhD8XFjfwAWFzTa"], - addrMap["Jz9ayEDt7dx9hDx45aXALujWmL9ZUuqe7"], - }, - }, - }, - }, - }, - "asset3": { - Name: "myOtherVarCapAsset", - InitialState: map[string][]interface{}{ - "variableCap": { - Owners{ - Threshold: 1, - Minters: []string{ - addrMap["A9bTQjfYGBFK3JPRJqF2eh3JYL7cHocvy"], - }, - }, - }, - }, - }, - }, - } - reply := BuildGenesisReply{} - require.NoError(ss.BuildGenesis(nil, &args, &reply)) -} diff --git a/vms/avm/vm.go b/vms/avm/vm.go index 59907c934e91..2b3577082813 100644 --- a/vms/avm/vm.go +++ b/vms/avm/vm.go @@ -362,17 +362,6 @@ func (vm *VM) CreateHandlers(context.Context) (map[string]http.Handler, error) { }, err } -func (*VM) CreateStaticHandlers(context.Context) (map[string]http.Handler, error) { - server := rpc.NewServer() - codec := json.NewCodec() - server.RegisterCodec(codec, "application/json") - server.RegisterCodec(codec, "application/json;charset=UTF-8") - staticService := CreateStaticService() - return map[string]http.Handler{ - "": server, - }, server.RegisterService(staticService, "avm") -} - /* ****************************************************************************** ********************************** Chain VM ********************************** diff --git a/vms/example/xsvm/vm.go b/vms/example/xsvm/vm.go index b69360f838d7..f090ff468fe2 100644 --- a/vms/example/xsvm/vm.go +++ b/vms/example/xsvm/vm.go @@ -112,10 +112,6 @@ func (*VM) Version(context.Context) (string, error) { return Version.String(), nil } -func (*VM) CreateStaticHandlers(context.Context) (map[string]http.Handler, error) { - return nil, nil -} - func (vm *VM) CreateHandlers(context.Context) (map[string]http.Handler, error) { server := rpc.NewServer() server.RegisterCodec(json.NewCodec(), "application/json") diff --git a/vms/platformvm/api/static_client.go b/vms/platformvm/api/static_client.go deleted file mode 100644 index c10943fe19d9..000000000000 --- a/vms/platformvm/api/static_client.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - -package api - -import ( - "context" - - "github.com/ava-labs/avalanchego/utils/rpc" -) - -var _ StaticClient = (*staticClient)(nil) - -// StaticClient for interacting with the platformvm static api -type StaticClient interface { - BuildGenesis( - ctx context.Context, - args *BuildGenesisArgs, - options ...rpc.Option, - ) (*BuildGenesisReply, error) -} - -// staticClient is an implementation of a platformvm client for interacting with -// the platformvm static api -type staticClient struct { - requester rpc.EndpointRequester -} - -// NewClient returns a platformvm client for interacting with the platformvm static api -func NewStaticClient(uri string) StaticClient { - return &staticClient{requester: rpc.NewEndpointRequester( - uri + "/ext/vm/platform", - )} -} - -func (c *staticClient) BuildGenesis( - ctx context.Context, - args *BuildGenesisArgs, - options ...rpc.Option, -) (resp *BuildGenesisReply, err error) { - resp = &BuildGenesisReply{} - err = c.requester.SendRequest(ctx, "platform.buildGenesis", args, resp, options...) - return resp, err -} diff --git a/vms/platformvm/vm.go b/vms/platformvm/vm.go index 33053aef97f7..746826666c6d 100644 --- a/vms/platformvm/vm.go +++ b/vms/platformvm/vm.go @@ -35,7 +35,6 @@ import ( "github.com/ava-labs/avalanchego/utils/timer/mockable" "github.com/ava-labs/avalanchego/version" "github.com/ava-labs/avalanchego/vms/components/avax" - "github.com/ava-labs/avalanchego/vms/platformvm/api" "github.com/ava-labs/avalanchego/vms/platformvm/block" "github.com/ava-labs/avalanchego/vms/platformvm/config" "github.com/ava-labs/avalanchego/vms/platformvm/fx" @@ -508,18 +507,6 @@ func (vm *VM) CreateHandlers(context.Context) (map[string]http.Handler, error) { }, err } -// CreateStaticHandlers returns a map where: -// * keys are API endpoint extensions -// * values are API handlers -func (*VM) CreateStaticHandlers(context.Context) (map[string]http.Handler, error) { - server := rpc.NewServer() - server.RegisterCodec(json.NewCodec(), "application/json") - server.RegisterCodec(json.NewCodec(), "application/json;charset=UTF-8") - return map[string]http.Handler{ - "": server, - }, server.RegisterService(&api.StaticService{}, "platform") -} - func (vm *VM) Connected(_ context.Context, nodeID ids.NodeID, _ *version.Application) error { return vm.uptimeManager.Connect(nodeID, constants.PrimaryNetworkID) } diff --git a/vms/registry/mock_vm_registerer.go b/vms/registry/mock_vm_registerer.go deleted file mode 100644 index dbddd9ec02c3..000000000000 --- a/vms/registry/mock_vm_registerer.go +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: github.com/ava-labs/avalanchego/vms/registry (interfaces: VMRegisterer) - -// Package registry is a generated GoMock package. -package registry - -import ( - context "context" - reflect "reflect" - - ids "github.com/ava-labs/avalanchego/ids" - vms "github.com/ava-labs/avalanchego/vms" - gomock "go.uber.org/mock/gomock" -) - -// MockVMRegisterer is a mock of VMRegisterer interface. -type MockVMRegisterer struct { - ctrl *gomock.Controller - recorder *MockVMRegistererMockRecorder -} - -// MockVMRegistererMockRecorder is the mock recorder for MockVMRegisterer. -type MockVMRegistererMockRecorder struct { - mock *MockVMRegisterer -} - -// NewMockVMRegisterer creates a new mock instance. -func NewMockVMRegisterer(ctrl *gomock.Controller) *MockVMRegisterer { - mock := &MockVMRegisterer{ctrl: ctrl} - mock.recorder = &MockVMRegistererMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockVMRegisterer) EXPECT() *MockVMRegistererMockRecorder { - return m.recorder -} - -// Register mocks base method. -func (m *MockVMRegisterer) Register(arg0 context.Context, arg1 ids.ID, arg2 vms.Factory) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Register", arg0, arg1, arg2) - ret0, _ := ret[0].(error) - return ret0 -} - -// Register indicates an expected call of Register. -func (mr *MockVMRegistererMockRecorder) Register(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Register", reflect.TypeOf((*MockVMRegisterer)(nil).Register), arg0, arg1, arg2) -} - -// RegisterWithReadLock mocks base method. -func (m *MockVMRegisterer) RegisterWithReadLock(arg0 context.Context, arg1 ids.ID, arg2 vms.Factory) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "RegisterWithReadLock", arg0, arg1, arg2) - ret0, _ := ret[0].(error) - return ret0 -} - -// RegisterWithReadLock indicates an expected call of RegisterWithReadLock. -func (mr *MockVMRegistererMockRecorder) RegisterWithReadLock(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterWithReadLock", reflect.TypeOf((*MockVMRegisterer)(nil).RegisterWithReadLock), arg0, arg1, arg2) -} diff --git a/vms/registry/mock_vm_registry.go b/vms/registry/mock_vm_registry.go index eb54c8e65aab..4febab38fc5e 100644 --- a/vms/registry/mock_vm_registry.go +++ b/vms/registry/mock_vm_registry.go @@ -50,19 +50,3 @@ func (mr *MockVMRegistryMockRecorder) Reload(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Reload", reflect.TypeOf((*MockVMRegistry)(nil).Reload), arg0) } - -// ReloadWithReadLock mocks base method. -func (m *MockVMRegistry) ReloadWithReadLock(arg0 context.Context) ([]ids.ID, map[ids.ID]error, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ReloadWithReadLock", arg0) - ret0, _ := ret[0].([]ids.ID) - ret1, _ := ret[1].(map[ids.ID]error) - ret2, _ := ret[2].(error) - return ret0, ret1, ret2 -} - -// ReloadWithReadLock indicates an expected call of ReloadWithReadLock. -func (mr *MockVMRegistryMockRecorder) ReloadWithReadLock(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReloadWithReadLock", reflect.TypeOf((*MockVMRegistry)(nil).ReloadWithReadLock), arg0) -} diff --git a/vms/registry/vm_registerer.go b/vms/registry/vm_registerer.go deleted file mode 100644 index fec5fba78f57..000000000000 --- a/vms/registry/vm_registerer.go +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - -package registry - -import ( - "context" - "errors" - "fmt" - "net/http" - "path" - - "go.uber.org/zap" - - "github.com/ava-labs/avalanchego/api/server" - "github.com/ava-labs/avalanchego/ids" - "github.com/ava-labs/avalanchego/snow/engine/common" - "github.com/ava-labs/avalanchego/utils/constants" - "github.com/ava-labs/avalanchego/utils/logging" - "github.com/ava-labs/avalanchego/vms" -) - -var ( - _ VMRegisterer = (*vmRegisterer)(nil) - - errNotVM = errors.New("not a VM") -) - -// VMRegisterer defines functionality to install a virtual machine. -type VMRegisterer interface { - registerer - // RegisterWithReadLock installs the VM assuming that the http read-lock is - // held. - RegisterWithReadLock(context.Context, ids.ID, vms.Factory) error -} - -type registerer interface { - // Register installs the VM. - Register(context.Context, ids.ID, vms.Factory) error -} - -// VMRegistererConfig configures settings for VMRegisterer. -type VMRegistererConfig struct { - APIServer server.Server - Log logging.Logger - VMFactoryLog logging.Logger - VMManager vms.Manager -} - -type vmRegisterer struct { - config VMRegistererConfig -} - -// NewVMRegisterer returns an instance of VMRegisterer -func NewVMRegisterer(config VMRegistererConfig) VMRegisterer { - return &vmRegisterer{ - config: config, - } -} - -func (r *vmRegisterer) Register(ctx context.Context, vmID ids.ID, factory vms.Factory) error { - return r.register(ctx, r.config.APIServer, vmID, factory) -} - -func (r *vmRegisterer) RegisterWithReadLock(ctx context.Context, vmID ids.ID, factory vms.Factory) error { - return r.register(ctx, server.PathWriterFromWithReadLock(r.config.APIServer), vmID, factory) -} - -func (r *vmRegisterer) register(ctx context.Context, pathAdder server.PathAdder, vmID ids.ID, factory vms.Factory) error { - if err := r.config.VMManager.RegisterFactory(ctx, vmID, factory); err != nil { - return err - } - handlers, err := r.createStaticHandlers(ctx, vmID, factory) - if err != nil { - return err - } - - // all static endpoints go to the vm endpoint, defaulting to the vm id - defaultEndpoint := path.Join(constants.VMAliasPrefix, vmID.String()) - - if err := r.createStaticEndpoints(pathAdder, handlers, defaultEndpoint); err != nil { - return err - } - urlAliases, err := r.getURLAliases(vmID, defaultEndpoint) - if err != nil { - return err - } - return pathAdder.AddAliases(defaultEndpoint, urlAliases...) -} - -// Creates a dedicated VM instance for the sole purpose of serving the static -// handlers. -func (r *vmRegisterer) createStaticHandlers( - ctx context.Context, - vmID ids.ID, - factory vms.Factory, -) (map[string]http.Handler, error) { - vm, err := factory.New(r.config.VMFactoryLog) - if err != nil { - return nil, err - } - - commonVM, ok := vm.(common.VM) - if !ok { - return nil, fmt.Errorf("%s is %w", vmID, errNotVM) - } - - handlers, err := commonVM.CreateStaticHandlers(ctx) - if err != nil { - r.config.Log.Error("failed to create static API endpoints", - zap.Stringer("vmID", vmID), - zap.Error(err), - ) - - if err := commonVM.Shutdown(ctx); err != nil { - return nil, fmt.Errorf("shutting down VM errored with: %w", err) - } - return nil, err - } - return handlers, nil -} - -func (r *vmRegisterer) createStaticEndpoints(pathAdder server.PathAdder, handlers map[string]http.Handler, defaultEndpoint string) error { - // register the static endpoints - for extension, service := range handlers { - r.config.Log.Verbo("adding static API endpoint", - zap.String("endpoint", defaultEndpoint), - zap.String("extension", extension), - ) - if err := pathAdder.AddRoute(service, defaultEndpoint, extension); err != nil { - return fmt.Errorf( - "failed to add static API endpoint %s%s: %w", - defaultEndpoint, - extension, - err, - ) - } - } - return nil -} - -func (r vmRegisterer) getURLAliases(vmID ids.ID, defaultEndpoint string) ([]string, error) { - aliases, err := r.config.VMManager.Aliases(vmID) - if err != nil { - return nil, err - } - - var urlAliases []string - for _, alias := range aliases { - urlAlias := path.Join(constants.VMAliasPrefix, alias) - if urlAlias != defaultEndpoint { - urlAliases = append(urlAliases, urlAlias) - } - } - return urlAliases, err -} - -type readRegisterer struct { - registerer VMRegisterer -} - -func (r readRegisterer) Register(ctx context.Context, vmID ids.ID, factory vms.Factory) error { - return r.registerer.RegisterWithReadLock(ctx, vmID, factory) -} diff --git a/vms/registry/vm_registerer_test.go b/vms/registry/vm_registerer_test.go deleted file mode 100644 index 666a9174525a..000000000000 --- a/vms/registry/vm_registerer_test.go +++ /dev/null @@ -1,436 +0,0 @@ -// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - -package registry - -import ( - "context" - "net/http" - "path" - "testing" - - "github.com/stretchr/testify/require" - - "go.uber.org/mock/gomock" - - "github.com/ava-labs/avalanchego/api/server" - "github.com/ava-labs/avalanchego/ids" - "github.com/ava-labs/avalanchego/snow/engine/snowman/block" - "github.com/ava-labs/avalanchego/utils/constants" - "github.com/ava-labs/avalanchego/utils/logging" - "github.com/ava-labs/avalanchego/vms" -) - -var id = ids.GenerateTestID() - -// Register should succeed even if we can't register a VM -func TestRegisterRegisterVMFails(t *testing.T) { - resources := initRegistererTest(t) - - vmFactory := vms.NewMockFactory(resources.ctrl) - - // We fail to register the VM - resources.mockManager.EXPECT().RegisterFactory(gomock.Any(), id, vmFactory).Times(1).Return(errTest) - - err := resources.registerer.Register(context.Background(), id, vmFactory) - require.ErrorIs(t, err, errTest) -} - -// Tests Register if a VM doesn't actually implement VM. -func TestRegisterBadVM(t *testing.T) { - resources := initRegistererTest(t) - - vmFactory := vms.NewMockFactory(resources.ctrl) - vm := "this is not a vm..." - - resources.mockManager.EXPECT().RegisterFactory(gomock.Any(), id, vmFactory).Times(1).Return(nil) - // Since this factory produces a bad vm, we should get an error. - vmFactory.EXPECT().New(logging.NoLog{}).Times(1).Return(vm, nil) - - err := resources.registerer.Register(context.Background(), id, vmFactory) - require.ErrorIs(t, err, errNotVM) -} - -// Tests Register if creating endpoints for a VM fails + shutdown fails -func TestRegisterCreateHandlersAndShutdownFails(t *testing.T) { - resources := initRegistererTest(t) - - vmFactory := vms.NewMockFactory(resources.ctrl) - vm := block.NewMockChainVM(resources.ctrl) - - resources.mockManager.EXPECT().RegisterFactory(gomock.Any(), id, vmFactory).Times(1).Return(nil) - vmFactory.EXPECT().New(logging.NoLog{}).Times(1).Return(vm, nil) - // We fail to create handlers + fail to shutdown - vm.EXPECT().CreateStaticHandlers(gomock.Any()).Return(nil, errTest).Times(1) - vm.EXPECT().Shutdown(gomock.Any()).Return(errTest).Times(1) - - err := resources.registerer.Register(context.Background(), id, vmFactory) - require.ErrorIs(t, err, errTest) -} - -// Tests Register if creating endpoints for a VM fails + shutdown succeeds -func TestRegisterCreateHandlersFails(t *testing.T) { - resources := initRegistererTest(t) - - vmFactory := vms.NewMockFactory(resources.ctrl) - vm := block.NewMockChainVM(resources.ctrl) - - resources.mockManager.EXPECT().RegisterFactory(gomock.Any(), id, vmFactory).Times(1).Return(nil) - vmFactory.EXPECT().New(logging.NoLog{}).Times(1).Return(vm, nil) - // We fail to create handlers + but succeed our shutdown - vm.EXPECT().CreateStaticHandlers(gomock.Any()).Return(nil, errTest).Times(1) - vm.EXPECT().Shutdown(gomock.Any()).Return(nil).Times(1) - - err := resources.registerer.Register(context.Background(), id, vmFactory) - require.ErrorIs(t, err, errTest) -} - -// Tests Register if we fail to register the new endpoint on the server. -func TestRegisterAddRouteFails(t *testing.T) { - resources := initRegistererTest(t) - - vmFactory := vms.NewMockFactory(resources.ctrl) - vm := block.NewMockChainVM(resources.ctrl) - - handlers := map[string]http.Handler{ - "foo": nil, - } - - resources.mockManager.EXPECT().RegisterFactory(gomock.Any(), id, vmFactory).Times(1).Return(nil) - vmFactory.EXPECT().New(logging.NoLog{}).Times(1).Return(vm, nil) - vm.EXPECT().CreateStaticHandlers(gomock.Any()).Return(handlers, nil).Times(1) - // We fail to create an endpoint for the handler - resources.mockServer.EXPECT(). - AddRoute( - handlers["foo"], - path.Join(constants.VMAliasPrefix, id.String()), - "foo", - ). - Times(1). - Return(errTest) - - err := resources.registerer.Register(context.Background(), id, vmFactory) - require.ErrorIs(t, err, errTest) -} - -// Tests Register we can't find the alias for the newly registered vm -func TestRegisterAliasLookupFails(t *testing.T) { - resources := initRegistererTest(t) - - vmFactory := vms.NewMockFactory(resources.ctrl) - vm := block.NewMockChainVM(resources.ctrl) - - handlers := map[string]http.Handler{ - "foo": nil, - } - - resources.mockManager.EXPECT().RegisterFactory(gomock.Any(), id, vmFactory).Times(1).Return(nil) - vmFactory.EXPECT().New(logging.NoLog{}).Times(1).Return(vm, nil) - vm.EXPECT().CreateStaticHandlers(gomock.Any()).Return(handlers, nil).Times(1) - // Registering the route fails - resources.mockServer.EXPECT(). - AddRoute( - handlers["foo"], - path.Join(constants.VMAliasPrefix, id.String()), - "foo", - ). - Times(1). - Return(nil) - resources.mockManager.EXPECT().Aliases(id).Times(1).Return(nil, errTest) - - err := resources.registerer.Register(context.Background(), id, vmFactory) - require.ErrorIs(t, err, errTest) -} - -// Tests Register if adding aliases for the newly registered vm fails -func TestRegisterAddAliasesFails(t *testing.T) { - resources := initRegistererTest(t) - - vmFactory := vms.NewMockFactory(resources.ctrl) - vm := block.NewMockChainVM(resources.ctrl) - - handlers := map[string]http.Handler{ - "foo": nil, - } - aliases := []string{"alias-1", "alias-2"} - - resources.mockManager.EXPECT().RegisterFactory(gomock.Any(), id, vmFactory).Times(1).Return(nil) - vmFactory.EXPECT().New(logging.NoLog{}).Times(1).Return(vm, nil) - vm.EXPECT().CreateStaticHandlers(gomock.Any()).Return(handlers, nil).Times(1) - resources.mockServer.EXPECT(). - AddRoute( - handlers["foo"], - path.Join(constants.VMAliasPrefix, id.String()), - "foo", - ). - Times(1). - Return(nil) - resources.mockManager.EXPECT().Aliases(id).Times(1).Return(aliases, nil) - // Adding aliases fails - resources.mockServer.EXPECT(). - AddAliases( - path.Join(constants.VMAliasPrefix, id.String()), - path.Join(constants.VMAliasPrefix, aliases[0]), - path.Join(constants.VMAliasPrefix, aliases[1]), - ). - Return(errTest) - - err := resources.registerer.Register(context.Background(), id, vmFactory) - require.ErrorIs(t, err, errTest) -} - -// Tests Register if no errors are thrown -func TestRegisterHappyCase(t *testing.T) { - resources := initRegistererTest(t) - - vmFactory := vms.NewMockFactory(resources.ctrl) - vm := block.NewMockChainVM(resources.ctrl) - - handlers := map[string]http.Handler{ - "foo": nil, - } - aliases := []string{"alias-1", "alias-2"} - - resources.mockManager.EXPECT().RegisterFactory(gomock.Any(), id, vmFactory).Times(1).Return(nil) - vmFactory.EXPECT().New(logging.NoLog{}).Times(1).Return(vm, nil) - vm.EXPECT().CreateStaticHandlers(gomock.Any()).Return(handlers, nil).Times(1) - resources.mockServer.EXPECT(). - AddRoute( - handlers["foo"], - path.Join(constants.VMAliasPrefix, id.String()), - "foo", - ). - Times(1). - Return(nil) - resources.mockManager.EXPECT().Aliases(id).Times(1).Return(aliases, nil) - resources.mockServer.EXPECT(). - AddAliases( - path.Join(constants.VMAliasPrefix, id.String()), - path.Join(constants.VMAliasPrefix, aliases[0]), - path.Join(constants.VMAliasPrefix, aliases[1]), - ). - Times(1). - Return(nil) - - require.NoError(t, resources.registerer.Register(context.Background(), id, vmFactory)) -} - -// RegisterWithReadLock should succeed even if we can't register a VM -func TestRegisterWithReadLockRegisterVMFails(t *testing.T) { - resources := initRegistererTest(t) - - vmFactory := vms.NewMockFactory(resources.ctrl) - - // We fail to register the VM - resources.mockManager.EXPECT().RegisterFactory(gomock.Any(), id, vmFactory).Times(1).Return(errTest) - - err := resources.registerer.RegisterWithReadLock(context.Background(), id, vmFactory) - require.ErrorIs(t, err, errTest) -} - -// Tests RegisterWithReadLock if a VM doesn't actually implement VM. -func TestRegisterWithReadLockBadVM(t *testing.T) { - resources := initRegistererTest(t) - - vmFactory := vms.NewMockFactory(resources.ctrl) - vm := "this is not a vm..." - - resources.mockManager.EXPECT().RegisterFactory(gomock.Any(), id, vmFactory).Times(1).Return(nil) - // Since this factory produces a bad vm, we should get an error. - vmFactory.EXPECT().New(logging.NoLog{}).Times(1).Return(vm, nil) - - err := resources.registerer.RegisterWithReadLock(context.Background(), id, vmFactory) - require.ErrorIs(t, err, errNotVM) -} - -// Tests RegisterWithReadLock if creating endpoints for a VM fails + shutdown fails -func TestRegisterWithReadLockCreateHandlersAndShutdownFails(t *testing.T) { - resources := initRegistererTest(t) - - vmFactory := vms.NewMockFactory(resources.ctrl) - vm := block.NewMockChainVM(resources.ctrl) - - resources.mockManager.EXPECT().RegisterFactory(gomock.Any(), id, vmFactory).Times(1).Return(nil) - vmFactory.EXPECT().New(logging.NoLog{}).Times(1).Return(vm, nil) - // We fail to create handlers + fail to shutdown - vm.EXPECT().CreateStaticHandlers(gomock.Any()).Return(nil, errTest).Times(1) - vm.EXPECT().Shutdown(gomock.Any()).Return(errTest).Times(1) - - err := resources.registerer.RegisterWithReadLock(context.Background(), id, vmFactory) - require.ErrorIs(t, err, errTest) -} - -// Tests RegisterWithReadLock if creating endpoints for a VM fails + shutdown succeeds -func TestRegisterWithReadLockCreateHandlersFails(t *testing.T) { - resources := initRegistererTest(t) - - vmFactory := vms.NewMockFactory(resources.ctrl) - vm := block.NewMockChainVM(resources.ctrl) - - resources.mockManager.EXPECT().RegisterFactory(gomock.Any(), id, vmFactory).Times(1).Return(nil) - vmFactory.EXPECT().New(logging.NoLog{}).Times(1).Return(vm, nil) - // We fail to create handlers + but succeed our shutdown - vm.EXPECT().CreateStaticHandlers(gomock.Any()).Return(nil, errTest).Times(1) - vm.EXPECT().Shutdown(gomock.Any()).Return(nil).Times(1) - - err := resources.registerer.RegisterWithReadLock(context.Background(), id, vmFactory) - require.ErrorIs(t, err, errTest) -} - -// Tests RegisterWithReadLock if we fail to register the new endpoint on the server. -func TestRegisterWithReadLockAddRouteWithReadLockFails(t *testing.T) { - resources := initRegistererTest(t) - - vmFactory := vms.NewMockFactory(resources.ctrl) - vm := block.NewMockChainVM(resources.ctrl) - - handlers := map[string]http.Handler{ - "foo": nil, - } - - resources.mockManager.EXPECT().RegisterFactory(gomock.Any(), id, vmFactory).Times(1).Return(nil) - vmFactory.EXPECT().New(logging.NoLog{}).Times(1).Return(vm, nil) - vm.EXPECT().CreateStaticHandlers(gomock.Any()).Return(handlers, nil).Times(1) - // We fail to create an endpoint for the handler - resources.mockServer.EXPECT(). - AddRouteWithReadLock( - handlers["foo"], - path.Join(constants.VMAliasPrefix, id.String()), - "foo", - ). - Times(1). - Return(errTest) - - err := resources.registerer.RegisterWithReadLock(context.Background(), id, vmFactory) - require.ErrorIs(t, err, errTest) -} - -// Tests RegisterWithReadLock we can't find the alias for the newly registered vm -func TestRegisterWithReadLockAliasLookupFails(t *testing.T) { - resources := initRegistererTest(t) - - vmFactory := vms.NewMockFactory(resources.ctrl) - vm := block.NewMockChainVM(resources.ctrl) - - handlers := map[string]http.Handler{ - "foo": nil, - } - - resources.mockManager.EXPECT().RegisterFactory(gomock.Any(), id, vmFactory).Times(1).Return(nil) - vmFactory.EXPECT().New(logging.NoLog{}).Times(1).Return(vm, nil) - vm.EXPECT().CreateStaticHandlers(gomock.Any()).Return(handlers, nil).Times(1) - // RegisterWithReadLocking the route fails - resources.mockServer.EXPECT(). - AddRouteWithReadLock( - handlers["foo"], - path.Join(constants.VMAliasPrefix, id.String()), - "foo", - ). - Times(1). - Return(nil) - resources.mockManager.EXPECT().Aliases(id).Times(1).Return(nil, errTest) - - err := resources.registerer.RegisterWithReadLock(context.Background(), id, vmFactory) - require.ErrorIs(t, err, errTest) -} - -// Tests RegisterWithReadLock if adding aliases for the newly registered vm fails -func TestRegisterWithReadLockAddAliasesFails(t *testing.T) { - resources := initRegistererTest(t) - - vmFactory := vms.NewMockFactory(resources.ctrl) - vm := block.NewMockChainVM(resources.ctrl) - - handlers := map[string]http.Handler{ - "foo": nil, - } - aliases := []string{"alias-1", "alias-2"} - - resources.mockManager.EXPECT().RegisterFactory(gomock.Any(), id, vmFactory).Times(1).Return(nil) - vmFactory.EXPECT().New(logging.NoLog{}).Times(1).Return(vm, nil) - vm.EXPECT().CreateStaticHandlers(gomock.Any()).Return(handlers, nil).Times(1) - resources.mockServer.EXPECT(). - AddRouteWithReadLock( - handlers["foo"], - path.Join(constants.VMAliasPrefix, id.String()), - "foo", - ). - Times(1). - Return(nil) - resources.mockManager.EXPECT().Aliases(id).Times(1).Return(aliases, nil) - // Adding aliases fails - resources.mockServer.EXPECT(). - AddAliasesWithReadLock( - path.Join(constants.VMAliasPrefix, id.String()), - path.Join(constants.VMAliasPrefix, aliases[0]), - path.Join(constants.VMAliasPrefix, aliases[1]), - ). - Return(errTest) - - err := resources.registerer.RegisterWithReadLock(context.Background(), id, vmFactory) - require.ErrorIs(t, err, errTest) -} - -// Tests RegisterWithReadLock if no errors are thrown -func TestRegisterWithReadLockHappyCase(t *testing.T) { - resources := initRegistererTest(t) - - vmFactory := vms.NewMockFactory(resources.ctrl) - vm := block.NewMockChainVM(resources.ctrl) - - handlers := map[string]http.Handler{ - "foo": nil, - } - aliases := []string{"alias-1", "alias-2"} - - resources.mockManager.EXPECT().RegisterFactory(gomock.Any(), id, vmFactory).Times(1).Return(nil) - vmFactory.EXPECT().New(logging.NoLog{}).Times(1).Return(vm, nil) - vm.EXPECT().CreateStaticHandlers(gomock.Any()).Return(handlers, nil).Times(1) - resources.mockServer.EXPECT(). - AddRouteWithReadLock( - handlers["foo"], - path.Join(constants.VMAliasPrefix, id.String()), - "foo", - ). - Times(1). - Return(nil) - resources.mockManager.EXPECT().Aliases(id).Times(1).Return(aliases, nil) - resources.mockServer.EXPECT(). - AddAliasesWithReadLock( - path.Join(constants.VMAliasPrefix, id.String()), - path.Join(constants.VMAliasPrefix, aliases[0]), - path.Join(constants.VMAliasPrefix, aliases[1]), - ). - Times(1). - Return(nil) - - require.NoError(t, resources.registerer.RegisterWithReadLock(context.Background(), id, vmFactory)) -} - -type vmRegistererTestResources struct { - ctrl *gomock.Controller - mockManager *vms.MockManager - mockServer *server.MockServer - registerer VMRegisterer -} - -func initRegistererTest(t *testing.T) *vmRegistererTestResources { - ctrl := gomock.NewController(t) - - mockManager := vms.NewMockManager(ctrl) - mockServer := server.NewMockServer(ctrl) - - registerer := NewVMRegisterer(VMRegistererConfig{ - APIServer: mockServer, - Log: logging.NoLog{}, - VMFactoryLog: logging.NoLog{}, - VMManager: mockManager, - }) - - return &vmRegistererTestResources{ - ctrl: ctrl, - mockManager: mockManager, - mockServer: mockServer, - registerer: registerer, - } -} diff --git a/vms/registry/vm_registry.go b/vms/registry/vm_registry.go index 3c8f5b942e25..1374c4d46b8e 100644 --- a/vms/registry/vm_registry.go +++ b/vms/registry/vm_registry.go @@ -7,6 +7,7 @@ import ( "context" "github.com/ava-labs/avalanchego/ids" + "github.com/ava-labs/avalanchego/vms" ) var _ VMRegistry = (*vmRegistry)(nil) @@ -16,15 +17,12 @@ var _ VMRegistry = (*vmRegistry)(nil) type VMRegistry interface { // Reload installs all non-installed vms on the node. Reload(ctx context.Context) ([]ids.ID, map[ids.ID]error, error) - // ReloadWithReadLock installs all non-installed vms on the node assuming - // the http read lock is currently held. - ReloadWithReadLock(ctx context.Context) ([]ids.ID, map[ids.ID]error, error) } // VMRegistryConfig defines configurations for VMRegistry type VMRegistryConfig struct { - VMGetter VMGetter - VMRegisterer VMRegisterer + VMGetter VMGetter + VMManager vms.Manager } type vmRegistry struct { @@ -39,16 +37,6 @@ func NewVMRegistry(config VMRegistryConfig) VMRegistry { } func (r *vmRegistry) Reload(ctx context.Context) ([]ids.ID, map[ids.ID]error, error) { - return r.reload(ctx, r.config.VMRegisterer) -} - -func (r *vmRegistry) ReloadWithReadLock(ctx context.Context) ([]ids.ID, map[ids.ID]error, error) { - return r.reload(ctx, readRegisterer{ - registerer: r.config.VMRegisterer, - }) -} - -func (r *vmRegistry) reload(ctx context.Context, registerer registerer) ([]ids.ID, map[ids.ID]error, error) { _, unregisteredVMs, err := r.config.VMGetter.Get() if err != nil { return nil, nil, err @@ -58,7 +46,7 @@ func (r *vmRegistry) reload(ctx context.Context, registerer registerer) ([]ids.I failedVMs := make(map[ids.ID]error) for vmID, factory := range unregisteredVMs { - if err := registerer.Register(ctx, vmID, factory); err != nil { + if err := r.config.VMManager.RegisterFactory(ctx, vmID, factory); err != nil { failedVMs[vmID] = err continue } diff --git a/vms/registry/vm_registry_test.go b/vms/registry/vm_registry_test.go index 5f5eccc1c204..12e39a7c29c9 100644 --- a/vms/registry/vm_registry_test.go +++ b/vms/registry/vm_registry_test.go @@ -47,12 +47,12 @@ func TestReload_Success(t *testing.T) { Get(). Times(1). Return(registeredVms, unregisteredVms, nil) - resources.mockVMRegisterer.EXPECT(). - Register(gomock.Any(), id3, factory3). + resources.mockVMManager.EXPECT(). + RegisterFactory(gomock.Any(), id3, factory3). Times(1). Return(nil) - resources.mockVMRegisterer.EXPECT(). - Register(gomock.Any(), id4, factory4). + resources.mockVMManager.EXPECT(). + RegisterFactory(gomock.Any(), id4, factory4). Times(1). Return(nil) @@ -101,12 +101,12 @@ func TestReload_PartialRegisterFailure(t *testing.T) { Get(). Times(1). Return(registeredVms, unregisteredVms, nil) - resources.mockVMRegisterer.EXPECT(). - Register(gomock.Any(), id3, factory3). + resources.mockVMManager.EXPECT(). + RegisterFactory(gomock.Any(), id3, factory3). Times(1). Return(errTest) - resources.mockVMRegisterer.EXPECT(). - Register(gomock.Any(), id4, factory4). + resources.mockVMManager.EXPECT(). + RegisterFactory(gomock.Any(), id4, factory4). Times(1). Return(nil) @@ -118,126 +118,30 @@ func TestReload_PartialRegisterFailure(t *testing.T) { require.Equal(id4, installedVMs[0]) } -// Tests the happy case where Reload succeeds. -func TestReloadWithReadLock_Success(t *testing.T) { - require := require.New(t) - - resources := initVMRegistryTest(t) - - factory1 := vms.NewMockFactory(resources.ctrl) - factory2 := vms.NewMockFactory(resources.ctrl) - factory3 := vms.NewMockFactory(resources.ctrl) - factory4 := vms.NewMockFactory(resources.ctrl) - - registeredVms := map[ids.ID]vms.Factory{ - id1: factory1, - id2: factory2, - } - - unregisteredVms := map[ids.ID]vms.Factory{ - id3: factory3, - id4: factory4, - } - - resources.mockVMGetter.EXPECT(). - Get(). - Times(1). - Return(registeredVms, unregisteredVms, nil) - resources.mockVMRegisterer.EXPECT(). - RegisterWithReadLock(gomock.Any(), id3, factory3). - Times(1). - Return(nil) - resources.mockVMRegisterer.EXPECT(). - RegisterWithReadLock(gomock.Any(), id4, factory4). - Times(1). - Return(nil) - - installedVMs, failedVMs, err := resources.vmRegistry.ReloadWithReadLock(context.Background()) - require.NoError(err) - require.ElementsMatch([]ids.ID{id3, id4}, installedVMs) - require.Empty(failedVMs) -} - -// Tests that we fail if we're not able to get the vms on disk -func TestReloadWithReadLock_GetNewVMsFails(t *testing.T) { - require := require.New(t) - - resources := initVMRegistryTest(t) - - resources.mockVMGetter.EXPECT().Get().Times(1).Return(nil, nil, errTest) - - installedVMs, failedVMs, err := resources.vmRegistry.ReloadWithReadLock(context.Background()) - require.ErrorIs(err, errTest) - require.Empty(installedVMs) - require.Empty(failedVMs) -} - -// Tests that if we fail to register a VM, we fail. -func TestReloadWithReadLock_PartialRegisterFailure(t *testing.T) { - require := require.New(t) - - resources := initVMRegistryTest(t) - - factory1 := vms.NewMockFactory(resources.ctrl) - factory2 := vms.NewMockFactory(resources.ctrl) - factory3 := vms.NewMockFactory(resources.ctrl) - factory4 := vms.NewMockFactory(resources.ctrl) - - registeredVms := map[ids.ID]vms.Factory{ - id1: factory1, - id2: factory2, - } - - unregisteredVms := map[ids.ID]vms.Factory{ - id3: factory3, - id4: factory4, - } - - resources.mockVMGetter.EXPECT(). - Get(). - Times(1). - Return(registeredVms, unregisteredVms, nil) - resources.mockVMRegisterer.EXPECT(). - RegisterWithReadLock(gomock.Any(), id3, factory3). - Times(1). - Return(errTest) - resources.mockVMRegisterer.EXPECT(). - RegisterWithReadLock(gomock.Any(), id4, factory4). - Times(1). - Return(nil) - - installedVMs, failedVMs, err := resources.vmRegistry.ReloadWithReadLock(context.Background()) - require.NoError(err) - require.Len(failedVMs, 1) - require.ErrorIs(failedVMs[id3], errTest) - require.Len(installedVMs, 1) - require.Equal(id4, installedVMs[0]) -} - type registryTestResources struct { - ctrl *gomock.Controller - mockVMGetter *MockVMGetter - mockVMRegisterer *MockVMRegisterer - vmRegistry VMRegistry + ctrl *gomock.Controller + mockVMGetter *MockVMGetter + mockVMManager *vms.MockManager + vmRegistry VMRegistry } func initVMRegistryTest(t *testing.T) *registryTestResources { ctrl := gomock.NewController(t) mockVMGetter := NewMockVMGetter(ctrl) - mockVMRegisterer := NewMockVMRegisterer(ctrl) + mockVMManager := vms.NewMockManager(ctrl) vmRegistry := NewVMRegistry( VMRegistryConfig{ - VMGetter: mockVMGetter, - VMRegisterer: mockVMRegisterer, + VMGetter: mockVMGetter, + VMManager: mockVMManager, }, ) return ®istryTestResources{ - ctrl: ctrl, - mockVMGetter: mockVMGetter, - mockVMRegisterer: mockVMRegisterer, - vmRegistry: vmRegistry, + ctrl: ctrl, + mockVMGetter: mockVMGetter, + mockVMManager: mockVMManager, + vmRegistry: vmRegistry, } } diff --git a/vms/rpcchainvm/vm_client.go b/vms/rpcchainvm/vm_client.go index 0ee7882b96d9..3ca090011dd3 100644 --- a/vms/rpcchainvm/vm_client.go +++ b/vms/rpcchainvm/vm_client.go @@ -375,25 +375,6 @@ func (vm *VMClient) CreateHandlers(ctx context.Context) (map[string]http.Handler return handlers, nil } -func (vm *VMClient) CreateStaticHandlers(ctx context.Context) (map[string]http.Handler, error) { - resp, err := vm.client.CreateStaticHandlers(ctx, &emptypb.Empty{}) - if err != nil { - return nil, err - } - - handlers := make(map[string]http.Handler, len(resp.Handlers)) - for _, handler := range resp.Handlers { - clientConn, err := grpcutils.Dial(handler.ServerAddr) - if err != nil { - return nil, err - } - - vm.conns = append(vm.conns, clientConn) - handlers[handler.Prefix] = ghttp.NewClient(httppb.NewHTTPClient(clientConn)) - } - return handlers, nil -} - func (vm *VMClient) Connected(ctx context.Context, nodeID ids.NodeID, nodeVersion *version.Application) error { _, err := vm.client.Connected(ctx, &vmpb.ConnectedRequest{ NodeId: nodeID.Bytes(), diff --git a/vms/rpcchainvm/vm_server.go b/vms/rpcchainvm/vm_server.go index 4338d87f1ed2..5c0c22de1ae9 100644 --- a/vms/rpcchainvm/vm_server.go +++ b/vms/rpcchainvm/vm_server.go @@ -337,32 +337,6 @@ func (vm *VMServer) CreateHandlers(ctx context.Context, _ *emptypb.Empty) (*vmpb return resp, nil } -func (vm *VMServer) CreateStaticHandlers(ctx context.Context, _ *emptypb.Empty) (*vmpb.CreateStaticHandlersResponse, error) { - handlers, err := vm.vm.CreateStaticHandlers(ctx) - if err != nil { - return nil, err - } - resp := &vmpb.CreateStaticHandlersResponse{} - for prefix, handler := range handlers { - serverListener, err := grpcutils.NewListener() - if err != nil { - return nil, err - } - server := grpcutils.NewServer() - vm.serverCloser.Add(server) - httppb.RegisterHTTPServer(server, ghttp.NewServer(handler)) - - // Start HTTP service - go grpcutils.Serve(serverListener, server) - - resp.Handlers = append(resp.Handlers, &vmpb.Handler{ - Prefix: prefix, - ServerAddr: serverListener.Addr().String(), - }) - } - return resp, nil -} - func (vm *VMServer) Connected(ctx context.Context, req *vmpb.ConnectedRequest) (*emptypb.Empty, error) { nodeID, err := ids.ToNodeID(req.NodeId) if err != nil { From 26e329a66f2a53e1286a54f9868a214609d99f01 Mon Sep 17 00:00:00 2001 From: marun Date: Wed, 17 Jan 2024 16:49:44 +0100 Subject: [PATCH 43/57] `tmpnet`: Add support for subnets (#2492) --- tests/e2e/e2e_test.go | 3 +- tests/fixture/e2e/env.go | 60 ++++- tests/fixture/e2e/flags.go | 19 +- tests/fixture/e2e/helpers.go | 25 +- tests/fixture/tmpnet/README.md | 61 +++-- tests/fixture/tmpnet/cmd/main.go | 50 ++-- tests/fixture/tmpnet/defaults.go | 13 +- tests/fixture/tmpnet/network.go | 314 ++++++++++++++++++++--- tests/fixture/tmpnet/network_config.go | 18 +- tests/fixture/tmpnet/network_test.go | 5 +- tests/fixture/tmpnet/node.go | 9 + tests/fixture/tmpnet/subnet.go | 333 +++++++++++++++++++++++++ tests/upgrade/upgrade_test.go | 4 +- 13 files changed, 825 insertions(+), 89 deletions(-) create mode 100644 tests/fixture/tmpnet/subnet.go diff --git a/tests/e2e/e2e_test.go b/tests/e2e/e2e_test.go index aec783441e80..d363ff775086 100644 --- a/tests/e2e/e2e_test.go +++ b/tests/e2e/e2e_test.go @@ -11,6 +11,7 @@ import ( "github.com/onsi/gomega" "github.com/ava-labs/avalanchego/tests/fixture/e2e" + "github.com/ava-labs/avalanchego/tests/fixture/tmpnet" // ensure test packages are scanned by ginkgo _ "github.com/ava-labs/avalanchego/tests/e2e/banff" @@ -34,7 +35,7 @@ func init() { var _ = ginkgo.SynchronizedBeforeSuite(func() []byte { // Run only once in the first ginkgo process - return e2e.NewTestEnvironment(flagVars).Marshal() + return e2e.NewTestEnvironment(flagVars, &tmpnet.Network{}).Marshal() }, func(envBytes []byte) { // Run in every ginkgo process diff --git a/tests/fixture/e2e/env.go b/tests/fixture/e2e/env.go index d87c0985edd6..9019c9438b9e 100644 --- a/tests/fixture/e2e/env.go +++ b/tests/fixture/e2e/env.go @@ -14,6 +14,8 @@ import ( "github.com/stretchr/testify/require" + "github.com/ava-labs/avalanchego/api/info" + "github.com/ava-labs/avalanchego/config" "github.com/ava-labs/avalanchego/tests" "github.com/ava-labs/avalanchego/tests/fixture" "github.com/ava-labs/avalanchego/tests/fixture/tmpnet" @@ -29,10 +31,9 @@ var Env *TestEnvironment func InitSharedTestEnvironment(envBytes []byte) { require := require.New(ginkgo.GinkgoT()) require.Nil(Env, "env already initialized") - Env = &TestEnvironment{ - require: require, - } + Env = &TestEnvironment{} require.NoError(json.Unmarshal(envBytes, Env)) + Env.require = require } type TestEnvironment struct { @@ -53,7 +54,7 @@ func (te *TestEnvironment) Marshal() []byte { } // Initialize a new test environment with a shared network (either pre-existing or newly created). -func NewTestEnvironment(flagVars *FlagVars) *TestEnvironment { +func NewTestEnvironment(flagVars *FlagVars, desiredNetwork *tmpnet.Network) *TestEnvironment { require := require.New(ginkgo.GinkgoT()) networkDir := flagVars.NetworkDir() @@ -65,10 +66,44 @@ func NewTestEnvironment(flagVars *FlagVars) *TestEnvironment { network, err = tmpnet.ReadNetwork(networkDir) require.NoError(err) tests.Outf("{{yellow}}Using an existing network configured at %s{{/}}\n", network.Dir) + + // Set the desired subnet configuration to ensure subsequent creation. + for _, subnet := range desiredNetwork.Subnets { + if existing := network.GetSubnet(subnet.Name); existing != nil { + // Already present + continue + } + network.Subnets = append(network.Subnets, subnet) + } } else { - network = StartNetwork(flagVars.AvalancheGoExecPath(), DefaultNetworkDir) + network = desiredNetwork + StartNetwork(network, DefaultNetworkDir, flagVars.AvalancheGoExecPath(), flagVars.PluginDir()) } + // A new network will always need subnet creation and an existing + // network will also need subnets to be created the first time it + // is used. + require.NoError(network.CreateSubnets(DefaultContext(), ginkgo.GinkgoWriter)) + + // Wait for chains to have bootstrapped on all nodes + Eventually(func() bool { + for _, subnet := range network.Subnets { + for _, validatorID := range subnet.ValidatorIDs { + uri, err := network.GetURIForNodeID(validatorID) + require.NoError(err) + infoClient := info.NewClient(uri) + for _, chain := range subnet.Chains { + isBootstrapped, err := infoClient.IsBootstrapped(DefaultContext(), chain.ChainID.String()) + // Ignore errors since a chain id that is not yet known will result in a recoverable error. + if err != nil || !isBootstrapped { + return false + } + } + } + } + return true + }, DefaultTimeout, DefaultPollingInterval, "failed to see all chains bootstrap before timeout") + uris := network.GetNodeURIs() require.NotEmpty(uris, "network contains no nodes") tests.Outf("{{green}}network URIs: {{/}} %+v\n", uris) @@ -83,6 +118,7 @@ func NewTestEnvironment(flagVars *FlagVars) *TestEnvironment { NetworkDir: network.Dir, URIs: uris, TestDataServerURI: testDataServerURI, + require: require, } } @@ -127,10 +163,22 @@ func (te *TestEnvironment) NewPrivateNetwork() *tmpnet.Network { sharedNetwork, err := tmpnet.ReadNetwork(te.NetworkDir) te.require.NoError(err) + network := &tmpnet.Network{} + // The private networks dir is under the shared network dir to ensure it // will be included in the artifact uploaded in CI. privateNetworksDir := filepath.Join(sharedNetwork.Dir, PrivateNetworksDirName) te.require.NoError(os.MkdirAll(privateNetworksDir, perms.ReadWriteExecute)) - return StartNetwork(sharedNetwork.DefaultRuntimeConfig.AvalancheGoPath, privateNetworksDir) + pluginDir, err := sharedNetwork.DefaultFlags.GetStringVal(config.PluginDirKey) + te.require.NoError(err) + + StartNetwork( + network, + privateNetworksDir, + sharedNetwork.DefaultRuntimeConfig.AvalancheGoPath, + pluginDir, + ) + + return network } diff --git a/tests/fixture/e2e/flags.go b/tests/fixture/e2e/flags.go index 6cedf003b3a3..2a00df97a885 100644 --- a/tests/fixture/e2e/flags.go +++ b/tests/fixture/e2e/flags.go @@ -13,10 +13,19 @@ import ( type FlagVars struct { avalancheGoExecPath string + pluginDir string networkDir string useExistingNetwork bool } +func (v *FlagVars) AvalancheGoExecPath() string { + return v.avalancheGoExecPath +} + +func (v *FlagVars) PluginDir() string { + return v.pluginDir +} + func (v *FlagVars) NetworkDir() string { if !v.useExistingNetwork { return "" @@ -27,10 +36,6 @@ func (v *FlagVars) NetworkDir() string { return os.Getenv(tmpnet.NetworkDirEnvName) } -func (v *FlagVars) AvalancheGoExecPath() string { - return v.avalancheGoExecPath -} - func (v *FlagVars) UseExistingNetwork() bool { return v.useExistingNetwork } @@ -43,6 +48,12 @@ func RegisterFlags() *FlagVars { os.Getenv(tmpnet.AvalancheGoPathEnvName), fmt.Sprintf("avalanchego executable path (required if not using an existing network). Also possible to configure via the %s env variable.", tmpnet.AvalancheGoPathEnvName), ) + flag.StringVar( + &vars.pluginDir, + "plugin-dir", + os.ExpandEnv("$HOME/.avalanchego/plugins"), + "[optional] the dir containing VM plugins.", + ) flag.StringVar( &vars.networkDir, "network-dir", diff --git a/tests/fixture/e2e/helpers.go b/tests/fixture/e2e/helpers.go index 706af72dde05..c1d87a4beba8 100644 --- a/tests/fixture/e2e/helpers.go +++ b/tests/fixture/e2e/helpers.go @@ -34,15 +34,15 @@ const ( // contention. DefaultTimeout = 2 * time.Minute - // Interval appropriate for network operations that should be - // retried periodically but not too often. - DefaultPollingInterval = 500 * time.Millisecond + DefaultPollingInterval = tmpnet.DefaultPollingInterval // Setting this env will disable post-test bootstrap // checks. Useful for speeding up iteration during test // development. SkipBootstrapChecksEnvName = "E2E_SKIP_BOOTSTRAP_CHECKS" + DefaultValidatorStartTimeDiff = tmpnet.DefaultValidatorStartTimeDiff + DefaultGasLimit = uint64(21000) // Standard gas limit // An empty string prompts the use of the default path which ensures a @@ -217,13 +217,20 @@ func CheckBootstrapIsPossible(network *tmpnet.Network) { } // Start a temporary network with the provided avalanchego binary. -func StartNetwork(avalancheGoExecPath string, rootNetworkDir string) *tmpnet.Network { +func StartNetwork(network *tmpnet.Network, rootNetworkDir string, avalancheGoExecPath string, pluginDir string) { require := require.New(ginkgo.GinkgoT()) - network, err := tmpnet.NewDefaultNetwork(ginkgo.GinkgoWriter, avalancheGoExecPath, tmpnet.DefaultNodeCount) - require.NoError(err) - require.NoError(network.Create(rootNetworkDir)) - require.NoError(network.Start(DefaultContext(), ginkgo.GinkgoWriter)) + require.NoError( + tmpnet.StartNewNetwork( + DefaultContext(), + ginkgo.GinkgoWriter, + network, + rootNetworkDir, + avalancheGoExecPath, + pluginDir, + tmpnet.DefaultNodeCount, + ), + ) ginkgo.DeferCleanup(func() { tests.Outf("Shutting down network\n") @@ -233,6 +240,4 @@ func StartNetwork(avalancheGoExecPath string, rootNetworkDir string) *tmpnet.Net }) tests.Outf("{{green}}Successfully started network{{/}}\n") - - return network } diff --git a/tests/fixture/tmpnet/README.md b/tests/fixture/tmpnet/README.md index abccbf52cf79..909a29c6ee12 100644 --- a/tests/fixture/tmpnet/README.md +++ b/tests/fixture/tmpnet/README.md @@ -34,6 +34,7 @@ the following non-test files: | node.go | Node | Orchestrates and configures nodes | | node_config.go | Node | Reads and writes node configuration | | node_process.go | NodeProcess | Orchestrates node processes | +| subnet.go | Subnet | Orchestrates subnets | | utils.go | | Defines shared utility functions | ## Usage @@ -74,16 +75,33 @@ network. A temporary network can be managed in code: ```golang -network, _ := tmpnet.NewDefaultNetwork( +network := &tmpnet.Network{ // Configure non-default values for the new network + DefaultFlags: tmpnet.FlagsMap{ + config.LogLevelKey: "INFO", // Change one of the network's defaults + }, + Subnets: []*tmpnet.Subnet{ // Subnets to create on the new network once it is running + { + Name: "xsvm-a", // User-defined name used to reference subnet in code and on disk + Chains: []*tmpnet.Chain{ + { + VMName: "xsvm", // Name of the VM the chain will run, will be used to derive the name of the VM binary + Genesis: , // Genesis bytes used to initialize the custom chain + PreFundedKey: , // (Optional) A private key that is funded in the genesis bytes + }, + }, + }, + }, +} + +_ := tmpnet.StartNewNetwork( // Start the network + ctx, // Context used to limit duration of waiting for network health ginkgo.GinkgoWriter, // Writer to report progress of initialization + network, + "", // Empty string uses the default network path (~/tmpnet/networks) "/path/to/avalanchego", // The path to the binary that nodes will execute + "/path/to/plugins", // The path nodes will use for plugin binaries (suggested value ~/.avalanchego/plugins) 5, // Number of initial validating nodes ) -_ = network.Create("") // Finalize network configuration and write to disk -_ = network.Start( // Start the nodes of the network and wait until they report healthy - ctx, // Context used to limit duration of waiting for network health - ginkgo.GinkgoWriter, // Writer to report progress of network start -) uris := network.GetNodeURIs() @@ -125,11 +143,16 @@ HOME │ │ └── ... │ └── process.json // Node process details (PID, API URI, staking address) ├── chains - │ └── C - │ └── config.json // C-Chain config for all nodes + │ ├── C + │ │ └── config.json // C-Chain config for all nodes + │ └── raZ51bwfepaSaZ1MNSRNYNs3ZPfj...U7pa3 + │ └── config.json // Custom chain configuration for all nodes ├── config.json // Common configuration (including defaults and pre-funded keys) ├── genesis.json // Genesis for all nodes - └── network.env // Sets network dir env var to simplify network usage + ├── network.env // Sets network dir env var to simplify network usage + └── subnets // Parent directory for subnet definitions + ├─ subnet-a.json // Configuration for subnet-a and its chain(s) + └─ subnet-b.json // Configuration for subnet-b and its chain(s) ``` ### Common networking configuration @@ -148,17 +171,19 @@ content will be generated with reasonable defaults if not supplied. Each node in the network can override the default by setting an explicit value for `--genesis-file` or `--genesis-file-content`. -### C-Chain config +### Chain configuration -The C-Chain config for a temporary network is stored at -`[network-dir]/chains/C/config.json` and referenced by default by all -nodes in the network. The C-Chain config will be generated with -reasonable defaults if not supplied. Each node in the network can -override the default by setting an explicit value for -`--chain-config-dir` and ensuring the C-Chain config file exists at -`[chain-config-dir]/C/config.json`. +The chain configuration for a temporary network is stored at +`[network-dir]/chains/[chain alias or ID]/config.json` and referenced +by all nodes in the network. The C-Chain config will be generated with +reasonable defaults if not supplied. X-Chain and P-Chain will use +implicit defaults. The configuration for custom chains can be provided +with subnet configuration and will be writen to the appropriate path. -TODO(marun) Enable configuration of X-Chain and P-Chain. +Each node in the network can override network-level chain +configuration by setting `--chain-config-dir` to an explicit value and +ensuring that configuration files for all chains exist at +`[custom-chain-config-dir]/[chain alias or ID]/config.json`. ### Network env diff --git a/tests/fixture/tmpnet/cmd/main.go b/tests/fixture/tmpnet/cmd/main.go index 1ab3f2648325..dd59c300bbb3 100644 --- a/tests/fixture/tmpnet/cmd/main.go +++ b/tests/fixture/tmpnet/cmd/main.go @@ -26,10 +26,12 @@ var ( ) func main() { + var networkDir string rootCmd := &cobra.Command{ Use: "tmpnetctl", Short: "tmpnetctl commands", } + rootCmd.PersistentFlags().StringVar(&networkDir, "network-dir", os.Getenv(tmpnet.NetworkDirEnvName), "The path to the configuration directory of a temporary network") versionCmd := &cobra.Command{ Use: "version", @@ -46,35 +48,38 @@ func main() { rootCmd.AddCommand(versionCmd) var ( - rootDir string - execPath string - nodeCount uint8 + rootDir string + avalancheGoPath string + pluginDir string + nodeCount uint8 ) startNetworkCmd := &cobra.Command{ Use: "start-network", Short: "Start a new temporary network", RunE: func(*cobra.Command, []string) error { - if len(execPath) == 0 { + if len(avalancheGoPath) == 0 { return errAvalancheGoRequired } // Root dir will be defaulted on start if not provided - network, err := tmpnet.NewDefaultNetwork(os.Stdout, execPath, int(nodeCount)) - if err != nil { - return err - } - - if err := network.Create(rootDir); err != nil { - return err - } + network := &tmpnet.Network{} // Extreme upper bound, should never take this long networkStartTimeout := 2 * time.Minute ctx, cancel := context.WithTimeout(context.Background(), networkStartTimeout) defer cancel() - if err := network.Start(ctx, os.Stdout); err != nil { + err := tmpnet.StartNewNetwork( + ctx, + os.Stdout, + network, + rootDir, + avalancheGoPath, + pluginDir, + int(nodeCount), + ) + if err != nil { return err } @@ -98,11 +103,11 @@ func main() { }, } startNetworkCmd.PersistentFlags().StringVar(&rootDir, "root-dir", os.Getenv(tmpnet.RootDirEnvName), "The path to the root directory for temporary networks") - startNetworkCmd.PersistentFlags().StringVar(&execPath, "avalanchego-path", os.Getenv(tmpnet.AvalancheGoPathEnvName), "The path to an avalanchego binary") + startNetworkCmd.PersistentFlags().StringVar(&avalancheGoPath, "avalanchego-path", os.Getenv(tmpnet.AvalancheGoPathEnvName), "The path to an avalanchego binary") + startNetworkCmd.PersistentFlags().StringVar(&pluginDir, "plugin-dir", os.ExpandEnv("$HOME/.avalanchego/plugins"), "[optional] the dir containing VM plugins") startNetworkCmd.PersistentFlags().Uint8Var(&nodeCount, "node-count", tmpnet.DefaultNodeCount, "Number of nodes the network should initially consist of") rootCmd.AddCommand(startNetworkCmd) - var networkDir string stopNetworkCmd := &cobra.Command{ Use: "stop-network", Short: "Stop a temporary network", @@ -119,9 +124,22 @@ func main() { return nil }, } - stopNetworkCmd.PersistentFlags().StringVar(&networkDir, "network-dir", os.Getenv(tmpnet.NetworkDirEnvName), "The path to the configuration directory of a temporary network") rootCmd.AddCommand(stopNetworkCmd) + restartNetworkCmd := &cobra.Command{ + Use: "restart-network", + Short: "Restart a temporary network", + RunE: func(*cobra.Command, []string) error { + if len(networkDir) == 0 { + return errNetworkDirRequired + } + ctx, cancel := context.WithTimeout(context.Background(), tmpnet.DefaultNetworkTimeout) + defer cancel() + return tmpnet.RestartNetwork(ctx, os.Stdout, networkDir) + }, + } + rootCmd.AddCommand(restartNetworkCmd) + if err := rootCmd.Execute(); err != nil { fmt.Fprintf(os.Stderr, "tmpnetctl failed: %v\n", err) os.Exit(1) diff --git a/tests/fixture/tmpnet/defaults.go b/tests/fixture/tmpnet/defaults.go index ce09def2582a..2b88ef49afc1 100644 --- a/tests/fixture/tmpnet/defaults.go +++ b/tests/fixture/tmpnet/defaults.go @@ -7,9 +7,19 @@ import ( "time" "github.com/ava-labs/avalanchego/config" + "github.com/ava-labs/avalanchego/vms/platformvm/txs/executor" ) const ( + // Interval appropriate for network operations that should be + // retried periodically but not too often. + DefaultPollingInterval = 500 * time.Millisecond + + // Validator start time must be a minimum of SyncBound from the + // current time for validator addition to succeed, and adding 20 + // seconds provides a buffer in case of any delay in processing. + DefaultValidatorStartTimeDiff = executor.SyncBound + 20*time.Second + DefaultNetworkTimeout = 2 * time.Minute // Minimum required to ensure connectivity-based health checks will pass @@ -50,7 +60,8 @@ func DefaultChainConfigs() map[string]FlagsMap { // values will be used. Available C-Chain configuration options are // defined in the `github.com/ava-labs/coreth/evm` package. "C": { - "log-level": "trace", + "warp-api-enabled": true, + "log-level": "trace", }, } } diff --git a/tests/fixture/tmpnet/network.go b/tests/fixture/tmpnet/network.go index 3352f7dcb1cf..01829da70da5 100644 --- a/tests/fixture/tmpnet/network.go +++ b/tests/fixture/tmpnet/network.go @@ -5,6 +5,7 @@ package tmpnet import ( "context" + "encoding/hex" "errors" "fmt" "io" @@ -12,6 +13,7 @@ import ( "os" "path/filepath" "strconv" + "strings" "time" "github.com/ava-labs/avalanchego/config" @@ -21,6 +23,7 @@ import ( "github.com/ava-labs/avalanchego/utils/crypto/secp256k1" "github.com/ava-labs/avalanchego/utils/perms" "github.com/ava-labs/avalanchego/utils/set" + "github.com/ava-labs/avalanchego/vms/platformvm" ) // The Network type is defined in this file (orchestration) and @@ -36,8 +39,26 @@ const ( // startup, as smaller intervals (e.g. 50ms) seemed to noticeably // increase the time for a network's nodes to be seen as healthy. networkHealthCheckInterval = 200 * time.Millisecond + + // eth address: 0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC + HardHatKeyStr = "56289e99c94b6912bfc12adc093c9b51124f0dc54ac7a766b2bc5ccf558d8027" ) +// HardhatKey is a legacy used for hardhat testing in subnet-evm +// TODO(marun) Remove when no longer needed. +var HardhatKey *secp256k1.PrivateKey + +func init() { + hardhatKeyBytes, err := hex.DecodeString(HardHatKeyStr) + if err != nil { + panic(err) + } + HardhatKey, err = secp256k1.ToPrivateKey(hardhatKeyBytes) + if err != nil { + panic(err) + } +} + // Collects the configuration for running a temporary avalanchego network type Network struct { // Path where network configuration and data is stored @@ -56,6 +77,9 @@ type Network struct { // Nodes that constitute the network Nodes []*Node + + // Subnets that have been enabled on the network + Subnets []*Subnet } // Ensure a real and absolute network dir so that node @@ -69,35 +93,22 @@ func toCanonicalDir(dir string) (string, error) { return filepath.EvalSymlinks(absDir) } -// Initializes a new network with default configuration. -func NewDefaultNetwork(w io.Writer, avalancheGoPath string, nodeCount int) (*Network, error) { - if _, err := fmt.Fprintf(w, "Preparing configuration for new network with %s\n", avalancheGoPath); err != nil { - return nil, err - } - - keys, err := NewPrivateKeys(DefaultPreFundedKeyCount) - if err != nil { - return nil, err - } - - network := &Network{ - DefaultFlags: DefaultFlags(), - DefaultRuntimeConfig: NodeRuntimeConfig{ - AvalancheGoPath: avalancheGoPath, - }, - PreFundedKeys: keys, - ChainConfigs: DefaultChainConfigs(), +func StartNewNetwork( + ctx context.Context, + w io.Writer, + network *Network, + rootNetworkDir string, + avalancheGoExecPath string, + pluginDir string, + nodeCount int, +) error { + if err := network.EnsureDefaultConfig(w, avalancheGoExecPath, pluginDir, nodeCount); err != nil { + return err } - - network.Nodes = make([]*Node, nodeCount) - for i := range network.Nodes { - network.Nodes[i] = NewNode("") - if err := network.EnsureNodeConfig(network.Nodes[i]); err != nil { - return nil, err - } + if err := network.Create(rootNetworkDir); err != nil { + return err } - - return network, nil + return network.Start(ctx, w) } // Stops the nodes of the network configured in the provided directory. @@ -109,6 +120,15 @@ func StopNetwork(ctx context.Context, dir string) error { return network.Stop(ctx) } +// Restarts the nodes of the network configured in the provided directory. +func RestartNetwork(ctx context.Context, w io.Writer, dir string) error { + network, err := ReadNetwork(dir) + if err != nil { + return err + } + return network.Restart(ctx, w) +} + // Reads a network from the provided directory. func ReadNetwork(dir string) (*Network, error) { canonicalDir, err := toCanonicalDir(dir) @@ -124,6 +144,68 @@ func ReadNetwork(dir string) (*Network, error) { return network, nil } +// Initializes a new network with default configuration. +func (n *Network) EnsureDefaultConfig(w io.Writer, avalancheGoPath string, pluginDir string, nodeCount int) error { + if _, err := fmt.Fprintf(w, "Preparing configuration for new network with %s\n", avalancheGoPath); err != nil { + return err + } + + // Ensure default flags + if n.DefaultFlags == nil { + n.DefaultFlags = FlagsMap{} + } + n.DefaultFlags.SetDefaults(DefaultFlags()) + + // Only configure the plugin dir with a non-empty value to ensure + // the use of the default value (`[datadir]/plugins`) when + // no plugin dir is configured. + if len(pluginDir) > 0 { + if _, ok := n.DefaultFlags[config.PluginDirKey]; !ok { + n.DefaultFlags[config.PluginDirKey] = pluginDir + } + } + + // Ensure pre-funded keys + if len(n.PreFundedKeys) == 0 { + keys, err := NewPrivateKeys(DefaultPreFundedKeyCount) + if err != nil { + return err + } + n.PreFundedKeys = keys + } + + // Ensure primary chains are configured + if n.ChainConfigs == nil { + n.ChainConfigs = map[string]FlagsMap{} + } + defaultChainConfigs := DefaultChainConfigs() + for alias, chainConfig := range defaultChainConfigs { + if _, ok := n.ChainConfigs[alias]; !ok { + n.ChainConfigs[alias] = FlagsMap{} + } + n.ChainConfigs[alias].SetDefaults(chainConfig) + } + + // Ensure runtime is configured + if len(n.DefaultRuntimeConfig.AvalancheGoPath) == 0 { + n.DefaultRuntimeConfig.AvalancheGoPath = avalancheGoPath + } + + // Ensure nodes are created + if len(n.Nodes) == 0 { + n.Nodes = NewNodes(nodeCount) + } + + // Ensure nodes are configured + for i := range n.Nodes { + if err := n.EnsureNodeConfig(n.Nodes[i]); err != nil { + return err + } + } + + return nil +} + // Creates the network on disk, choosing its network id and generating its genesis in the process. func (n *Network) Create(rootDir string) error { if len(rootDir) == 0 { @@ -170,8 +252,30 @@ func (n *Network) Create(rootDir string) error { } n.Dir = canonicalDir + pluginDir, err := n.DefaultFlags.GetStringVal(config.PluginDirKey) + if err != nil { + return err + } + if len(pluginDir) > 0 { + // Ensure the existence of the plugin directory or nodes won't be able to start. + if err := os.MkdirAll(pluginDir, perms.ReadWriteExecute); err != nil { + return fmt.Errorf("failed to create plugin dir: %w", err) + } + } + if n.Genesis == nil { - genesis, err := NewTestGenesis(networkID, n.Nodes, n.PreFundedKeys) + // Pre-fund known legacy keys to support ad-hoc testing. Usage of a legacy key will + // require knowing the key beforehand rather than retrieving it from the set of pre-funded + // keys exposed by a network. Since allocation will not be exclusive, a test using a + // legacy key is unlikely to be a good candidate for parallel execution. + keysToFund := []*secp256k1.PrivateKey{ + genesis.VMRQKey, + genesis.EWOQKey, + HardhatKey, + } + keysToFund = append(keysToFund, n.PreFundedKeys...) + + genesis, err := NewTestGenesis(networkID, n.Nodes, keysToFund) if err != nil { return err } @@ -317,6 +421,28 @@ func (n *Network) Stop(ctx context.Context) error { return nil } +// Restarts all non-ephemeral nodes in the network. +func (n *Network) Restart(ctx context.Context, w io.Writer) error { + if _, err := fmt.Fprintf(w, " restarting network\n"); err != nil { + return err + } + for _, node := range n.Nodes { + if err := node.Stop(ctx); err != nil { + return fmt.Errorf("failed to stop node %s: %w", node.NodeID, err) + } + if err := n.StartNode(ctx, w, node); err != nil { + return fmt.Errorf("failed to start node %s: %w", node.NodeID, err) + } + if _, err := fmt.Fprintf(w, " waiting for node %s to report healthy\n", node.NodeID); err != nil { + return err + } + if err := WaitForHealthy(ctx, node); err != nil { + return err + } + } + return nil +} + // Ensures the provided node has the configuration it needs to start. If the data dir is not // set, it will be defaulted to [nodeParentDir]/[node ID]. For a not-yet-created network, // no action will be taken. @@ -359,9 +485,141 @@ func (n *Network) EnsureNodeConfig(node *Node) error { } } + // Ensure available subnets are tracked + subnetIDs := make([]string, 0, len(n.Subnets)) + for _, subnet := range n.Subnets { + if subnet.SubnetID == ids.Empty { + continue + } + subnetIDs = append(subnetIDs, subnet.SubnetID.String()) + } + flags[config.TrackSubnetsKey] = strings.Join(subnetIDs, ",") + + return nil +} + +func (n *Network) GetSubnet(name string) *Subnet { + for _, subnet := range n.Subnets { + if subnet.Name == name { + return subnet + } + } + return nil +} + +// Ensure that each subnet on the network is created and that it is validated by all non-ephemeral nodes. +func (n *Network) CreateSubnets(ctx context.Context, w io.Writer) error { + createdSubnets := make([]*Subnet, 0, len(n.Subnets)) + for _, subnet := range n.Subnets { + if _, err := fmt.Fprintf(w, "Creating subnet %q\n", subnet.Name); err != nil { + return err + } + if subnet.SubnetID != ids.Empty { + // The subnet already exists + continue + } + + if subnet.OwningKey == nil { + // Allocate a pre-funded key and remove it from the network so it won't be used for + // other purposes + if len(n.PreFundedKeys) == 0 { + return fmt.Errorf("no pre-funded keys available to create subnet %q", subnet.Name) + } + subnet.OwningKey = n.PreFundedKeys[len(n.PreFundedKeys)-1] + n.PreFundedKeys = n.PreFundedKeys[:len(n.PreFundedKeys)-1] + } + + // Create the subnet on the network + if err := subnet.Create(ctx, n.Nodes[0].URI); err != nil { + return err + } + + if _, err := fmt.Fprintf(w, " created subnet %q as %q\n", subnet.Name, subnet.SubnetID); err != nil { + return err + } + + // Persist the subnet configuration + if err := subnet.Write(n.getSubnetDir(), n.getChainConfigDir()); err != nil { + return err + } + + if _, err := fmt.Fprintf(w, " wrote configuration for subnet %q\n", subnet.Name); err != nil { + return err + } + + createdSubnets = append(createdSubnets, subnet) + } + + if len(createdSubnets) == 0 { + return nil + } + + // Ensure the in-memory subnet state + n.Subnets = append(n.Subnets, createdSubnets...) + + // Ensure the pre-funded key changes are persisted to disk + if err := n.Write(); err != nil { + return err + } + + // Reconfigure nodes for the new subnets and their chains + if _, err := fmt.Fprintf(w, "Configured nodes to track new subnet(s). Restart is required.\n"); err != nil { + return err + } + for _, node := range n.Nodes { + if err := n.EnsureNodeConfig(node); err != nil { + return err + } + } + + // Restart nodes to allow new configuration to take effect + if err := n.Restart(ctx, w); err != nil { + return err + } + + // Add each node as a subnet validator + for _, subnet := range createdSubnets { + if _, err := fmt.Fprintf(w, "Adding validators for subnet %q\n", subnet.Name); err != nil { + return err + } + if err := subnet.AddValidators(ctx, w, n.Nodes); err != nil { + return err + } + } + + // Wait for nodes to become subnet validators + pChainClient := platformvm.NewClient(n.Nodes[0].URI) + for _, subnet := range createdSubnets { + if err := waitForActiveValidators(ctx, w, pChainClient, subnet); err != nil { + return err + } + + // It should now be safe to create chains for the subnet + if err := subnet.CreateChains(ctx, w, n.Nodes[0].URI); err != nil { + return err + } + + // Persist the chain configuration + if err := subnet.Write(n.getSubnetDir(), n.getChainConfigDir()); err != nil { + return err + } + if _, err := fmt.Fprintf(w, " wrote chain configuration for subnet %q\n", subnet.Name); err != nil { + return err + } + } + return nil } +func (n *Network) GetURIForNodeID(nodeID ids.NodeID) (string, error) { + for _, node := range n.Nodes { + if node.NodeID == nodeID { + return node.URI, nil + } + } + return "", fmt.Errorf("%s is not known to the network", nodeID) +} + func (n *Network) GetNodeURIs() []NodeURI { return GetNodeURIs(n.Nodes) } diff --git a/tests/fixture/tmpnet/network_config.go b/tests/fixture/tmpnet/network_config.go index 967a2b1b4ee3..4c68af240e98 100644 --- a/tests/fixture/tmpnet/network_config.go +++ b/tests/fixture/tmpnet/network_config.go @@ -25,7 +25,10 @@ func (n *Network) Read() error { if err := n.readNetwork(); err != nil { return err } - return n.readNodes() + if err := n.readNodes(); err != nil { + return err + } + return n.readSubnets() } // Write network configuration to disk. @@ -218,3 +221,16 @@ func (n *Network) writeEnvFile() error { } return nil } + +func (n *Network) getSubnetDir() string { + return filepath.Join(n.Dir, defaultSubnetDirName) +} + +func (n *Network) readSubnets() error { + subnets, err := readSubnets(n.getSubnetDir()) + if err != nil { + return err + } + n.Subnets = subnets + return nil +} diff --git a/tests/fixture/tmpnet/network_test.go b/tests/fixture/tmpnet/network_test.go index 3cbbb8ffcae8..c04c497c2485 100644 --- a/tests/fixture/tmpnet/network_test.go +++ b/tests/fixture/tmpnet/network_test.go @@ -15,10 +15,9 @@ func TestNetworkSerialization(t *testing.T) { tmpDir := t.TempDir() - network, err := NewDefaultNetwork(&bytes.Buffer{}, "/path/to/avalanche/go", 1) - require.NoError(err) + network := &Network{} + require.NoError(network.EnsureDefaultConfig(&bytes.Buffer{}, "/path/to/avalanche/go", "", 1)) require.NoError(network.Create(tmpDir)) - // Ensure node runtime is initialized require.NoError(network.readNodes()) diff --git a/tests/fixture/tmpnet/node.go b/tests/fixture/tmpnet/node.go index d1f97c7ead9c..59025b649112 100644 --- a/tests/fixture/tmpnet/node.go +++ b/tests/fixture/tmpnet/node.go @@ -83,6 +83,15 @@ func NewNode(dataDir string) *Node { } } +// Initializes the specified number of nodes. +func NewNodes(count int) []*Node { + nodes := make([]*Node, count) + for i := range nodes { + nodes[i] = NewNode("") + } + return nodes +} + // Reads a node's configuration from the specified directory. func ReadNode(dataDir string) (*Node, error) { node := NewNode(dataDir) diff --git a/tests/fixture/tmpnet/subnet.go b/tests/fixture/tmpnet/subnet.go new file mode 100644 index 000000000000..0eb1feab5f38 --- /dev/null +++ b/tests/fixture/tmpnet/subnet.go @@ -0,0 +1,333 @@ +// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +package tmpnet + +import ( + "context" + "encoding/json" + "fmt" + "io" + "os" + "path/filepath" + "time" + + "github.com/ava-labs/avalanchego/ids" + "github.com/ava-labs/avalanchego/utils/constants" + "github.com/ava-labs/avalanchego/utils/crypto/secp256k1" + "github.com/ava-labs/avalanchego/utils/perms" + "github.com/ava-labs/avalanchego/utils/set" + "github.com/ava-labs/avalanchego/utils/units" + "github.com/ava-labs/avalanchego/vms/platformvm" + "github.com/ava-labs/avalanchego/vms/platformvm/txs" + "github.com/ava-labs/avalanchego/vms/secp256k1fx" + "github.com/ava-labs/avalanchego/wallet/subnet/primary" + "github.com/ava-labs/avalanchego/wallet/subnet/primary/common" +) + +const defaultSubnetDirName = "subnets" + +type Chain struct { + // Set statically + VMID ids.ID + Config string + Genesis []byte + + // Set at runtime + ChainID ids.ID + PreFundedKey *secp256k1.PrivateKey +} + +// Write the chain configuration to the specified directory. +func (c *Chain) WriteConfig(chainDir string) error { + if len(c.Config) == 0 { + return nil + } + + chainConfigDir := filepath.Join(chainDir, c.ChainID.String()) + if err := os.MkdirAll(chainConfigDir, perms.ReadWriteExecute); err != nil { + return fmt.Errorf("failed to create chain config dir: %w", err) + } + + path := filepath.Join(chainConfigDir, defaultConfigFilename) + if err := os.WriteFile(path, []byte(c.Config), perms.ReadWrite); err != nil { + return fmt.Errorf("failed to write chain config: %w", err) + } + + return nil +} + +type Subnet struct { + // A unique string that can be used to refer to the subnet across different temporary + // networks (since the SubnetID will be different every time the subnet is created) + Name string + + // The ID of the transaction that created the subnet + SubnetID ids.ID + + // The private key that owns the subnet + OwningKey *secp256k1.PrivateKey + + // IDs of the nodes responsible for validating the subnet + ValidatorIDs []ids.NodeID + + Chains []*Chain +} + +// Retrieves a wallet configured for use with the subnet +func (s *Subnet) GetWallet(ctx context.Context, uri string) (primary.Wallet, error) { + keychain := secp256k1fx.NewKeychain(s.OwningKey) + + // Only fetch the subnet transaction if a subnet ID is present. This won't be true when + // the wallet is first used to create the subnet. + txIDs := set.Set[ids.ID]{} + if s.SubnetID != ids.Empty { + txIDs.Add(s.SubnetID) + } + + return primary.MakeWallet(ctx, &primary.WalletConfig{ + URI: uri, + AVAXKeychain: keychain, + EthKeychain: keychain, + PChainTxsToFetch: txIDs, + }) +} + +// Issues the subnet creation transaction and retains the result. The URI of a node is +// required to issue the transaction. +func (s *Subnet) Create(ctx context.Context, uri string) error { + wallet, err := s.GetWallet(ctx, uri) + if err != nil { + return err + } + pWallet := wallet.P() + + subnetTx, err := pWallet.IssueCreateSubnetTx( + &secp256k1fx.OutputOwners{ + Threshold: 1, + Addrs: []ids.ShortID{ + s.OwningKey.Address(), + }, + }, + common.WithContext(ctx), + ) + if err != nil { + return fmt.Errorf("failed to create subnet %s: %w", s.Name, err) + } + s.SubnetID = subnetTx.ID() + + return nil +} + +func (s *Subnet) CreateChains(ctx context.Context, w io.Writer, uri string) error { + wallet, err := s.GetWallet(ctx, uri) + if err != nil { + return err + } + pWallet := wallet.P() + + if _, err := fmt.Fprintf(w, "Creating chains for subnet %q\n", s.Name); err != nil { + return err + } + + for _, chain := range s.Chains { + createChainTx, err := pWallet.IssueCreateChainTx( + s.SubnetID, + chain.Genesis, + chain.VMID, + nil, + "", + common.WithContext(ctx), + ) + if err != nil { + return fmt.Errorf("failed to create chain: %w", err) + } + chain.ChainID = createChainTx.ID() + + if _, err := fmt.Fprintf(w, " created chain %q for VM %q on subnet %q\n", chain.ChainID, chain.VMID, s.Name); err != nil { + return err + } + } + return nil +} + +// Add validators to the subnet +func (s *Subnet) AddValidators(ctx context.Context, w io.Writer, nodes []*Node) error { + apiURI := nodes[0].URI + + wallet, err := s.GetWallet(ctx, apiURI) + if err != nil { + return err + } + pWallet := wallet.P() + + // Collect the end times for current validators to reuse for subnet validators + pvmClient := platformvm.NewClient(apiURI) + validators, err := pvmClient.GetCurrentValidators(ctx, constants.PrimaryNetworkID, nil) + if err != nil { + return err + } + endTimes := make(map[ids.NodeID]uint64) + for _, validator := range validators { + endTimes[validator.NodeID] = validator.EndTime + } + + startTime := time.Now().Add(DefaultValidatorStartTimeDiff) + for _, node := range nodes { + endTime, ok := endTimes[node.NodeID] + if !ok { + return fmt.Errorf("failed to find end time for %s", node.NodeID) + } + + _, err := pWallet.IssueAddSubnetValidatorTx( + &txs.SubnetValidator{ + Validator: txs.Validator{ + NodeID: node.NodeID, + Start: uint64(startTime.Unix()), + End: endTime, + Wght: units.Schmeckle, + }, + Subnet: s.SubnetID, + }, + common.WithContext(ctx), + ) + if err != nil { + return err + } + + if _, err := fmt.Fprintf(w, " added %s as validator for subnet `%s`\n", node.NodeID, s.Name); err != nil { + return err + } + + s.ValidatorIDs = append(s.ValidatorIDs, node.NodeID) + } + + return nil +} + +// Write the subnet configuration to disk +func (s *Subnet) Write(subnetDir string, chainDir string) error { + if err := os.MkdirAll(subnetDir, perms.ReadWriteExecute); err != nil { + return fmt.Errorf("failed to create subnet dir: %w", err) + } + path := filepath.Join(subnetDir, s.Name+".json") + + // Since subnets are expected to be serialized for the first time + // without their chains having been created (i.e. chains will have + // empty IDs), use the absence of chain IDs as a prompt for a + // subnet name uniquness check. + if len(s.Chains) > 0 && s.Chains[0].ChainID == ids.Empty { + _, err := os.Stat(path) + if err != nil && !os.IsNotExist(err) { + return err + } + if err == nil { + return fmt.Errorf("a subnet with name %s already exists", s.Name) + } + } + + bytes, err := DefaultJSONMarshal(s) + if err != nil { + return fmt.Errorf("failed to marshal subnet %s: %w", s.Name, err) + } + if err := os.WriteFile(path, bytes, perms.ReadWrite); err != nil { + return fmt.Errorf("failed to write subnet %s: %w", s.Name, err) + } + + for _, chain := range s.Chains { + if err := chain.WriteConfig(chainDir); err != nil { + return err + } + } + + return nil +} + +func waitForActiveValidators( + ctx context.Context, + w io.Writer, + pChainClient platformvm.Client, + subnet *Subnet, +) error { + ticker := time.NewTicker(DefaultPollingInterval) + defer ticker.Stop() + + if _, err := fmt.Fprintf(w, "Waiting for validators of subnet %q to become active\n", subnet.Name); err != nil { + return err + } + + if _, err := fmt.Fprintf(w, " "); err != nil { + return err + } + + for { + if _, err := fmt.Fprintf(w, "."); err != nil { + return err + } + validators, err := pChainClient.GetCurrentValidators(ctx, subnet.SubnetID, nil) + if err != nil { + return err + } + validatorSet := set.NewSet[ids.NodeID](len(validators)) + for _, validator := range validators { + validatorSet.Add(validator.NodeID) + } + allActive := true + for _, validatorID := range subnet.ValidatorIDs { + if !validatorSet.Contains(validatorID) { + allActive = false + } + } + if allActive { + if _, err := fmt.Fprintf(w, "\n saw the expected active validators of subnet %q\n", subnet.Name); err != nil { + return err + } + return nil + } + + select { + case <-ctx.Done(): + return fmt.Errorf("failed to see the expected active validators of subnet %q before timeout", subnet.Name) + case <-ticker.C: + } + } +} + +// Reads subnets from [network dir]/subnets/[subnet name].json +func readSubnets(subnetDir string) ([]*Subnet, error) { + if _, err := os.Stat(subnetDir); os.IsNotExist(err) { + return nil, nil + } else if err != nil { + return nil, err + } + + entries, err := os.ReadDir(subnetDir) + if err != nil { + return nil, fmt.Errorf("failed to read subnet dir: %w", err) + } + + subnets := []*Subnet{} + for _, entry := range entries { + if entry.IsDir() { + // Looking only for files + continue + } + if filepath.Ext(entry.Name()) != ".json" { + // Subnet files should have a .json extension + continue + } + + subnetPath := filepath.Join(subnetDir, entry.Name()) + bytes, err := os.ReadFile(subnetPath) + if err != nil { + return nil, fmt.Errorf("failed to read subnet file %s: %w", subnetPath, err) + } + subnet := &Subnet{} + if err := json.Unmarshal(bytes, subnet); err != nil { + return nil, fmt.Errorf("failed to unmarshal subnet from %s: %w", subnetPath, err) + } + subnets = append(subnets, subnet) + } + + return subnets, nil +} diff --git a/tests/upgrade/upgrade_test.go b/tests/upgrade/upgrade_test.go index 37c2fd259e66..4dba94c17f23 100644 --- a/tests/upgrade/upgrade_test.go +++ b/tests/upgrade/upgrade_test.go @@ -15,6 +15,7 @@ import ( "github.com/stretchr/testify/require" "github.com/ava-labs/avalanchego/tests/fixture/e2e" + "github.com/ava-labs/avalanchego/tests/fixture/tmpnet" ) func TestUpgrade(t *testing.T) { @@ -46,7 +47,8 @@ var _ = ginkgo.Describe("[Upgrade]", func() { require := require.New(ginkgo.GinkgoT()) ginkgo.It("can upgrade versions", func() { - network := e2e.StartNetwork(avalancheGoExecPath, e2e.DefaultNetworkDir) + network := &tmpnet.Network{} + e2e.StartNetwork(network, e2e.DefaultNetworkDir, avalancheGoExecPath, "" /* pluginDir */) ginkgo.By(fmt.Sprintf("restarting all nodes with %q binary", avalancheGoExecPathToUpgradeTo)) for _, node := range network.Nodes { From 0fcc746f0a6a0178ca5e9e5f8d1bcd83d1207d24 Mon Sep 17 00:00:00 2001 From: Dhruba Basu <7675102+dhrubabasu@users.noreply.github.com> Date: Wed, 17 Jan 2024 11:13:01 -0500 Subject: [PATCH 44/57] Update `go.uber.org/mock/gomock` to `v0.4.0` (#2618) --- api/server/mock_server.go | 23 +- chains/atomic/mock_shared_memory.go | 15 +- codec/mock_manager.go | 19 +- database/mock_batch.go | 11 +- database/mock_iterator.go | 5 + go.mod | 2 +- go.sum | 4 +- message/mock_message.go | 5 + message/mock_outbound_message_builder.go | 51 +++-- network/p2p/validators_test.go | 2 +- scripts/mock.gen.sh | 2 +- snow/consensus/snowman/mock_block.go | 11 +- snow/engine/avalanche/vertex/mock_vm.go | 57 ++--- .../block/mock_build_block_with_context_vm.go | 7 +- snow/engine/snowman/block/mock_chain_vm.go | 53 +++-- .../snowman/block/mock_state_syncable_vm.go | 15 +- .../snowman/block/mock_with_verify_context.go | 9 +- snow/networking/handler/mock_handler.go | 29 ++- snow/networking/timeout/mock_manager.go | 15 +- .../tracker/mock_resource_tracker.go | 9 +- snow/networking/tracker/mock_targeter.go | 7 +- snow/uptime/mock_calculator.go | 11 +- snow/validators/mock_state.go | 13 +- snow/validators/mock_subnet_connector.go | 7 +- utils/crypto/keychain/mock_ledger.go | 13 +- utils/filesystem/mock_io.go | 7 +- utils/hashing/consistent/ring_test.go | 2 +- utils/hashing/mock_hasher.go | 7 +- utils/resource/mock_user.go | 5 + vms/avm/block/mock_block.go | 9 +- vms/avm/metrics/mock_metrics.go | 13 +- vms/avm/state/mock_state.go | 73 +++--- vms/avm/txs/mempool/mock_mempool.go | 19 +- vms/components/avax/mock_transferable_in.go | 7 +- vms/components/verify/mock_verifiable.go | 5 + vms/mock_manager.go | 27 ++- vms/platformvm/block/mock_block.go | 11 +- vms/platformvm/state/mock_staker_iterator.go | 5 + vms/platformvm/state/mock_state.go | 211 +++++++++--------- vms/platformvm/txs/mempool/mock_mempool.go | 21 +- vms/platformvm/utxo/mock_verifier.go | 9 +- vms/proposervm/mock_post_fork_block.go | 27 ++- vms/proposervm/proposer/mock_windower.go | 13 +- vms/proposervm/scheduler/mock_scheduler.go | 9 +- vms/proposervm/state/mock_state.go | 23 +- vms/registry/mock_vm_getter.go | 5 + vms/registry/mock_vm_registry.go | 7 +- x/sync/mock_client.go | 9 +- x/sync/mock_network_client.go | 17 +- 49 files changed, 578 insertions(+), 358 deletions(-) diff --git a/api/server/mock_server.go b/api/server/mock_server.go index b30b36e50ac8..769df9baa26f 100644 --- a/api/server/mock_server.go +++ b/api/server/mock_server.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/api/server (interfaces: Server) +// +// Generated by this command: +// +// mockgen -package=server -destination=api/server/mock_server.go github.com/ava-labs/avalanchego/api/server Server +// // Package server is a generated GoMock package. package server @@ -39,7 +44,7 @@ func (m *MockServer) EXPECT() *MockServerMockRecorder { // AddAliases mocks base method. func (m *MockServer) AddAliases(arg0 string, arg1 ...string) error { m.ctrl.T.Helper() - varargs := []interface{}{arg0} + varargs := []any{arg0} for _, a := range arg1 { varargs = append(varargs, a) } @@ -49,16 +54,16 @@ func (m *MockServer) AddAliases(arg0 string, arg1 ...string) error { } // AddAliases indicates an expected call of AddAliases. -func (mr *MockServerMockRecorder) AddAliases(arg0 interface{}, arg1 ...interface{}) *gomock.Call { +func (mr *MockServerMockRecorder) AddAliases(arg0 any, arg1 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0}, arg1...) + varargs := append([]any{arg0}, arg1...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddAliases", reflect.TypeOf((*MockServer)(nil).AddAliases), varargs...) } // AddAliasesWithReadLock mocks base method. func (m *MockServer) AddAliasesWithReadLock(arg0 string, arg1 ...string) error { m.ctrl.T.Helper() - varargs := []interface{}{arg0} + varargs := []any{arg0} for _, a := range arg1 { varargs = append(varargs, a) } @@ -68,9 +73,9 @@ func (m *MockServer) AddAliasesWithReadLock(arg0 string, arg1 ...string) error { } // AddAliasesWithReadLock indicates an expected call of AddAliasesWithReadLock. -func (mr *MockServerMockRecorder) AddAliasesWithReadLock(arg0 interface{}, arg1 ...interface{}) *gomock.Call { +func (mr *MockServerMockRecorder) AddAliasesWithReadLock(arg0 any, arg1 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0}, arg1...) + varargs := append([]any{arg0}, arg1...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddAliasesWithReadLock", reflect.TypeOf((*MockServer)(nil).AddAliasesWithReadLock), varargs...) } @@ -83,7 +88,7 @@ func (m *MockServer) AddRoute(arg0 http.Handler, arg1, arg2 string) error { } // AddRoute indicates an expected call of AddRoute. -func (mr *MockServerMockRecorder) AddRoute(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockServerMockRecorder) AddRoute(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddRoute", reflect.TypeOf((*MockServer)(nil).AddRoute), arg0, arg1, arg2) } @@ -97,7 +102,7 @@ func (m *MockServer) AddRouteWithReadLock(arg0 http.Handler, arg1, arg2 string) } // AddRouteWithReadLock indicates an expected call of AddRouteWithReadLock. -func (mr *MockServerMockRecorder) AddRouteWithReadLock(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockServerMockRecorder) AddRouteWithReadLock(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddRouteWithReadLock", reflect.TypeOf((*MockServer)(nil).AddRouteWithReadLock), arg0, arg1, arg2) } @@ -123,7 +128,7 @@ func (m *MockServer) RegisterChain(arg0 string, arg1 *snow.ConsensusContext, arg } // RegisterChain indicates an expected call of RegisterChain. -func (mr *MockServerMockRecorder) RegisterChain(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockServerMockRecorder) RegisterChain(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterChain", reflect.TypeOf((*MockServer)(nil).RegisterChain), arg0, arg1, arg2) } diff --git a/chains/atomic/mock_shared_memory.go b/chains/atomic/mock_shared_memory.go index b6afac750e70..0e63179314da 100644 --- a/chains/atomic/mock_shared_memory.go +++ b/chains/atomic/mock_shared_memory.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/chains/atomic (interfaces: SharedMemory) +// +// Generated by this command: +// +// mockgen -package=atomic -destination=chains/atomic/mock_shared_memory.go github.com/ava-labs/avalanchego/chains/atomic SharedMemory +// // Package atomic is a generated GoMock package. package atomic @@ -38,7 +43,7 @@ func (m *MockSharedMemory) EXPECT() *MockSharedMemoryMockRecorder { // Apply mocks base method. func (m *MockSharedMemory) Apply(arg0 map[ids.ID]*Requests, arg1 ...database.Batch) error { m.ctrl.T.Helper() - varargs := []interface{}{arg0} + varargs := []any{arg0} for _, a := range arg1 { varargs = append(varargs, a) } @@ -48,9 +53,9 @@ func (m *MockSharedMemory) Apply(arg0 map[ids.ID]*Requests, arg1 ...database.Bat } // Apply indicates an expected call of Apply. -func (mr *MockSharedMemoryMockRecorder) Apply(arg0 interface{}, arg1 ...interface{}) *gomock.Call { +func (mr *MockSharedMemoryMockRecorder) Apply(arg0 any, arg1 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0}, arg1...) + varargs := append([]any{arg0}, arg1...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Apply", reflect.TypeOf((*MockSharedMemory)(nil).Apply), varargs...) } @@ -64,7 +69,7 @@ func (m *MockSharedMemory) Get(arg0 ids.ID, arg1 [][]byte) ([][]byte, error) { } // Get indicates an expected call of Get. -func (mr *MockSharedMemoryMockRecorder) Get(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockSharedMemoryMockRecorder) Get(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockSharedMemory)(nil).Get), arg0, arg1) } @@ -81,7 +86,7 @@ func (m *MockSharedMemory) Indexed(arg0 ids.ID, arg1 [][]byte, arg2, arg3 []byte } // Indexed indicates an expected call of Indexed. -func (mr *MockSharedMemoryMockRecorder) Indexed(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { +func (mr *MockSharedMemoryMockRecorder) Indexed(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Indexed", reflect.TypeOf((*MockSharedMemory)(nil).Indexed), arg0, arg1, arg2, arg3, arg4) } diff --git a/codec/mock_manager.go b/codec/mock_manager.go index 53fe543f8984..36bbae57e96f 100644 --- a/codec/mock_manager.go +++ b/codec/mock_manager.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/codec (interfaces: Manager) +// +// Generated by this command: +// +// mockgen -package=codec -destination=codec/mock_manager.go github.com/ava-labs/avalanchego/codec Manager +// // Package codec is a generated GoMock package. package codec @@ -34,7 +39,7 @@ func (m *MockManager) EXPECT() *MockManagerMockRecorder { } // Marshal mocks base method. -func (m *MockManager) Marshal(arg0 uint16, arg1 interface{}) ([]byte, error) { +func (m *MockManager) Marshal(arg0 uint16, arg1 any) ([]byte, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Marshal", arg0, arg1) ret0, _ := ret[0].([]byte) @@ -43,7 +48,7 @@ func (m *MockManager) Marshal(arg0 uint16, arg1 interface{}) ([]byte, error) { } // Marshal indicates an expected call of Marshal. -func (mr *MockManagerMockRecorder) Marshal(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) Marshal(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Marshal", reflect.TypeOf((*MockManager)(nil).Marshal), arg0, arg1) } @@ -57,13 +62,13 @@ func (m *MockManager) RegisterCodec(arg0 uint16, arg1 Codec) error { } // RegisterCodec indicates an expected call of RegisterCodec. -func (mr *MockManagerMockRecorder) RegisterCodec(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) RegisterCodec(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterCodec", reflect.TypeOf((*MockManager)(nil).RegisterCodec), arg0, arg1) } // Size mocks base method. -func (m *MockManager) Size(arg0 uint16, arg1 interface{}) (int, error) { +func (m *MockManager) Size(arg0 uint16, arg1 any) (int, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Size", arg0, arg1) ret0, _ := ret[0].(int) @@ -72,13 +77,13 @@ func (m *MockManager) Size(arg0 uint16, arg1 interface{}) (int, error) { } // Size indicates an expected call of Size. -func (mr *MockManagerMockRecorder) Size(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) Size(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Size", reflect.TypeOf((*MockManager)(nil).Size), arg0, arg1) } // Unmarshal mocks base method. -func (m *MockManager) Unmarshal(arg0 []byte, arg1 interface{}) (uint16, error) { +func (m *MockManager) Unmarshal(arg0 []byte, arg1 any) (uint16, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Unmarshal", arg0, arg1) ret0, _ := ret[0].(uint16) @@ -87,7 +92,7 @@ func (m *MockManager) Unmarshal(arg0 []byte, arg1 interface{}) (uint16, error) { } // Unmarshal indicates an expected call of Unmarshal. -func (mr *MockManagerMockRecorder) Unmarshal(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) Unmarshal(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Unmarshal", reflect.TypeOf((*MockManager)(nil).Unmarshal), arg0, arg1) } diff --git a/database/mock_batch.go b/database/mock_batch.go index 552d917fc95f..e3762514954f 100644 --- a/database/mock_batch.go +++ b/database/mock_batch.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/database (interfaces: Batch) +// +// Generated by this command: +// +// mockgen -package=database -destination=database/mock_batch.go github.com/ava-labs/avalanchego/database Batch +// // Package database is a generated GoMock package. package database @@ -42,7 +47,7 @@ func (m *MockBatch) Delete(arg0 []byte) error { } // Delete indicates an expected call of Delete. -func (mr *MockBatchMockRecorder) Delete(arg0 interface{}) *gomock.Call { +func (mr *MockBatchMockRecorder) Delete(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockBatch)(nil).Delete), arg0) } @@ -70,7 +75,7 @@ func (m *MockBatch) Put(arg0, arg1 []byte) error { } // Put indicates an expected call of Put. -func (mr *MockBatchMockRecorder) Put(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBatchMockRecorder) Put(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Put", reflect.TypeOf((*MockBatch)(nil).Put), arg0, arg1) } @@ -84,7 +89,7 @@ func (m *MockBatch) Replay(arg0 KeyValueWriterDeleter) error { } // Replay indicates an expected call of Replay. -func (mr *MockBatchMockRecorder) Replay(arg0 interface{}) *gomock.Call { +func (mr *MockBatchMockRecorder) Replay(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Replay", reflect.TypeOf((*MockBatch)(nil).Replay), arg0) } diff --git a/database/mock_iterator.go b/database/mock_iterator.go index 7703e89206a3..77856c92ea5e 100644 --- a/database/mock_iterator.go +++ b/database/mock_iterator.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/database (interfaces: Iterator) +// +// Generated by this command: +// +// mockgen -package=database -destination=database/mock_iterator.go github.com/ava-labs/avalanchego/database Iterator +// // Package database is a generated GoMock package. package database diff --git a/go.mod b/go.mod index 5f2bea429f7b..f85c1327317b 100644 --- a/go.mod +++ b/go.mod @@ -54,7 +54,7 @@ require ( go.opentelemetry.io/otel/sdk v1.11.0 go.opentelemetry.io/otel/trace v1.11.0 go.uber.org/goleak v1.2.1 - go.uber.org/mock v0.2.0 + go.uber.org/mock v0.4.0 go.uber.org/zap v1.26.0 golang.org/x/crypto v0.17.0 golang.org/x/exp v0.0.0-20231127185646-65229373498e diff --git a/go.sum b/go.sum index 489a6ee12e1d..d963cb879e44 100644 --- a/go.sum +++ b/go.sum @@ -669,8 +669,8 @@ go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4= -go.uber.org/mock v0.2.0 h1:TaP3xedm7JaAgScZO7tlvlKrqT0p7I6OsdGB5YNSMDU= -go.uber.org/mock v0.2.0/go.mod h1:J0y0rp9L3xiff1+ZBfKxlC1fz2+aO16tw0tsDOixfuM= +go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= +go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= diff --git a/message/mock_message.go b/message/mock_message.go index e52a665b7575..ea6b9a67afcf 100644 --- a/message/mock_message.go +++ b/message/mock_message.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/message (interfaces: OutboundMessage) +// +// Generated by this command: +// +// mockgen -package=message -destination=message/mock_message.go github.com/ava-labs/avalanchego/message OutboundMessage +// // Package message is a generated GoMock package. package message diff --git a/message/mock_outbound_message_builder.go b/message/mock_outbound_message_builder.go index 21cb518976ae..0d053f71090b 100644 --- a/message/mock_outbound_message_builder.go +++ b/message/mock_outbound_message_builder.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/message (interfaces: OutboundMsgBuilder) +// +// Generated by this command: +// +// mockgen -package=message -destination=message/mock_outbound_message_builder.go github.com/ava-labs/avalanchego/message OutboundMsgBuilder +// // Package message is a generated GoMock package. package message @@ -47,7 +52,7 @@ func (m *MockOutboundMsgBuilder) Accepted(arg0 ids.ID, arg1 uint32, arg2 []ids.I } // Accepted indicates an expected call of Accepted. -func (mr *MockOutboundMsgBuilderMockRecorder) Accepted(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockOutboundMsgBuilderMockRecorder) Accepted(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Accepted", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).Accepted), arg0, arg1, arg2) } @@ -62,7 +67,7 @@ func (m *MockOutboundMsgBuilder) AcceptedFrontier(arg0 ids.ID, arg1 uint32, arg2 } // AcceptedFrontier indicates an expected call of AcceptedFrontier. -func (mr *MockOutboundMsgBuilderMockRecorder) AcceptedFrontier(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockOutboundMsgBuilderMockRecorder) AcceptedFrontier(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AcceptedFrontier", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).AcceptedFrontier), arg0, arg1, arg2) } @@ -77,7 +82,7 @@ func (m *MockOutboundMsgBuilder) AcceptedStateSummary(arg0 ids.ID, arg1 uint32, } // AcceptedStateSummary indicates an expected call of AcceptedStateSummary. -func (mr *MockOutboundMsgBuilderMockRecorder) AcceptedStateSummary(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockOutboundMsgBuilderMockRecorder) AcceptedStateSummary(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AcceptedStateSummary", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).AcceptedStateSummary), arg0, arg1, arg2) } @@ -92,7 +97,7 @@ func (m *MockOutboundMsgBuilder) Ancestors(arg0 ids.ID, arg1 uint32, arg2 [][]by } // Ancestors indicates an expected call of Ancestors. -func (mr *MockOutboundMsgBuilderMockRecorder) Ancestors(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockOutboundMsgBuilderMockRecorder) Ancestors(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Ancestors", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).Ancestors), arg0, arg1, arg2) } @@ -107,7 +112,7 @@ func (m *MockOutboundMsgBuilder) AppGossip(arg0 ids.ID, arg1 []byte) (OutboundMe } // AppGossip indicates an expected call of AppGossip. -func (mr *MockOutboundMsgBuilderMockRecorder) AppGossip(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockOutboundMsgBuilderMockRecorder) AppGossip(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AppGossip", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).AppGossip), arg0, arg1) } @@ -122,7 +127,7 @@ func (m *MockOutboundMsgBuilder) AppRequest(arg0 ids.ID, arg1 uint32, arg2 time. } // AppRequest indicates an expected call of AppRequest. -func (mr *MockOutboundMsgBuilderMockRecorder) AppRequest(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockOutboundMsgBuilderMockRecorder) AppRequest(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AppRequest", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).AppRequest), arg0, arg1, arg2, arg3) } @@ -137,7 +142,7 @@ func (m *MockOutboundMsgBuilder) AppResponse(arg0 ids.ID, arg1 uint32, arg2 []by } // AppResponse indicates an expected call of AppResponse. -func (mr *MockOutboundMsgBuilderMockRecorder) AppResponse(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockOutboundMsgBuilderMockRecorder) AppResponse(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AppResponse", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).AppResponse), arg0, arg1, arg2) } @@ -152,7 +157,7 @@ func (m *MockOutboundMsgBuilder) Chits(arg0 ids.ID, arg1 uint32, arg2, arg3, arg } // Chits indicates an expected call of Chits. -func (mr *MockOutboundMsgBuilderMockRecorder) Chits(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { +func (mr *MockOutboundMsgBuilderMockRecorder) Chits(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Chits", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).Chits), arg0, arg1, arg2, arg3, arg4) } @@ -167,7 +172,7 @@ func (m *MockOutboundMsgBuilder) Get(arg0 ids.ID, arg1 uint32, arg2 time.Duratio } // Get indicates an expected call of Get. -func (mr *MockOutboundMsgBuilderMockRecorder) Get(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { +func (mr *MockOutboundMsgBuilderMockRecorder) Get(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).Get), arg0, arg1, arg2, arg3, arg4) } @@ -182,7 +187,7 @@ func (m *MockOutboundMsgBuilder) GetAccepted(arg0 ids.ID, arg1 uint32, arg2 time } // GetAccepted indicates an expected call of GetAccepted. -func (mr *MockOutboundMsgBuilderMockRecorder) GetAccepted(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { +func (mr *MockOutboundMsgBuilderMockRecorder) GetAccepted(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccepted", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).GetAccepted), arg0, arg1, arg2, arg3, arg4) } @@ -197,7 +202,7 @@ func (m *MockOutboundMsgBuilder) GetAcceptedFrontier(arg0 ids.ID, arg1 uint32, a } // GetAcceptedFrontier indicates an expected call of GetAcceptedFrontier. -func (mr *MockOutboundMsgBuilderMockRecorder) GetAcceptedFrontier(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockOutboundMsgBuilderMockRecorder) GetAcceptedFrontier(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAcceptedFrontier", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).GetAcceptedFrontier), arg0, arg1, arg2, arg3) } @@ -212,7 +217,7 @@ func (m *MockOutboundMsgBuilder) GetAcceptedStateSummary(arg0 ids.ID, arg1 uint3 } // GetAcceptedStateSummary indicates an expected call of GetAcceptedStateSummary. -func (mr *MockOutboundMsgBuilderMockRecorder) GetAcceptedStateSummary(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockOutboundMsgBuilderMockRecorder) GetAcceptedStateSummary(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAcceptedStateSummary", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).GetAcceptedStateSummary), arg0, arg1, arg2, arg3) } @@ -227,7 +232,7 @@ func (m *MockOutboundMsgBuilder) GetAncestors(arg0 ids.ID, arg1 uint32, arg2 tim } // GetAncestors indicates an expected call of GetAncestors. -func (mr *MockOutboundMsgBuilderMockRecorder) GetAncestors(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { +func (mr *MockOutboundMsgBuilderMockRecorder) GetAncestors(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAncestors", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).GetAncestors), arg0, arg1, arg2, arg3, arg4) } @@ -242,7 +247,7 @@ func (m *MockOutboundMsgBuilder) GetPeerList(arg0, arg1 []byte) (OutboundMessage } // GetPeerList indicates an expected call of GetPeerList. -func (mr *MockOutboundMsgBuilderMockRecorder) GetPeerList(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockOutboundMsgBuilderMockRecorder) GetPeerList(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPeerList", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).GetPeerList), arg0, arg1) } @@ -257,7 +262,7 @@ func (m *MockOutboundMsgBuilder) GetStateSummaryFrontier(arg0 ids.ID, arg1 uint3 } // GetStateSummaryFrontier indicates an expected call of GetStateSummaryFrontier. -func (mr *MockOutboundMsgBuilderMockRecorder) GetStateSummaryFrontier(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockOutboundMsgBuilderMockRecorder) GetStateSummaryFrontier(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStateSummaryFrontier", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).GetStateSummaryFrontier), arg0, arg1, arg2) } @@ -272,7 +277,7 @@ func (m *MockOutboundMsgBuilder) Handshake(arg0 uint32, arg1 uint64, arg2 ips.IP } // Handshake indicates an expected call of Handshake. -func (mr *MockOutboundMsgBuilderMockRecorder) Handshake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14 interface{}) *gomock.Call { +func (mr *MockOutboundMsgBuilderMockRecorder) Handshake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Handshake", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).Handshake), arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14) } @@ -287,7 +292,7 @@ func (m *MockOutboundMsgBuilder) PeerList(arg0 []*ips.ClaimedIPPort, arg1 bool) } // PeerList indicates an expected call of PeerList. -func (mr *MockOutboundMsgBuilderMockRecorder) PeerList(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockOutboundMsgBuilderMockRecorder) PeerList(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PeerList", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).PeerList), arg0, arg1) } @@ -302,7 +307,7 @@ func (m *MockOutboundMsgBuilder) Ping(arg0 uint32, arg1 []*p2p.SubnetUptime) (Ou } // Ping indicates an expected call of Ping. -func (mr *MockOutboundMsgBuilderMockRecorder) Ping(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockOutboundMsgBuilderMockRecorder) Ping(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Ping", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).Ping), arg0, arg1) } @@ -317,7 +322,7 @@ func (m *MockOutboundMsgBuilder) Pong(arg0 uint32, arg1 []*p2p.SubnetUptime) (Ou } // Pong indicates an expected call of Pong. -func (mr *MockOutboundMsgBuilderMockRecorder) Pong(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockOutboundMsgBuilderMockRecorder) Pong(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Pong", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).Pong), arg0, arg1) } @@ -332,7 +337,7 @@ func (m *MockOutboundMsgBuilder) PullQuery(arg0 ids.ID, arg1 uint32, arg2 time.D } // PullQuery indicates an expected call of PullQuery. -func (mr *MockOutboundMsgBuilderMockRecorder) PullQuery(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call { +func (mr *MockOutboundMsgBuilderMockRecorder) PullQuery(arg0, arg1, arg2, arg3, arg4, arg5 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PullQuery", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).PullQuery), arg0, arg1, arg2, arg3, arg4, arg5) } @@ -347,7 +352,7 @@ func (m *MockOutboundMsgBuilder) PushQuery(arg0 ids.ID, arg1 uint32, arg2 time.D } // PushQuery indicates an expected call of PushQuery. -func (mr *MockOutboundMsgBuilderMockRecorder) PushQuery(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call { +func (mr *MockOutboundMsgBuilderMockRecorder) PushQuery(arg0, arg1, arg2, arg3, arg4, arg5 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PushQuery", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).PushQuery), arg0, arg1, arg2, arg3, arg4, arg5) } @@ -362,7 +367,7 @@ func (m *MockOutboundMsgBuilder) Put(arg0 ids.ID, arg1 uint32, arg2 []byte, arg3 } // Put indicates an expected call of Put. -func (mr *MockOutboundMsgBuilderMockRecorder) Put(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockOutboundMsgBuilderMockRecorder) Put(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Put", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).Put), arg0, arg1, arg2, arg3) } @@ -377,7 +382,7 @@ func (m *MockOutboundMsgBuilder) StateSummaryFrontier(arg0 ids.ID, arg1 uint32, } // StateSummaryFrontier indicates an expected call of StateSummaryFrontier. -func (mr *MockOutboundMsgBuilderMockRecorder) StateSummaryFrontier(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockOutboundMsgBuilderMockRecorder) StateSummaryFrontier(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateSummaryFrontier", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).StateSummaryFrontier), arg0, arg1, arg2) } diff --git a/network/p2p/validators_test.go b/network/p2p/validators_test.go index a5d4e7724cdd..4671a20fdcae 100644 --- a/network/p2p/validators_test.go +++ b/network/p2p/validators_test.go @@ -158,7 +158,7 @@ func TestValidatorsSample(t *testing.T) { ctrl := gomock.NewController(t) mockValidators := validators.NewMockState(ctrl) - calls := make([]*gomock.Call, 0) + calls := make([]any, 0) for _, call := range tt.calls { calls = append(calls, mockValidators.EXPECT(). GetCurrentHeight(gomock.Any()).Return(call.height, call.getCurrentHeightErr)) diff --git a/scripts/mock.gen.sh b/scripts/mock.gen.sh index c3feff7a545c..a4e74488c5df 100755 --- a/scripts/mock.gen.sh +++ b/scripts/mock.gen.sh @@ -11,7 +11,7 @@ if ! command -v mockgen &> /dev/null then echo "mockgen not found, installing..." # https://github.com/uber-go/mock - go install -v go.uber.org/mock/mockgen@v0.2.0 + go install -v go.uber.org/mock/mockgen@v0.4.0 fi source ./scripts/constants.sh diff --git a/snow/consensus/snowman/mock_block.go b/snow/consensus/snowman/mock_block.go index 164df8d45e80..45393bfe7bdb 100644 --- a/snow/consensus/snowman/mock_block.go +++ b/snow/consensus/snowman/mock_block.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/snow/consensus/snowman (interfaces: Block) +// +// Generated by this command: +// +// mockgen -package=snowman -destination=snow/consensus/snowman/mock_block.go github.com/ava-labs/avalanchego/snow/consensus/snowman Block +// // Package snowman is a generated GoMock package. package snowman @@ -46,7 +51,7 @@ func (m *MockBlock) Accept(arg0 context.Context) error { } // Accept indicates an expected call of Accept. -func (mr *MockBlockMockRecorder) Accept(arg0 interface{}) *gomock.Call { +func (mr *MockBlockMockRecorder) Accept(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Accept", reflect.TypeOf((*MockBlock)(nil).Accept), arg0) } @@ -116,7 +121,7 @@ func (m *MockBlock) Reject(arg0 context.Context) error { } // Reject indicates an expected call of Reject. -func (mr *MockBlockMockRecorder) Reject(arg0 interface{}) *gomock.Call { +func (mr *MockBlockMockRecorder) Reject(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Reject", reflect.TypeOf((*MockBlock)(nil).Reject), arg0) } @@ -158,7 +163,7 @@ func (m *MockBlock) Verify(arg0 context.Context) error { } // Verify indicates an expected call of Verify. -func (mr *MockBlockMockRecorder) Verify(arg0 interface{}) *gomock.Call { +func (mr *MockBlockMockRecorder) Verify(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Verify", reflect.TypeOf((*MockBlock)(nil).Verify), arg0) } diff --git a/snow/engine/avalanche/vertex/mock_vm.go b/snow/engine/avalanche/vertex/mock_vm.go index c1b67c7421c6..7ad293f6313f 100644 --- a/snow/engine/avalanche/vertex/mock_vm.go +++ b/snow/engine/avalanche/vertex/mock_vm.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/snow/engine/avalanche/vertex (interfaces: LinearizableVM) +// +// Generated by this command: +// +// mockgen -package=vertex -destination=snow/engine/avalanche/vertex/mock_vm.go github.com/ava-labs/avalanchego/snow/engine/avalanche/vertex LinearizableVM +// // Package vertex is a generated GoMock package. package vertex @@ -52,7 +57,7 @@ func (m *MockLinearizableVM) AppGossip(arg0 context.Context, arg1 ids.NodeID, ar } // AppGossip indicates an expected call of AppGossip. -func (mr *MockLinearizableVMMockRecorder) AppGossip(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockLinearizableVMMockRecorder) AppGossip(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AppGossip", reflect.TypeOf((*MockLinearizableVM)(nil).AppGossip), arg0, arg1, arg2) } @@ -66,7 +71,7 @@ func (m *MockLinearizableVM) AppRequest(arg0 context.Context, arg1 ids.NodeID, a } // AppRequest indicates an expected call of AppRequest. -func (mr *MockLinearizableVMMockRecorder) AppRequest(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { +func (mr *MockLinearizableVMMockRecorder) AppRequest(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AppRequest", reflect.TypeOf((*MockLinearizableVM)(nil).AppRequest), arg0, arg1, arg2, arg3, arg4) } @@ -80,7 +85,7 @@ func (m *MockLinearizableVM) AppRequestFailed(arg0 context.Context, arg1 ids.Nod } // AppRequestFailed indicates an expected call of AppRequestFailed. -func (mr *MockLinearizableVMMockRecorder) AppRequestFailed(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockLinearizableVMMockRecorder) AppRequestFailed(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AppRequestFailed", reflect.TypeOf((*MockLinearizableVM)(nil).AppRequestFailed), arg0, arg1, arg2, arg3) } @@ -94,7 +99,7 @@ func (m *MockLinearizableVM) AppResponse(arg0 context.Context, arg1 ids.NodeID, } // AppResponse indicates an expected call of AppResponse. -func (mr *MockLinearizableVMMockRecorder) AppResponse(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockLinearizableVMMockRecorder) AppResponse(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AppResponse", reflect.TypeOf((*MockLinearizableVM)(nil).AppResponse), arg0, arg1, arg2, arg3) } @@ -109,7 +114,7 @@ func (m *MockLinearizableVM) BuildBlock(arg0 context.Context) (snowman.Block, er } // BuildBlock indicates an expected call of BuildBlock. -func (mr *MockLinearizableVMMockRecorder) BuildBlock(arg0 interface{}) *gomock.Call { +func (mr *MockLinearizableVMMockRecorder) BuildBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BuildBlock", reflect.TypeOf((*MockLinearizableVM)(nil).BuildBlock), arg0) } @@ -123,7 +128,7 @@ func (m *MockLinearizableVM) Connected(arg0 context.Context, arg1 ids.NodeID, ar } // Connected indicates an expected call of Connected. -func (mr *MockLinearizableVMMockRecorder) Connected(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockLinearizableVMMockRecorder) Connected(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Connected", reflect.TypeOf((*MockLinearizableVM)(nil).Connected), arg0, arg1, arg2) } @@ -138,7 +143,7 @@ func (m *MockLinearizableVM) CreateHandlers(arg0 context.Context) (map[string]ht } // CreateHandlers indicates an expected call of CreateHandlers. -func (mr *MockLinearizableVMMockRecorder) CreateHandlers(arg0 interface{}) *gomock.Call { +func (mr *MockLinearizableVMMockRecorder) CreateHandlers(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateHandlers", reflect.TypeOf((*MockLinearizableVM)(nil).CreateHandlers), arg0) } @@ -152,7 +157,7 @@ func (m *MockLinearizableVM) CrossChainAppRequest(arg0 context.Context, arg1 ids } // CrossChainAppRequest indicates an expected call of CrossChainAppRequest. -func (mr *MockLinearizableVMMockRecorder) CrossChainAppRequest(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { +func (mr *MockLinearizableVMMockRecorder) CrossChainAppRequest(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CrossChainAppRequest", reflect.TypeOf((*MockLinearizableVM)(nil).CrossChainAppRequest), arg0, arg1, arg2, arg3, arg4) } @@ -166,7 +171,7 @@ func (m *MockLinearizableVM) CrossChainAppRequestFailed(arg0 context.Context, ar } // CrossChainAppRequestFailed indicates an expected call of CrossChainAppRequestFailed. -func (mr *MockLinearizableVMMockRecorder) CrossChainAppRequestFailed(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockLinearizableVMMockRecorder) CrossChainAppRequestFailed(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CrossChainAppRequestFailed", reflect.TypeOf((*MockLinearizableVM)(nil).CrossChainAppRequestFailed), arg0, arg1, arg2, arg3) } @@ -180,7 +185,7 @@ func (m *MockLinearizableVM) CrossChainAppResponse(arg0 context.Context, arg1 id } // CrossChainAppResponse indicates an expected call of CrossChainAppResponse. -func (mr *MockLinearizableVMMockRecorder) CrossChainAppResponse(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockLinearizableVMMockRecorder) CrossChainAppResponse(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CrossChainAppResponse", reflect.TypeOf((*MockLinearizableVM)(nil).CrossChainAppResponse), arg0, arg1, arg2, arg3) } @@ -194,7 +199,7 @@ func (m *MockLinearizableVM) Disconnected(arg0 context.Context, arg1 ids.NodeID) } // Disconnected indicates an expected call of Disconnected. -func (mr *MockLinearizableVMMockRecorder) Disconnected(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockLinearizableVMMockRecorder) Disconnected(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Disconnected", reflect.TypeOf((*MockLinearizableVM)(nil).Disconnected), arg0, arg1) } @@ -209,7 +214,7 @@ func (m *MockLinearizableVM) GetBlock(arg0 context.Context, arg1 ids.ID) (snowma } // GetBlock indicates an expected call of GetBlock. -func (mr *MockLinearizableVMMockRecorder) GetBlock(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockLinearizableVMMockRecorder) GetBlock(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlock", reflect.TypeOf((*MockLinearizableVM)(nil).GetBlock), arg0, arg1) } @@ -224,22 +229,22 @@ func (m *MockLinearizableVM) GetBlockIDAtHeight(arg0 context.Context, arg1 uint6 } // GetBlockIDAtHeight indicates an expected call of GetBlockIDAtHeight. -func (mr *MockLinearizableVMMockRecorder) GetBlockIDAtHeight(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockLinearizableVMMockRecorder) GetBlockIDAtHeight(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlockIDAtHeight", reflect.TypeOf((*MockLinearizableVM)(nil).GetBlockIDAtHeight), arg0, arg1) } // HealthCheck mocks base method. -func (m *MockLinearizableVM) HealthCheck(arg0 context.Context) (interface{}, error) { +func (m *MockLinearizableVM) HealthCheck(arg0 context.Context) (any, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "HealthCheck", arg0) - ret0, _ := ret[0].(interface{}) + ret0, _ := ret[0].(any) ret1, _ := ret[1].(error) return ret0, ret1 } // HealthCheck indicates an expected call of HealthCheck. -func (mr *MockLinearizableVMMockRecorder) HealthCheck(arg0 interface{}) *gomock.Call { +func (mr *MockLinearizableVMMockRecorder) HealthCheck(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HealthCheck", reflect.TypeOf((*MockLinearizableVM)(nil).HealthCheck), arg0) } @@ -253,7 +258,7 @@ func (m *MockLinearizableVM) Initialize(arg0 context.Context, arg1 *snow.Context } // Initialize indicates an expected call of Initialize. -func (mr *MockLinearizableVMMockRecorder) Initialize(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8 interface{}) *gomock.Call { +func (mr *MockLinearizableVMMockRecorder) Initialize(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Initialize", reflect.TypeOf((*MockLinearizableVM)(nil).Initialize), arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) } @@ -268,7 +273,7 @@ func (m *MockLinearizableVM) LastAccepted(arg0 context.Context) (ids.ID, error) } // LastAccepted indicates an expected call of LastAccepted. -func (mr *MockLinearizableVMMockRecorder) LastAccepted(arg0 interface{}) *gomock.Call { +func (mr *MockLinearizableVMMockRecorder) LastAccepted(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastAccepted", reflect.TypeOf((*MockLinearizableVM)(nil).LastAccepted), arg0) } @@ -282,7 +287,7 @@ func (m *MockLinearizableVM) Linearize(arg0 context.Context, arg1 ids.ID) error } // Linearize indicates an expected call of Linearize. -func (mr *MockLinearizableVMMockRecorder) Linearize(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockLinearizableVMMockRecorder) Linearize(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Linearize", reflect.TypeOf((*MockLinearizableVM)(nil).Linearize), arg0, arg1) } @@ -297,7 +302,7 @@ func (m *MockLinearizableVM) ParseBlock(arg0 context.Context, arg1 []byte) (snow } // ParseBlock indicates an expected call of ParseBlock. -func (mr *MockLinearizableVMMockRecorder) ParseBlock(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockLinearizableVMMockRecorder) ParseBlock(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ParseBlock", reflect.TypeOf((*MockLinearizableVM)(nil).ParseBlock), arg0, arg1) } @@ -312,7 +317,7 @@ func (m *MockLinearizableVM) ParseTx(arg0 context.Context, arg1 []byte) (snowsto } // ParseTx indicates an expected call of ParseTx. -func (mr *MockLinearizableVMMockRecorder) ParseTx(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockLinearizableVMMockRecorder) ParseTx(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ParseTx", reflect.TypeOf((*MockLinearizableVM)(nil).ParseTx), arg0, arg1) } @@ -326,7 +331,7 @@ func (m *MockLinearizableVM) SetPreference(arg0 context.Context, arg1 ids.ID) er } // SetPreference indicates an expected call of SetPreference. -func (mr *MockLinearizableVMMockRecorder) SetPreference(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockLinearizableVMMockRecorder) SetPreference(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetPreference", reflect.TypeOf((*MockLinearizableVM)(nil).SetPreference), arg0, arg1) } @@ -340,7 +345,7 @@ func (m *MockLinearizableVM) SetState(arg0 context.Context, arg1 snow.State) err } // SetState indicates an expected call of SetState. -func (mr *MockLinearizableVMMockRecorder) SetState(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockLinearizableVMMockRecorder) SetState(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetState", reflect.TypeOf((*MockLinearizableVM)(nil).SetState), arg0, arg1) } @@ -354,7 +359,7 @@ func (m *MockLinearizableVM) Shutdown(arg0 context.Context) error { } // Shutdown indicates an expected call of Shutdown. -func (mr *MockLinearizableVMMockRecorder) Shutdown(arg0 interface{}) *gomock.Call { +func (mr *MockLinearizableVMMockRecorder) Shutdown(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Shutdown", reflect.TypeOf((*MockLinearizableVM)(nil).Shutdown), arg0) } @@ -368,7 +373,7 @@ func (m *MockLinearizableVM) VerifyHeightIndex(arg0 context.Context) error { } // VerifyHeightIndex indicates an expected call of VerifyHeightIndex. -func (mr *MockLinearizableVMMockRecorder) VerifyHeightIndex(arg0 interface{}) *gomock.Call { +func (mr *MockLinearizableVMMockRecorder) VerifyHeightIndex(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VerifyHeightIndex", reflect.TypeOf((*MockLinearizableVM)(nil).VerifyHeightIndex), arg0) } @@ -383,7 +388,7 @@ func (m *MockLinearizableVM) Version(arg0 context.Context) (string, error) { } // Version indicates an expected call of Version. -func (mr *MockLinearizableVMMockRecorder) Version(arg0 interface{}) *gomock.Call { +func (mr *MockLinearizableVMMockRecorder) Version(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Version", reflect.TypeOf((*MockLinearizableVM)(nil).Version), arg0) } diff --git a/snow/engine/snowman/block/mock_build_block_with_context_vm.go b/snow/engine/snowman/block/mock_build_block_with_context_vm.go index 9cb5f3e77833..016007b0dee7 100644 --- a/snow/engine/snowman/block/mock_build_block_with_context_vm.go +++ b/snow/engine/snowman/block/mock_build_block_with_context_vm.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/snow/engine/snowman/block (interfaces: BuildBlockWithContextChainVM) +// +// Generated by this command: +// +// mockgen -package=block -destination=snow/engine/snowman/block/mock_build_block_with_context_vm.go github.com/ava-labs/avalanchego/snow/engine/snowman/block BuildBlockWithContextChainVM +// // Package block is a generated GoMock package. package block @@ -45,7 +50,7 @@ func (m *MockBuildBlockWithContextChainVM) BuildBlockWithContext(arg0 context.Co } // BuildBlockWithContext indicates an expected call of BuildBlockWithContext. -func (mr *MockBuildBlockWithContextChainVMMockRecorder) BuildBlockWithContext(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBuildBlockWithContextChainVMMockRecorder) BuildBlockWithContext(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BuildBlockWithContext", reflect.TypeOf((*MockBuildBlockWithContextChainVM)(nil).BuildBlockWithContext), arg0, arg1) } diff --git a/snow/engine/snowman/block/mock_chain_vm.go b/snow/engine/snowman/block/mock_chain_vm.go index 8cb9acb75ed0..ad99e3f716d0 100644 --- a/snow/engine/snowman/block/mock_chain_vm.go +++ b/snow/engine/snowman/block/mock_chain_vm.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/snow/engine/snowman/block (interfaces: ChainVM) +// +// Generated by this command: +// +// mockgen -package=block -destination=snow/engine/snowman/block/mock_chain_vm.go github.com/ava-labs/avalanchego/snow/engine/snowman/block ChainVM +// // Package block is a generated GoMock package. package block @@ -51,7 +56,7 @@ func (m *MockChainVM) AppGossip(arg0 context.Context, arg1 ids.NodeID, arg2 []by } // AppGossip indicates an expected call of AppGossip. -func (mr *MockChainVMMockRecorder) AppGossip(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockChainVMMockRecorder) AppGossip(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AppGossip", reflect.TypeOf((*MockChainVM)(nil).AppGossip), arg0, arg1, arg2) } @@ -65,7 +70,7 @@ func (m *MockChainVM) AppRequest(arg0 context.Context, arg1 ids.NodeID, arg2 uin } // AppRequest indicates an expected call of AppRequest. -func (mr *MockChainVMMockRecorder) AppRequest(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { +func (mr *MockChainVMMockRecorder) AppRequest(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AppRequest", reflect.TypeOf((*MockChainVM)(nil).AppRequest), arg0, arg1, arg2, arg3, arg4) } @@ -79,7 +84,7 @@ func (m *MockChainVM) AppRequestFailed(arg0 context.Context, arg1 ids.NodeID, ar } // AppRequestFailed indicates an expected call of AppRequestFailed. -func (mr *MockChainVMMockRecorder) AppRequestFailed(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockChainVMMockRecorder) AppRequestFailed(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AppRequestFailed", reflect.TypeOf((*MockChainVM)(nil).AppRequestFailed), arg0, arg1, arg2, arg3) } @@ -93,7 +98,7 @@ func (m *MockChainVM) AppResponse(arg0 context.Context, arg1 ids.NodeID, arg2 ui } // AppResponse indicates an expected call of AppResponse. -func (mr *MockChainVMMockRecorder) AppResponse(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockChainVMMockRecorder) AppResponse(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AppResponse", reflect.TypeOf((*MockChainVM)(nil).AppResponse), arg0, arg1, arg2, arg3) } @@ -108,7 +113,7 @@ func (m *MockChainVM) BuildBlock(arg0 context.Context) (snowman.Block, error) { } // BuildBlock indicates an expected call of BuildBlock. -func (mr *MockChainVMMockRecorder) BuildBlock(arg0 interface{}) *gomock.Call { +func (mr *MockChainVMMockRecorder) BuildBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BuildBlock", reflect.TypeOf((*MockChainVM)(nil).BuildBlock), arg0) } @@ -122,7 +127,7 @@ func (m *MockChainVM) Connected(arg0 context.Context, arg1 ids.NodeID, arg2 *ver } // Connected indicates an expected call of Connected. -func (mr *MockChainVMMockRecorder) Connected(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockChainVMMockRecorder) Connected(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Connected", reflect.TypeOf((*MockChainVM)(nil).Connected), arg0, arg1, arg2) } @@ -137,7 +142,7 @@ func (m *MockChainVM) CreateHandlers(arg0 context.Context) (map[string]http.Hand } // CreateHandlers indicates an expected call of CreateHandlers. -func (mr *MockChainVMMockRecorder) CreateHandlers(arg0 interface{}) *gomock.Call { +func (mr *MockChainVMMockRecorder) CreateHandlers(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateHandlers", reflect.TypeOf((*MockChainVM)(nil).CreateHandlers), arg0) } @@ -151,7 +156,7 @@ func (m *MockChainVM) CrossChainAppRequest(arg0 context.Context, arg1 ids.ID, ar } // CrossChainAppRequest indicates an expected call of CrossChainAppRequest. -func (mr *MockChainVMMockRecorder) CrossChainAppRequest(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { +func (mr *MockChainVMMockRecorder) CrossChainAppRequest(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CrossChainAppRequest", reflect.TypeOf((*MockChainVM)(nil).CrossChainAppRequest), arg0, arg1, arg2, arg3, arg4) } @@ -165,7 +170,7 @@ func (m *MockChainVM) CrossChainAppRequestFailed(arg0 context.Context, arg1 ids. } // CrossChainAppRequestFailed indicates an expected call of CrossChainAppRequestFailed. -func (mr *MockChainVMMockRecorder) CrossChainAppRequestFailed(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockChainVMMockRecorder) CrossChainAppRequestFailed(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CrossChainAppRequestFailed", reflect.TypeOf((*MockChainVM)(nil).CrossChainAppRequestFailed), arg0, arg1, arg2, arg3) } @@ -179,7 +184,7 @@ func (m *MockChainVM) CrossChainAppResponse(arg0 context.Context, arg1 ids.ID, a } // CrossChainAppResponse indicates an expected call of CrossChainAppResponse. -func (mr *MockChainVMMockRecorder) CrossChainAppResponse(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockChainVMMockRecorder) CrossChainAppResponse(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CrossChainAppResponse", reflect.TypeOf((*MockChainVM)(nil).CrossChainAppResponse), arg0, arg1, arg2, arg3) } @@ -193,7 +198,7 @@ func (m *MockChainVM) Disconnected(arg0 context.Context, arg1 ids.NodeID) error } // Disconnected indicates an expected call of Disconnected. -func (mr *MockChainVMMockRecorder) Disconnected(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockChainVMMockRecorder) Disconnected(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Disconnected", reflect.TypeOf((*MockChainVM)(nil).Disconnected), arg0, arg1) } @@ -208,7 +213,7 @@ func (m *MockChainVM) GetBlock(arg0 context.Context, arg1 ids.ID) (snowman.Block } // GetBlock indicates an expected call of GetBlock. -func (mr *MockChainVMMockRecorder) GetBlock(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockChainVMMockRecorder) GetBlock(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlock", reflect.TypeOf((*MockChainVM)(nil).GetBlock), arg0, arg1) } @@ -223,22 +228,22 @@ func (m *MockChainVM) GetBlockIDAtHeight(arg0 context.Context, arg1 uint64) (ids } // GetBlockIDAtHeight indicates an expected call of GetBlockIDAtHeight. -func (mr *MockChainVMMockRecorder) GetBlockIDAtHeight(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockChainVMMockRecorder) GetBlockIDAtHeight(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlockIDAtHeight", reflect.TypeOf((*MockChainVM)(nil).GetBlockIDAtHeight), arg0, arg1) } // HealthCheck mocks base method. -func (m *MockChainVM) HealthCheck(arg0 context.Context) (interface{}, error) { +func (m *MockChainVM) HealthCheck(arg0 context.Context) (any, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "HealthCheck", arg0) - ret0, _ := ret[0].(interface{}) + ret0, _ := ret[0].(any) ret1, _ := ret[1].(error) return ret0, ret1 } // HealthCheck indicates an expected call of HealthCheck. -func (mr *MockChainVMMockRecorder) HealthCheck(arg0 interface{}) *gomock.Call { +func (mr *MockChainVMMockRecorder) HealthCheck(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HealthCheck", reflect.TypeOf((*MockChainVM)(nil).HealthCheck), arg0) } @@ -252,7 +257,7 @@ func (m *MockChainVM) Initialize(arg0 context.Context, arg1 *snow.Context, arg2 } // Initialize indicates an expected call of Initialize. -func (mr *MockChainVMMockRecorder) Initialize(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8 interface{}) *gomock.Call { +func (mr *MockChainVMMockRecorder) Initialize(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Initialize", reflect.TypeOf((*MockChainVM)(nil).Initialize), arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) } @@ -267,7 +272,7 @@ func (m *MockChainVM) LastAccepted(arg0 context.Context) (ids.ID, error) { } // LastAccepted indicates an expected call of LastAccepted. -func (mr *MockChainVMMockRecorder) LastAccepted(arg0 interface{}) *gomock.Call { +func (mr *MockChainVMMockRecorder) LastAccepted(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastAccepted", reflect.TypeOf((*MockChainVM)(nil).LastAccepted), arg0) } @@ -282,7 +287,7 @@ func (m *MockChainVM) ParseBlock(arg0 context.Context, arg1 []byte) (snowman.Blo } // ParseBlock indicates an expected call of ParseBlock. -func (mr *MockChainVMMockRecorder) ParseBlock(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockChainVMMockRecorder) ParseBlock(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ParseBlock", reflect.TypeOf((*MockChainVM)(nil).ParseBlock), arg0, arg1) } @@ -296,7 +301,7 @@ func (m *MockChainVM) SetPreference(arg0 context.Context, arg1 ids.ID) error { } // SetPreference indicates an expected call of SetPreference. -func (mr *MockChainVMMockRecorder) SetPreference(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockChainVMMockRecorder) SetPreference(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetPreference", reflect.TypeOf((*MockChainVM)(nil).SetPreference), arg0, arg1) } @@ -310,7 +315,7 @@ func (m *MockChainVM) SetState(arg0 context.Context, arg1 snow.State) error { } // SetState indicates an expected call of SetState. -func (mr *MockChainVMMockRecorder) SetState(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockChainVMMockRecorder) SetState(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetState", reflect.TypeOf((*MockChainVM)(nil).SetState), arg0, arg1) } @@ -324,7 +329,7 @@ func (m *MockChainVM) Shutdown(arg0 context.Context) error { } // Shutdown indicates an expected call of Shutdown. -func (mr *MockChainVMMockRecorder) Shutdown(arg0 interface{}) *gomock.Call { +func (mr *MockChainVMMockRecorder) Shutdown(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Shutdown", reflect.TypeOf((*MockChainVM)(nil).Shutdown), arg0) } @@ -338,7 +343,7 @@ func (m *MockChainVM) VerifyHeightIndex(arg0 context.Context) error { } // VerifyHeightIndex indicates an expected call of VerifyHeightIndex. -func (mr *MockChainVMMockRecorder) VerifyHeightIndex(arg0 interface{}) *gomock.Call { +func (mr *MockChainVMMockRecorder) VerifyHeightIndex(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VerifyHeightIndex", reflect.TypeOf((*MockChainVM)(nil).VerifyHeightIndex), arg0) } @@ -353,7 +358,7 @@ func (m *MockChainVM) Version(arg0 context.Context) (string, error) { } // Version indicates an expected call of Version. -func (mr *MockChainVMMockRecorder) Version(arg0 interface{}) *gomock.Call { +func (mr *MockChainVMMockRecorder) Version(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Version", reflect.TypeOf((*MockChainVM)(nil).Version), arg0) } diff --git a/snow/engine/snowman/block/mock_state_syncable_vm.go b/snow/engine/snowman/block/mock_state_syncable_vm.go index f728b9b5a7a7..8d8abca53a0c 100644 --- a/snow/engine/snowman/block/mock_state_syncable_vm.go +++ b/snow/engine/snowman/block/mock_state_syncable_vm.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/snow/engine/snowman/block (interfaces: StateSyncableVM) +// +// Generated by this command: +// +// mockgen -package=block -destination=snow/engine/snowman/block/mock_state_syncable_vm.go github.com/ava-labs/avalanchego/snow/engine/snowman/block StateSyncableVM +// // Package block is a generated GoMock package. package block @@ -44,7 +49,7 @@ func (m *MockStateSyncableVM) GetLastStateSummary(arg0 context.Context) (StateSu } // GetLastStateSummary indicates an expected call of GetLastStateSummary. -func (mr *MockStateSyncableVMMockRecorder) GetLastStateSummary(arg0 interface{}) *gomock.Call { +func (mr *MockStateSyncableVMMockRecorder) GetLastStateSummary(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLastStateSummary", reflect.TypeOf((*MockStateSyncableVM)(nil).GetLastStateSummary), arg0) } @@ -59,7 +64,7 @@ func (m *MockStateSyncableVM) GetOngoingSyncStateSummary(arg0 context.Context) ( } // GetOngoingSyncStateSummary indicates an expected call of GetOngoingSyncStateSummary. -func (mr *MockStateSyncableVMMockRecorder) GetOngoingSyncStateSummary(arg0 interface{}) *gomock.Call { +func (mr *MockStateSyncableVMMockRecorder) GetOngoingSyncStateSummary(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOngoingSyncStateSummary", reflect.TypeOf((*MockStateSyncableVM)(nil).GetOngoingSyncStateSummary), arg0) } @@ -74,7 +79,7 @@ func (m *MockStateSyncableVM) GetStateSummary(arg0 context.Context, arg1 uint64) } // GetStateSummary indicates an expected call of GetStateSummary. -func (mr *MockStateSyncableVMMockRecorder) GetStateSummary(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStateSyncableVMMockRecorder) GetStateSummary(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStateSummary", reflect.TypeOf((*MockStateSyncableVM)(nil).GetStateSummary), arg0, arg1) } @@ -89,7 +94,7 @@ func (m *MockStateSyncableVM) ParseStateSummary(arg0 context.Context, arg1 []byt } // ParseStateSummary indicates an expected call of ParseStateSummary. -func (mr *MockStateSyncableVMMockRecorder) ParseStateSummary(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStateSyncableVMMockRecorder) ParseStateSummary(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ParseStateSummary", reflect.TypeOf((*MockStateSyncableVM)(nil).ParseStateSummary), arg0, arg1) } @@ -104,7 +109,7 @@ func (m *MockStateSyncableVM) StateSyncEnabled(arg0 context.Context) (bool, erro } // StateSyncEnabled indicates an expected call of StateSyncEnabled. -func (mr *MockStateSyncableVMMockRecorder) StateSyncEnabled(arg0 interface{}) *gomock.Call { +func (mr *MockStateSyncableVMMockRecorder) StateSyncEnabled(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateSyncEnabled", reflect.TypeOf((*MockStateSyncableVM)(nil).StateSyncEnabled), arg0) } diff --git a/snow/engine/snowman/block/mock_with_verify_context.go b/snow/engine/snowman/block/mock_with_verify_context.go index 23ce5a2fd4d5..1c18e3e9f6cb 100644 --- a/snow/engine/snowman/block/mock_with_verify_context.go +++ b/snow/engine/snowman/block/mock_with_verify_context.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/snow/engine/snowman/block (interfaces: WithVerifyContext) +// +// Generated by this command: +// +// mockgen -package=block -destination=snow/engine/snowman/block/mock_with_verify_context.go github.com/ava-labs/avalanchego/snow/engine/snowman/block WithVerifyContext +// // Package block is a generated GoMock package. package block @@ -44,7 +49,7 @@ func (m *MockWithVerifyContext) ShouldVerifyWithContext(arg0 context.Context) (b } // ShouldVerifyWithContext indicates an expected call of ShouldVerifyWithContext. -func (mr *MockWithVerifyContextMockRecorder) ShouldVerifyWithContext(arg0 interface{}) *gomock.Call { +func (mr *MockWithVerifyContextMockRecorder) ShouldVerifyWithContext(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ShouldVerifyWithContext", reflect.TypeOf((*MockWithVerifyContext)(nil).ShouldVerifyWithContext), arg0) } @@ -58,7 +63,7 @@ func (m *MockWithVerifyContext) VerifyWithContext(arg0 context.Context, arg1 *Co } // VerifyWithContext indicates an expected call of VerifyWithContext. -func (mr *MockWithVerifyContextMockRecorder) VerifyWithContext(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockWithVerifyContextMockRecorder) VerifyWithContext(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VerifyWithContext", reflect.TypeOf((*MockWithVerifyContext)(nil).VerifyWithContext), arg0, arg1) } diff --git a/snow/networking/handler/mock_handler.go b/snow/networking/handler/mock_handler.go index 3346da7960d8..517fbcd85537 100644 --- a/snow/networking/handler/mock_handler.go +++ b/snow/networking/handler/mock_handler.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/snow/networking/handler (interfaces: Handler) +// +// Generated by this command: +// +// mockgen -package=handler -destination=snow/networking/handler/mock_handler.go github.com/ava-labs/avalanchego/snow/networking/handler Handler +// // Package handler is a generated GoMock package. package handler @@ -47,7 +52,7 @@ func (m *MockHandler) AwaitStopped(arg0 context.Context) (time.Duration, error) } // AwaitStopped indicates an expected call of AwaitStopped. -func (mr *MockHandlerMockRecorder) AwaitStopped(arg0 interface{}) *gomock.Call { +func (mr *MockHandlerMockRecorder) AwaitStopped(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AwaitStopped", reflect.TypeOf((*MockHandler)(nil).AwaitStopped), arg0) } @@ -81,16 +86,16 @@ func (mr *MockHandlerMockRecorder) GetEngineManager() *gomock.Call { } // HealthCheck mocks base method. -func (m *MockHandler) HealthCheck(arg0 context.Context) (interface{}, error) { +func (m *MockHandler) HealthCheck(arg0 context.Context) (any, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "HealthCheck", arg0) - ret0, _ := ret[0].(interface{}) + ret0, _ := ret[0].(any) ret1, _ := ret[1].(error) return ret0, ret1 } // HealthCheck indicates an expected call of HealthCheck. -func (mr *MockHandlerMockRecorder) HealthCheck(arg0 interface{}) *gomock.Call { +func (mr *MockHandlerMockRecorder) HealthCheck(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HealthCheck", reflect.TypeOf((*MockHandler)(nil).HealthCheck), arg0) } @@ -116,7 +121,7 @@ func (m *MockHandler) Push(arg0 context.Context, arg1 Message) { } // Push indicates an expected call of Push. -func (mr *MockHandlerMockRecorder) Push(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockHandlerMockRecorder) Push(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Push", reflect.TypeOf((*MockHandler)(nil).Push), arg0, arg1) } @@ -128,7 +133,7 @@ func (m *MockHandler) RegisterTimeout(arg0 time.Duration) { } // RegisterTimeout indicates an expected call of RegisterTimeout. -func (mr *MockHandlerMockRecorder) RegisterTimeout(arg0 interface{}) *gomock.Call { +func (mr *MockHandlerMockRecorder) RegisterTimeout(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterTimeout", reflect.TypeOf((*MockHandler)(nil).RegisterTimeout), arg0) } @@ -140,7 +145,7 @@ func (m *MockHandler) SetEngineManager(arg0 *EngineManager) { } // SetEngineManager indicates an expected call of SetEngineManager. -func (mr *MockHandlerMockRecorder) SetEngineManager(arg0 interface{}) *gomock.Call { +func (mr *MockHandlerMockRecorder) SetEngineManager(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetEngineManager", reflect.TypeOf((*MockHandler)(nil).SetEngineManager), arg0) } @@ -152,7 +157,7 @@ func (m *MockHandler) SetOnStopped(arg0 func()) { } // SetOnStopped indicates an expected call of SetOnStopped. -func (mr *MockHandlerMockRecorder) SetOnStopped(arg0 interface{}) *gomock.Call { +func (mr *MockHandlerMockRecorder) SetOnStopped(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetOnStopped", reflect.TypeOf((*MockHandler)(nil).SetOnStopped), arg0) } @@ -166,7 +171,7 @@ func (m *MockHandler) ShouldHandle(arg0 ids.NodeID) bool { } // ShouldHandle indicates an expected call of ShouldHandle. -func (mr *MockHandlerMockRecorder) ShouldHandle(arg0 interface{}) *gomock.Call { +func (mr *MockHandlerMockRecorder) ShouldHandle(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ShouldHandle", reflect.TypeOf((*MockHandler)(nil).ShouldHandle), arg0) } @@ -178,7 +183,7 @@ func (m *MockHandler) Start(arg0 context.Context, arg1 bool) { } // Start indicates an expected call of Start. -func (mr *MockHandlerMockRecorder) Start(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockHandlerMockRecorder) Start(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Start", reflect.TypeOf((*MockHandler)(nil).Start), arg0, arg1) } @@ -190,7 +195,7 @@ func (m *MockHandler) Stop(arg0 context.Context) { } // Stop indicates an expected call of Stop. -func (mr *MockHandlerMockRecorder) Stop(arg0 interface{}) *gomock.Call { +func (mr *MockHandlerMockRecorder) Stop(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Stop", reflect.TypeOf((*MockHandler)(nil).Stop), arg0) } @@ -202,7 +207,7 @@ func (m *MockHandler) StopWithError(arg0 context.Context, arg1 error) { } // StopWithError indicates an expected call of StopWithError. -func (mr *MockHandlerMockRecorder) StopWithError(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockHandlerMockRecorder) StopWithError(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StopWithError", reflect.TypeOf((*MockHandler)(nil).StopWithError), arg0, arg1) } diff --git a/snow/networking/timeout/mock_manager.go b/snow/networking/timeout/mock_manager.go index 1033ad335afe..8eeac4c6f8dc 100644 --- a/snow/networking/timeout/mock_manager.go +++ b/snow/networking/timeout/mock_manager.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/snow/networking/timeout (interfaces: Manager) +// +// Generated by this command: +// +// mockgen -package=timeout -destination=snow/networking/timeout/mock_manager.go github.com/ava-labs/avalanchego/snow/networking/timeout Manager +// // Package timeout is a generated GoMock package. package timeout @@ -58,7 +63,7 @@ func (m *MockManager) IsBenched(arg0 ids.NodeID, arg1 ids.ID) bool { } // IsBenched indicates an expected call of IsBenched. -func (mr *MockManagerMockRecorder) IsBenched(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) IsBenched(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsBenched", reflect.TypeOf((*MockManager)(nil).IsBenched), arg0, arg1) } @@ -72,7 +77,7 @@ func (m *MockManager) RegisterChain(arg0 *snow.ConsensusContext) error { } // RegisterChain indicates an expected call of RegisterChain. -func (mr *MockManagerMockRecorder) RegisterChain(arg0 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) RegisterChain(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterChain", reflect.TypeOf((*MockManager)(nil).RegisterChain), arg0) } @@ -84,7 +89,7 @@ func (m *MockManager) RegisterRequest(arg0 ids.NodeID, arg1 ids.ID, arg2 bool, a } // RegisterRequest indicates an expected call of RegisterRequest. -func (mr *MockManagerMockRecorder) RegisterRequest(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) RegisterRequest(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterRequest", reflect.TypeOf((*MockManager)(nil).RegisterRequest), arg0, arg1, arg2, arg3, arg4) } @@ -108,7 +113,7 @@ func (m *MockManager) RegisterResponse(arg0 ids.NodeID, arg1 ids.ID, arg2 ids.Re } // RegisterResponse indicates an expected call of RegisterResponse. -func (mr *MockManagerMockRecorder) RegisterResponse(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) RegisterResponse(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterResponse", reflect.TypeOf((*MockManager)(nil).RegisterResponse), arg0, arg1, arg2, arg3, arg4) } @@ -120,7 +125,7 @@ func (m *MockManager) RemoveRequest(arg0 ids.RequestID) { } // RemoveRequest indicates an expected call of RemoveRequest. -func (mr *MockManagerMockRecorder) RemoveRequest(arg0 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) RemoveRequest(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveRequest", reflect.TypeOf((*MockManager)(nil).RemoveRequest), arg0) } diff --git a/snow/networking/tracker/mock_resource_tracker.go b/snow/networking/tracker/mock_resource_tracker.go index cfe8d59bdcd0..438bd44d9b4f 100644 --- a/snow/networking/tracker/mock_resource_tracker.go +++ b/snow/networking/tracker/mock_resource_tracker.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/snow/networking/tracker (interfaces: Tracker) +// +// Generated by this command: +// +// mockgen -package=tracker -destination=snow/networking/tracker/mock_resource_tracker.go github.com/ava-labs/avalanchego/snow/networking/tracker Tracker +// // Package tracker is a generated GoMock package. package tracker @@ -44,7 +49,7 @@ func (m *MockTracker) TimeUntilUsage(arg0 ids.NodeID, arg1 time.Time, arg2 float } // TimeUntilUsage indicates an expected call of TimeUntilUsage. -func (mr *MockTrackerMockRecorder) TimeUntilUsage(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockTrackerMockRecorder) TimeUntilUsage(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TimeUntilUsage", reflect.TypeOf((*MockTracker)(nil).TimeUntilUsage), arg0, arg1, arg2) } @@ -72,7 +77,7 @@ func (m *MockTracker) Usage(arg0 ids.NodeID, arg1 time.Time) float64 { } // Usage indicates an expected call of Usage. -func (mr *MockTrackerMockRecorder) Usage(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockTrackerMockRecorder) Usage(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Usage", reflect.TypeOf((*MockTracker)(nil).Usage), arg0, arg1) } diff --git a/snow/networking/tracker/mock_targeter.go b/snow/networking/tracker/mock_targeter.go index 165bf7a95c59..7e260fe69d6d 100644 --- a/snow/networking/tracker/mock_targeter.go +++ b/snow/networking/tracker/mock_targeter.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/snow/networking/tracker (interfaces: Targeter) +// +// Generated by this command: +// +// mockgen -package=tracker -destination=snow/networking/tracker/mock_targeter.go github.com/ava-labs/avalanchego/snow/networking/tracker Targeter +// // Package tracker is a generated GoMock package. package tracker @@ -43,7 +48,7 @@ func (m *MockTargeter) TargetUsage(arg0 ids.NodeID) float64 { } // TargetUsage indicates an expected call of TargetUsage. -func (mr *MockTargeterMockRecorder) TargetUsage(arg0 interface{}) *gomock.Call { +func (mr *MockTargeterMockRecorder) TargetUsage(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TargetUsage", reflect.TypeOf((*MockTargeter)(nil).TargetUsage), arg0) } diff --git a/snow/uptime/mock_calculator.go b/snow/uptime/mock_calculator.go index f0ece236f88c..cc5b5942e639 100644 --- a/snow/uptime/mock_calculator.go +++ b/snow/uptime/mock_calculator.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/snow/uptime (interfaces: Calculator) +// +// Generated by this command: +// +// mockgen -package=uptime -destination=snow/uptime/mock_calculator.go github.com/ava-labs/avalanchego/snow/uptime Calculator +// // Package uptime is a generated GoMock package. package uptime @@ -46,7 +51,7 @@ func (m *MockCalculator) CalculateUptime(arg0 ids.NodeID, arg1 ids.ID) (time.Dur } // CalculateUptime indicates an expected call of CalculateUptime. -func (mr *MockCalculatorMockRecorder) CalculateUptime(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockCalculatorMockRecorder) CalculateUptime(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CalculateUptime", reflect.TypeOf((*MockCalculator)(nil).CalculateUptime), arg0, arg1) } @@ -61,7 +66,7 @@ func (m *MockCalculator) CalculateUptimePercent(arg0 ids.NodeID, arg1 ids.ID) (f } // CalculateUptimePercent indicates an expected call of CalculateUptimePercent. -func (mr *MockCalculatorMockRecorder) CalculateUptimePercent(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockCalculatorMockRecorder) CalculateUptimePercent(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CalculateUptimePercent", reflect.TypeOf((*MockCalculator)(nil).CalculateUptimePercent), arg0, arg1) } @@ -76,7 +81,7 @@ func (m *MockCalculator) CalculateUptimePercentFrom(arg0 ids.NodeID, arg1 ids.ID } // CalculateUptimePercentFrom indicates an expected call of CalculateUptimePercentFrom. -func (mr *MockCalculatorMockRecorder) CalculateUptimePercentFrom(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockCalculatorMockRecorder) CalculateUptimePercentFrom(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CalculateUptimePercentFrom", reflect.TypeOf((*MockCalculator)(nil).CalculateUptimePercentFrom), arg0, arg1, arg2) } diff --git a/snow/validators/mock_state.go b/snow/validators/mock_state.go index 07447721c28c..6bed638becd8 100644 --- a/snow/validators/mock_state.go +++ b/snow/validators/mock_state.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/snow/validators (interfaces: State) +// +// Generated by this command: +// +// mockgen -package=validators -destination=snow/validators/mock_state.go github.com/ava-labs/avalanchego/snow/validators State +// // Package validators is a generated GoMock package. package validators @@ -45,7 +50,7 @@ func (m *MockState) GetCurrentHeight(arg0 context.Context) (uint64, error) { } // GetCurrentHeight indicates an expected call of GetCurrentHeight. -func (mr *MockStateMockRecorder) GetCurrentHeight(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) GetCurrentHeight(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCurrentHeight", reflect.TypeOf((*MockState)(nil).GetCurrentHeight), arg0) } @@ -60,7 +65,7 @@ func (m *MockState) GetMinimumHeight(arg0 context.Context) (uint64, error) { } // GetMinimumHeight indicates an expected call of GetMinimumHeight. -func (mr *MockStateMockRecorder) GetMinimumHeight(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) GetMinimumHeight(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMinimumHeight", reflect.TypeOf((*MockState)(nil).GetMinimumHeight), arg0) } @@ -75,7 +80,7 @@ func (m *MockState) GetSubnetID(arg0 context.Context, arg1 ids.ID) (ids.ID, erro } // GetSubnetID indicates an expected call of GetSubnetID. -func (mr *MockStateMockRecorder) GetSubnetID(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) GetSubnetID(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSubnetID", reflect.TypeOf((*MockState)(nil).GetSubnetID), arg0, arg1) } @@ -90,7 +95,7 @@ func (m *MockState) GetValidatorSet(arg0 context.Context, arg1 uint64, arg2 ids. } // GetValidatorSet indicates an expected call of GetValidatorSet. -func (mr *MockStateMockRecorder) GetValidatorSet(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) GetValidatorSet(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidatorSet", reflect.TypeOf((*MockState)(nil).GetValidatorSet), arg0, arg1, arg2) } diff --git a/snow/validators/mock_subnet_connector.go b/snow/validators/mock_subnet_connector.go index 4719be84ef88..b9f3ee0519b8 100644 --- a/snow/validators/mock_subnet_connector.go +++ b/snow/validators/mock_subnet_connector.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/snow/validators (interfaces: SubnetConnector) +// +// Generated by this command: +// +// mockgen -package=validators -destination=snow/validators/mock_subnet_connector.go github.com/ava-labs/avalanchego/snow/validators SubnetConnector +// // Package validators is a generated GoMock package. package validators @@ -44,7 +49,7 @@ func (m *MockSubnetConnector) ConnectedSubnet(arg0 context.Context, arg1 ids.Nod } // ConnectedSubnet indicates an expected call of ConnectedSubnet. -func (mr *MockSubnetConnectorMockRecorder) ConnectedSubnet(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockSubnetConnectorMockRecorder) ConnectedSubnet(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConnectedSubnet", reflect.TypeOf((*MockSubnetConnector)(nil).ConnectedSubnet), arg0, arg1, arg2) } diff --git a/utils/crypto/keychain/mock_ledger.go b/utils/crypto/keychain/mock_ledger.go index d17500564097..b082631c416e 100644 --- a/utils/crypto/keychain/mock_ledger.go +++ b/utils/crypto/keychain/mock_ledger.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/utils/crypto/keychain (interfaces: Ledger) +// +// Generated by this command: +// +// mockgen -package=keychain -destination=utils/crypto/keychain/mock_ledger.go github.com/ava-labs/avalanchego/utils/crypto/keychain Ledger +// // Package keychain is a generated GoMock package. package keychain @@ -45,7 +50,7 @@ func (m *MockLedger) Address(arg0 string, arg1 uint32) (ids.ShortID, error) { } // Address indicates an expected call of Address. -func (mr *MockLedgerMockRecorder) Address(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockLedgerMockRecorder) Address(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Address", reflect.TypeOf((*MockLedger)(nil).Address), arg0, arg1) } @@ -60,7 +65,7 @@ func (m *MockLedger) Addresses(arg0 []uint32) ([]ids.ShortID, error) { } // Addresses indicates an expected call of Addresses. -func (mr *MockLedgerMockRecorder) Addresses(arg0 interface{}) *gomock.Call { +func (mr *MockLedgerMockRecorder) Addresses(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Addresses", reflect.TypeOf((*MockLedger)(nil).Addresses), arg0) } @@ -89,7 +94,7 @@ func (m *MockLedger) Sign(arg0 []byte, arg1 []uint32) ([][]byte, error) { } // Sign indicates an expected call of Sign. -func (mr *MockLedgerMockRecorder) Sign(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockLedgerMockRecorder) Sign(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Sign", reflect.TypeOf((*MockLedger)(nil).Sign), arg0, arg1) } @@ -104,7 +109,7 @@ func (m *MockLedger) SignHash(arg0 []byte, arg1 []uint32) ([][]byte, error) { } // SignHash indicates an expected call of SignHash. -func (mr *MockLedgerMockRecorder) SignHash(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockLedgerMockRecorder) SignHash(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SignHash", reflect.TypeOf((*MockLedger)(nil).SignHash), arg0, arg1) } diff --git a/utils/filesystem/mock_io.go b/utils/filesystem/mock_io.go index 43f28011cbfb..06b27dd18dd0 100644 --- a/utils/filesystem/mock_io.go +++ b/utils/filesystem/mock_io.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/utils/filesystem (interfaces: Reader) +// +// Generated by this command: +// +// mockgen -package=filesystem -destination=utils/filesystem/mock_io.go github.com/ava-labs/avalanchego/utils/filesystem Reader +// // Package filesystem is a generated GoMock package. package filesystem @@ -44,7 +49,7 @@ func (m *MockReader) ReadDir(arg0 string) ([]fs.DirEntry, error) { } // ReadDir indicates an expected call of ReadDir. -func (mr *MockReaderMockRecorder) ReadDir(arg0 interface{}) *gomock.Call { +func (mr *MockReaderMockRecorder) ReadDir(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadDir", reflect.TypeOf((*MockReader)(nil).ReadDir), arg0) } diff --git a/utils/hashing/consistent/ring_test.go b/utils/hashing/consistent/ring_test.go index 4a8f3ca5b71b..a53e166657b6 100644 --- a/utils/hashing/consistent/ring_test.go +++ b/utils/hashing/consistent/ring_test.go @@ -181,7 +181,7 @@ func TestGetMapsToClockwiseNode(t *testing.T) { ring, hasher := setupTest(t, 1) // setup expected calls - calls := make([]*gomock.Call, len(test.ringNodes)+1) + calls := make([]any, len(test.ringNodes)+1) for i, key := range test.ringNodes { calls[i] = hasher.EXPECT().Hash(getHashKey(key.ConsistentHashKey(), 0)).Return(key.hash).Times(1) diff --git a/utils/hashing/mock_hasher.go b/utils/hashing/mock_hasher.go index bc9a0abed2d0..c2d5ea4b3918 100644 --- a/utils/hashing/mock_hasher.go +++ b/utils/hashing/mock_hasher.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/utils/hashing (interfaces: Hasher) +// +// Generated by this command: +// +// mockgen -package=hashing -destination=utils/hashing/mock_hasher.go github.com/ava-labs/avalanchego/utils/hashing Hasher +// // Package hashing is a generated GoMock package. package hashing @@ -42,7 +47,7 @@ func (m *MockHasher) Hash(arg0 []byte) uint64 { } // Hash indicates an expected call of Hash. -func (mr *MockHasherMockRecorder) Hash(arg0 interface{}) *gomock.Call { +func (mr *MockHasherMockRecorder) Hash(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Hash", reflect.TypeOf((*MockHasher)(nil).Hash), arg0) } diff --git a/utils/resource/mock_user.go b/utils/resource/mock_user.go index 28f0059e1c88..d333f2c58e4b 100644 --- a/utils/resource/mock_user.go +++ b/utils/resource/mock_user.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/utils/resource (interfaces: User) +// +// Generated by this command: +// +// mockgen -package=resource -destination=utils/resource/mock_user.go github.com/ava-labs/avalanchego/utils/resource User +// // Package resource is a generated GoMock package. package resource diff --git a/vms/avm/block/mock_block.go b/vms/avm/block/mock_block.go index 296fc149f253..bc332e88590c 100644 --- a/vms/avm/block/mock_block.go +++ b/vms/avm/block/mock_block.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms/avm/block (interfaces: Block) +// +// Generated by this command: +// +// mockgen -package=block -destination=vms/avm/block/mock_block.go github.com/ava-labs/avalanchego/vms/avm/block Block +// // Package block is a generated GoMock package. package block @@ -87,7 +92,7 @@ func (m *MockBlock) InitCtx(arg0 *snow.Context) { } // InitCtx indicates an expected call of InitCtx. -func (mr *MockBlockMockRecorder) InitCtx(arg0 interface{}) *gomock.Call { +func (mr *MockBlockMockRecorder) InitCtx(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitCtx", reflect.TypeOf((*MockBlock)(nil).InitCtx), arg0) } @@ -157,7 +162,7 @@ func (m *MockBlock) initialize(arg0 []byte, arg1 codec.Manager) error { } // initialize indicates an expected call of initialize. -func (mr *MockBlockMockRecorder) initialize(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBlockMockRecorder) initialize(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "initialize", reflect.TypeOf((*MockBlock)(nil).initialize), arg0, arg1) } diff --git a/vms/avm/metrics/mock_metrics.go b/vms/avm/metrics/mock_metrics.go index 25ae52fef2d0..2ae4a0786bf0 100644 --- a/vms/avm/metrics/mock_metrics.go +++ b/vms/avm/metrics/mock_metrics.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms/avm/metrics (interfaces: Metrics) +// +// Generated by this command: +// +// mockgen -package=metrics -destination=vms/avm/metrics/mock_metrics.go github.com/ava-labs/avalanchego/vms/avm/metrics Metrics +// // Package metrics is a generated GoMock package. package metrics @@ -44,7 +49,7 @@ func (m *MockMetrics) AfterRequest(arg0 *rpc.RequestInfo) { } // AfterRequest indicates an expected call of AfterRequest. -func (mr *MockMetricsMockRecorder) AfterRequest(arg0 interface{}) *gomock.Call { +func (mr *MockMetricsMockRecorder) AfterRequest(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AfterRequest", reflect.TypeOf((*MockMetrics)(nil).AfterRequest), arg0) } @@ -94,7 +99,7 @@ func (m *MockMetrics) InterceptRequest(arg0 *rpc.RequestInfo) *http.Request { } // InterceptRequest indicates an expected call of InterceptRequest. -func (mr *MockMetricsMockRecorder) InterceptRequest(arg0 interface{}) *gomock.Call { +func (mr *MockMetricsMockRecorder) InterceptRequest(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InterceptRequest", reflect.TypeOf((*MockMetrics)(nil).InterceptRequest), arg0) } @@ -108,7 +113,7 @@ func (m *MockMetrics) MarkBlockAccepted(arg0 block.Block) error { } // MarkBlockAccepted indicates an expected call of MarkBlockAccepted. -func (mr *MockMetricsMockRecorder) MarkBlockAccepted(arg0 interface{}) *gomock.Call { +func (mr *MockMetricsMockRecorder) MarkBlockAccepted(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarkBlockAccepted", reflect.TypeOf((*MockMetrics)(nil).MarkBlockAccepted), arg0) } @@ -122,7 +127,7 @@ func (m *MockMetrics) MarkTxAccepted(arg0 *txs.Tx) error { } // MarkTxAccepted indicates an expected call of MarkTxAccepted. -func (mr *MockMetricsMockRecorder) MarkTxAccepted(arg0 interface{}) *gomock.Call { +func (mr *MockMetricsMockRecorder) MarkTxAccepted(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarkTxAccepted", reflect.TypeOf((*MockMetrics)(nil).MarkTxAccepted), arg0) } diff --git a/vms/avm/state/mock_state.go b/vms/avm/state/mock_state.go index 162f6328ccdb..cb5138c90369 100644 --- a/vms/avm/state/mock_state.go +++ b/vms/avm/state/mock_state.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms/avm/state (interfaces: Chain,State,Diff) +// +// Generated by this command: +// +// mockgen -package=state -destination=vms/avm/state/mock_state.go github.com/ava-labs/avalanchego/vms/avm/state Chain,State,Diff +// // Package state is a generated GoMock package. package state @@ -48,7 +53,7 @@ func (m *MockChain) AddBlock(arg0 block.Block) { } // AddBlock indicates an expected call of AddBlock. -func (mr *MockChainMockRecorder) AddBlock(arg0 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) AddBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddBlock", reflect.TypeOf((*MockChain)(nil).AddBlock), arg0) } @@ -60,7 +65,7 @@ func (m *MockChain) AddTx(arg0 *txs.Tx) { } // AddTx indicates an expected call of AddTx. -func (mr *MockChainMockRecorder) AddTx(arg0 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) AddTx(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddTx", reflect.TypeOf((*MockChain)(nil).AddTx), arg0) } @@ -72,7 +77,7 @@ func (m *MockChain) AddUTXO(arg0 *avax.UTXO) { } // AddUTXO indicates an expected call of AddUTXO. -func (mr *MockChainMockRecorder) AddUTXO(arg0 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) AddUTXO(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddUTXO", reflect.TypeOf((*MockChain)(nil).AddUTXO), arg0) } @@ -84,7 +89,7 @@ func (m *MockChain) DeleteUTXO(arg0 ids.ID) { } // DeleteUTXO indicates an expected call of DeleteUTXO. -func (mr *MockChainMockRecorder) DeleteUTXO(arg0 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) DeleteUTXO(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteUTXO", reflect.TypeOf((*MockChain)(nil).DeleteUTXO), arg0) } @@ -99,7 +104,7 @@ func (m *MockChain) GetBlock(arg0 ids.ID) (block.Block, error) { } // GetBlock indicates an expected call of GetBlock. -func (mr *MockChainMockRecorder) GetBlock(arg0 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) GetBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlock", reflect.TypeOf((*MockChain)(nil).GetBlock), arg0) } @@ -114,7 +119,7 @@ func (m *MockChain) GetBlockIDAtHeight(arg0 uint64) (ids.ID, error) { } // GetBlockIDAtHeight indicates an expected call of GetBlockIDAtHeight. -func (mr *MockChainMockRecorder) GetBlockIDAtHeight(arg0 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) GetBlockIDAtHeight(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlockIDAtHeight", reflect.TypeOf((*MockChain)(nil).GetBlockIDAtHeight), arg0) } @@ -157,7 +162,7 @@ func (m *MockChain) GetTx(arg0 ids.ID) (*txs.Tx, error) { } // GetTx indicates an expected call of GetTx. -func (mr *MockChainMockRecorder) GetTx(arg0 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) GetTx(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTx", reflect.TypeOf((*MockChain)(nil).GetTx), arg0) } @@ -172,7 +177,7 @@ func (m *MockChain) GetUTXO(arg0 ids.ID) (*avax.UTXO, error) { } // GetUTXO indicates an expected call of GetUTXO. -func (mr *MockChainMockRecorder) GetUTXO(arg0 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) GetUTXO(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUTXO", reflect.TypeOf((*MockChain)(nil).GetUTXO), arg0) } @@ -184,7 +189,7 @@ func (m *MockChain) SetLastAccepted(arg0 ids.ID) { } // SetLastAccepted indicates an expected call of SetLastAccepted. -func (mr *MockChainMockRecorder) SetLastAccepted(arg0 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) SetLastAccepted(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetLastAccepted", reflect.TypeOf((*MockChain)(nil).SetLastAccepted), arg0) } @@ -196,7 +201,7 @@ func (m *MockChain) SetTimestamp(arg0 time.Time) { } // SetTimestamp indicates an expected call of SetTimestamp. -func (mr *MockChainMockRecorder) SetTimestamp(arg0 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) SetTimestamp(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTimestamp", reflect.TypeOf((*MockChain)(nil).SetTimestamp), arg0) } @@ -243,7 +248,7 @@ func (m *MockState) AddBlock(arg0 block.Block) { } // AddBlock indicates an expected call of AddBlock. -func (mr *MockStateMockRecorder) AddBlock(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) AddBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddBlock", reflect.TypeOf((*MockState)(nil).AddBlock), arg0) } @@ -255,7 +260,7 @@ func (m *MockState) AddTx(arg0 *txs.Tx) { } // AddTx indicates an expected call of AddTx. -func (mr *MockStateMockRecorder) AddTx(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) AddTx(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddTx", reflect.TypeOf((*MockState)(nil).AddTx), arg0) } @@ -267,7 +272,7 @@ func (m *MockState) AddUTXO(arg0 *avax.UTXO) { } // AddUTXO indicates an expected call of AddUTXO. -func (mr *MockStateMockRecorder) AddUTXO(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) AddUTXO(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddUTXO", reflect.TypeOf((*MockState)(nil).AddUTXO), arg0) } @@ -337,7 +342,7 @@ func (m *MockState) DeleteUTXO(arg0 ids.ID) { } // DeleteUTXO indicates an expected call of DeleteUTXO. -func (mr *MockStateMockRecorder) DeleteUTXO(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) DeleteUTXO(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteUTXO", reflect.TypeOf((*MockState)(nil).DeleteUTXO), arg0) } @@ -352,7 +357,7 @@ func (m *MockState) GetBlock(arg0 ids.ID) (block.Block, error) { } // GetBlock indicates an expected call of GetBlock. -func (mr *MockStateMockRecorder) GetBlock(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) GetBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlock", reflect.TypeOf((*MockState)(nil).GetBlock), arg0) } @@ -367,7 +372,7 @@ func (m *MockState) GetBlockIDAtHeight(arg0 uint64) (ids.ID, error) { } // GetBlockIDAtHeight indicates an expected call of GetBlockIDAtHeight. -func (mr *MockStateMockRecorder) GetBlockIDAtHeight(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) GetBlockIDAtHeight(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlockIDAtHeight", reflect.TypeOf((*MockState)(nil).GetBlockIDAtHeight), arg0) } @@ -410,7 +415,7 @@ func (m *MockState) GetTx(arg0 ids.ID) (*txs.Tx, error) { } // GetTx indicates an expected call of GetTx. -func (mr *MockStateMockRecorder) GetTx(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) GetTx(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTx", reflect.TypeOf((*MockState)(nil).GetTx), arg0) } @@ -425,7 +430,7 @@ func (m *MockState) GetUTXO(arg0 ids.ID) (*avax.UTXO, error) { } // GetUTXO indicates an expected call of GetUTXO. -func (mr *MockStateMockRecorder) GetUTXO(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) GetUTXO(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUTXO", reflect.TypeOf((*MockState)(nil).GetUTXO), arg0) } @@ -439,7 +444,7 @@ func (m *MockState) InitializeChainState(arg0 ids.ID, arg1 time.Time) error { } // InitializeChainState indicates an expected call of InitializeChainState. -func (mr *MockStateMockRecorder) InitializeChainState(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) InitializeChainState(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitializeChainState", reflect.TypeOf((*MockState)(nil).InitializeChainState), arg0, arg1) } @@ -468,7 +473,7 @@ func (m *MockState) Prune(arg0 sync.Locker, arg1 logging.Logger) error { } // Prune indicates an expected call of Prune. -func (mr *MockStateMockRecorder) Prune(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) Prune(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Prune", reflect.TypeOf((*MockState)(nil).Prune), arg0, arg1) } @@ -494,7 +499,7 @@ func (m *MockState) SetLastAccepted(arg0 ids.ID) { } // SetLastAccepted indicates an expected call of SetLastAccepted. -func (mr *MockStateMockRecorder) SetLastAccepted(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) SetLastAccepted(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetLastAccepted", reflect.TypeOf((*MockState)(nil).SetLastAccepted), arg0) } @@ -506,7 +511,7 @@ func (m *MockState) SetTimestamp(arg0 time.Time) { } // SetTimestamp indicates an expected call of SetTimestamp. -func (mr *MockStateMockRecorder) SetTimestamp(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) SetTimestamp(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTimestamp", reflect.TypeOf((*MockState)(nil).SetTimestamp), arg0) } @@ -521,7 +526,7 @@ func (m *MockState) UTXOIDs(arg0 []byte, arg1 ids.ID, arg2 int) ([]ids.ID, error } // UTXOIDs indicates an expected call of UTXOIDs. -func (mr *MockStateMockRecorder) UTXOIDs(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) UTXOIDs(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UTXOIDs", reflect.TypeOf((*MockState)(nil).UTXOIDs), arg0, arg1, arg2) } @@ -556,7 +561,7 @@ func (m *MockDiff) AddBlock(arg0 block.Block) { } // AddBlock indicates an expected call of AddBlock. -func (mr *MockDiffMockRecorder) AddBlock(arg0 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) AddBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddBlock", reflect.TypeOf((*MockDiff)(nil).AddBlock), arg0) } @@ -568,7 +573,7 @@ func (m *MockDiff) AddTx(arg0 *txs.Tx) { } // AddTx indicates an expected call of AddTx. -func (mr *MockDiffMockRecorder) AddTx(arg0 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) AddTx(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddTx", reflect.TypeOf((*MockDiff)(nil).AddTx), arg0) } @@ -580,7 +585,7 @@ func (m *MockDiff) AddUTXO(arg0 *avax.UTXO) { } // AddUTXO indicates an expected call of AddUTXO. -func (mr *MockDiffMockRecorder) AddUTXO(arg0 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) AddUTXO(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddUTXO", reflect.TypeOf((*MockDiff)(nil).AddUTXO), arg0) } @@ -592,7 +597,7 @@ func (m *MockDiff) Apply(arg0 Chain) { } // Apply indicates an expected call of Apply. -func (mr *MockDiffMockRecorder) Apply(arg0 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) Apply(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Apply", reflect.TypeOf((*MockDiff)(nil).Apply), arg0) } @@ -604,7 +609,7 @@ func (m *MockDiff) DeleteUTXO(arg0 ids.ID) { } // DeleteUTXO indicates an expected call of DeleteUTXO. -func (mr *MockDiffMockRecorder) DeleteUTXO(arg0 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) DeleteUTXO(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteUTXO", reflect.TypeOf((*MockDiff)(nil).DeleteUTXO), arg0) } @@ -619,7 +624,7 @@ func (m *MockDiff) GetBlock(arg0 ids.ID) (block.Block, error) { } // GetBlock indicates an expected call of GetBlock. -func (mr *MockDiffMockRecorder) GetBlock(arg0 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) GetBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlock", reflect.TypeOf((*MockDiff)(nil).GetBlock), arg0) } @@ -634,7 +639,7 @@ func (m *MockDiff) GetBlockIDAtHeight(arg0 uint64) (ids.ID, error) { } // GetBlockIDAtHeight indicates an expected call of GetBlockIDAtHeight. -func (mr *MockDiffMockRecorder) GetBlockIDAtHeight(arg0 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) GetBlockIDAtHeight(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlockIDAtHeight", reflect.TypeOf((*MockDiff)(nil).GetBlockIDAtHeight), arg0) } @@ -677,7 +682,7 @@ func (m *MockDiff) GetTx(arg0 ids.ID) (*txs.Tx, error) { } // GetTx indicates an expected call of GetTx. -func (mr *MockDiffMockRecorder) GetTx(arg0 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) GetTx(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTx", reflect.TypeOf((*MockDiff)(nil).GetTx), arg0) } @@ -692,7 +697,7 @@ func (m *MockDiff) GetUTXO(arg0 ids.ID) (*avax.UTXO, error) { } // GetUTXO indicates an expected call of GetUTXO. -func (mr *MockDiffMockRecorder) GetUTXO(arg0 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) GetUTXO(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUTXO", reflect.TypeOf((*MockDiff)(nil).GetUTXO), arg0) } @@ -704,7 +709,7 @@ func (m *MockDiff) SetLastAccepted(arg0 ids.ID) { } // SetLastAccepted indicates an expected call of SetLastAccepted. -func (mr *MockDiffMockRecorder) SetLastAccepted(arg0 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) SetLastAccepted(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetLastAccepted", reflect.TypeOf((*MockDiff)(nil).SetLastAccepted), arg0) } @@ -716,7 +721,7 @@ func (m *MockDiff) SetTimestamp(arg0 time.Time) { } // SetTimestamp indicates an expected call of SetTimestamp. -func (mr *MockDiffMockRecorder) SetTimestamp(arg0 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) SetTimestamp(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTimestamp", reflect.TypeOf((*MockDiff)(nil).SetTimestamp), arg0) } diff --git a/vms/avm/txs/mempool/mock_mempool.go b/vms/avm/txs/mempool/mock_mempool.go index c82758bac51f..69860c38d5d3 100644 --- a/vms/avm/txs/mempool/mock_mempool.go +++ b/vms/avm/txs/mempool/mock_mempool.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms/avm/txs/mempool (interfaces: Mempool) +// +// Generated by this command: +// +// mockgen -package=mempool -destination=vms/avm/txs/mempool/mock_mempool.go github.com/ava-labs/avalanchego/vms/avm/txs/mempool Mempool +// // Package mempool is a generated GoMock package. package mempool @@ -44,7 +49,7 @@ func (m *MockMempool) Add(arg0 *txs.Tx) error { } // Add indicates an expected call of Add. -func (mr *MockMempoolMockRecorder) Add(arg0 interface{}) *gomock.Call { +func (mr *MockMempoolMockRecorder) Add(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Add", reflect.TypeOf((*MockMempool)(nil).Add), arg0) } @@ -59,7 +64,7 @@ func (m *MockMempool) Get(arg0 ids.ID) (*txs.Tx, bool) { } // Get indicates an expected call of Get. -func (mr *MockMempoolMockRecorder) Get(arg0 interface{}) *gomock.Call { +func (mr *MockMempoolMockRecorder) Get(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockMempool)(nil).Get), arg0) } @@ -73,7 +78,7 @@ func (m *MockMempool) GetDropReason(arg0 ids.ID) error { } // GetDropReason indicates an expected call of GetDropReason. -func (mr *MockMempoolMockRecorder) GetDropReason(arg0 interface{}) *gomock.Call { +func (mr *MockMempoolMockRecorder) GetDropReason(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDropReason", reflect.TypeOf((*MockMempool)(nil).GetDropReason), arg0) } @@ -85,7 +90,7 @@ func (m *MockMempool) Iterate(arg0 func(*txs.Tx) bool) { } // Iterate indicates an expected call of Iterate. -func (mr *MockMempoolMockRecorder) Iterate(arg0 interface{}) *gomock.Call { +func (mr *MockMempoolMockRecorder) Iterate(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Iterate", reflect.TypeOf((*MockMempool)(nil).Iterate), arg0) } @@ -111,7 +116,7 @@ func (m *MockMempool) MarkDropped(arg0 ids.ID, arg1 error) { } // MarkDropped indicates an expected call of MarkDropped. -func (mr *MockMempoolMockRecorder) MarkDropped(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMempoolMockRecorder) MarkDropped(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarkDropped", reflect.TypeOf((*MockMempool)(nil).MarkDropped), arg0, arg1) } @@ -134,7 +139,7 @@ func (mr *MockMempoolMockRecorder) Peek() *gomock.Call { // Remove mocks base method. func (m *MockMempool) Remove(arg0 ...*txs.Tx) { m.ctrl.T.Helper() - varargs := []interface{}{} + varargs := []any{} for _, a := range arg0 { varargs = append(varargs, a) } @@ -142,7 +147,7 @@ func (m *MockMempool) Remove(arg0 ...*txs.Tx) { } // Remove indicates an expected call of Remove. -func (mr *MockMempoolMockRecorder) Remove(arg0 ...interface{}) *gomock.Call { +func (mr *MockMempoolMockRecorder) Remove(arg0 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Remove", reflect.TypeOf((*MockMempool)(nil).Remove), arg0...) } diff --git a/vms/components/avax/mock_transferable_in.go b/vms/components/avax/mock_transferable_in.go index cbe350801e3b..b4db89933057 100644 --- a/vms/components/avax/mock_transferable_in.go +++ b/vms/components/avax/mock_transferable_in.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms/components/avax (interfaces: TransferableIn) +// +// Generated by this command: +// +// mockgen -package=avax -destination=vms/components/avax/mock_transferable_in.go github.com/ava-labs/avalanchego/vms/components/avax TransferableIn +// // Package avax is a generated GoMock package. package avax @@ -70,7 +75,7 @@ func (m *MockTransferableIn) InitCtx(arg0 *snow.Context) { } // InitCtx indicates an expected call of InitCtx. -func (mr *MockTransferableInMockRecorder) InitCtx(arg0 interface{}) *gomock.Call { +func (mr *MockTransferableInMockRecorder) InitCtx(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitCtx", reflect.TypeOf((*MockTransferableIn)(nil).InitCtx), arg0) } diff --git a/vms/components/verify/mock_verifiable.go b/vms/components/verify/mock_verifiable.go index 3b2609f6eb0f..fe0e5770500c 100644 --- a/vms/components/verify/mock_verifiable.go +++ b/vms/components/verify/mock_verifiable.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms/components/verify (interfaces: Verifiable) +// +// Generated by this command: +// +// mockgen -package=verify -destination=vms/components/verify/mock_verifiable.go github.com/ava-labs/avalanchego/vms/components/verify Verifiable +// // Package verify is a generated GoMock package. package verify diff --git a/vms/mock_manager.go b/vms/mock_manager.go index 70f3dc5ca840..cea232ba2a7d 100644 --- a/vms/mock_manager.go +++ b/vms/mock_manager.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms (interfaces: Factory,Manager) +// +// Generated by this command: +// +// mockgen -package=vms -destination=vms/mock_manager.go github.com/ava-labs/avalanchego/vms Factory,Manager +// // Package vms is a generated GoMock package. package vms @@ -37,16 +42,16 @@ func (m *MockFactory) EXPECT() *MockFactoryMockRecorder { } // New mocks base method. -func (m *MockFactory) New(arg0 logging.Logger) (interface{}, error) { +func (m *MockFactory) New(arg0 logging.Logger) (any, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "New", arg0) - ret0, _ := ret[0].(interface{}) + ret0, _ := ret[0].(any) ret1, _ := ret[1].(error) return ret0, ret1 } // New indicates an expected call of New. -func (mr *MockFactoryMockRecorder) New(arg0 interface{}) *gomock.Call { +func (mr *MockFactoryMockRecorder) New(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "New", reflect.TypeOf((*MockFactory)(nil).New), arg0) } @@ -83,7 +88,7 @@ func (m *MockManager) Alias(arg0 ids.ID, arg1 string) error { } // Alias indicates an expected call of Alias. -func (mr *MockManagerMockRecorder) Alias(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) Alias(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Alias", reflect.TypeOf((*MockManager)(nil).Alias), arg0, arg1) } @@ -98,7 +103,7 @@ func (m *MockManager) Aliases(arg0 ids.ID) ([]string, error) { } // Aliases indicates an expected call of Aliases. -func (mr *MockManagerMockRecorder) Aliases(arg0 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) Aliases(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Aliases", reflect.TypeOf((*MockManager)(nil).Aliases), arg0) } @@ -113,7 +118,7 @@ func (m *MockManager) GetFactory(arg0 ids.ID) (Factory, error) { } // GetFactory indicates an expected call of GetFactory. -func (mr *MockManagerMockRecorder) GetFactory(arg0 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) GetFactory(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFactory", reflect.TypeOf((*MockManager)(nil).GetFactory), arg0) } @@ -143,7 +148,7 @@ func (m *MockManager) Lookup(arg0 string) (ids.ID, error) { } // Lookup indicates an expected call of Lookup. -func (mr *MockManagerMockRecorder) Lookup(arg0 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) Lookup(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Lookup", reflect.TypeOf((*MockManager)(nil).Lookup), arg0) } @@ -158,7 +163,7 @@ func (m *MockManager) PrimaryAlias(arg0 ids.ID) (string, error) { } // PrimaryAlias indicates an expected call of PrimaryAlias. -func (mr *MockManagerMockRecorder) PrimaryAlias(arg0 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) PrimaryAlias(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PrimaryAlias", reflect.TypeOf((*MockManager)(nil).PrimaryAlias), arg0) } @@ -172,7 +177,7 @@ func (m *MockManager) PrimaryAliasOrDefault(arg0 ids.ID) string { } // PrimaryAliasOrDefault indicates an expected call of PrimaryAliasOrDefault. -func (mr *MockManagerMockRecorder) PrimaryAliasOrDefault(arg0 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) PrimaryAliasOrDefault(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PrimaryAliasOrDefault", reflect.TypeOf((*MockManager)(nil).PrimaryAliasOrDefault), arg0) } @@ -186,7 +191,7 @@ func (m *MockManager) RegisterFactory(arg0 context.Context, arg1 ids.ID, arg2 Fa } // RegisterFactory indicates an expected call of RegisterFactory. -func (mr *MockManagerMockRecorder) RegisterFactory(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) RegisterFactory(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterFactory", reflect.TypeOf((*MockManager)(nil).RegisterFactory), arg0, arg1, arg2) } @@ -198,7 +203,7 @@ func (m *MockManager) RemoveAliases(arg0 ids.ID) { } // RemoveAliases indicates an expected call of RemoveAliases. -func (mr *MockManagerMockRecorder) RemoveAliases(arg0 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) RemoveAliases(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveAliases", reflect.TypeOf((*MockManager)(nil).RemoveAliases), arg0) } diff --git a/vms/platformvm/block/mock_block.go b/vms/platformvm/block/mock_block.go index fde27ecbdc04..7bd281192253 100644 --- a/vms/platformvm/block/mock_block.go +++ b/vms/platformvm/block/mock_block.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms/platformvm/block (interfaces: Block) +// +// Generated by this command: +// +// mockgen -package=block -destination=vms/platformvm/block/mock_block.go github.com/ava-labs/avalanchego/vms/platformvm/block Block +// // Package block is a generated GoMock package. package block @@ -85,7 +90,7 @@ func (m *MockBlock) InitCtx(arg0 *snow.Context) { } // InitCtx indicates an expected call of InitCtx. -func (mr *MockBlockMockRecorder) InitCtx(arg0 interface{}) *gomock.Call { +func (mr *MockBlockMockRecorder) InitCtx(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitCtx", reflect.TypeOf((*MockBlock)(nil).InitCtx), arg0) } @@ -127,7 +132,7 @@ func (m *MockBlock) Visit(arg0 Visitor) error { } // Visit indicates an expected call of Visit. -func (mr *MockBlockMockRecorder) Visit(arg0 interface{}) *gomock.Call { +func (mr *MockBlockMockRecorder) Visit(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Visit", reflect.TypeOf((*MockBlock)(nil).Visit), arg0) } @@ -141,7 +146,7 @@ func (m *MockBlock) initialize(arg0 []byte) error { } // initialize indicates an expected call of initialize. -func (mr *MockBlockMockRecorder) initialize(arg0 interface{}) *gomock.Call { +func (mr *MockBlockMockRecorder) initialize(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "initialize", reflect.TypeOf((*MockBlock)(nil).initialize), arg0) } diff --git a/vms/platformvm/state/mock_staker_iterator.go b/vms/platformvm/state/mock_staker_iterator.go index a04f79c628da..62ba31d8b1c6 100644 --- a/vms/platformvm/state/mock_staker_iterator.go +++ b/vms/platformvm/state/mock_staker_iterator.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms/platformvm/state (interfaces: StakerIterator) +// +// Generated by this command: +// +// mockgen -package=state -destination=vms/platformvm/state/mock_staker_iterator.go github.com/ava-labs/avalanchego/vms/platformvm/state StakerIterator +// // Package state is a generated GoMock package. package state diff --git a/vms/platformvm/state/mock_state.go b/vms/platformvm/state/mock_state.go index 051bc729ac21..cfb9dd16944a 100644 --- a/vms/platformvm/state/mock_state.go +++ b/vms/platformvm/state/mock_state.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms/platformvm/state (interfaces: Chain,Diff,State,Versions) +// +// Generated by this command: +// +// mockgen -package=state -destination=vms/platformvm/state/mock_state.go github.com/ava-labs/avalanchego/vms/platformvm/state Chain,Diff,State,Versions +// // Package state is a generated GoMock package. package state @@ -52,7 +57,7 @@ func (m *MockChain) AddChain(arg0 *txs.Tx) { } // AddChain indicates an expected call of AddChain. -func (mr *MockChainMockRecorder) AddChain(arg0 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) AddChain(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddChain", reflect.TypeOf((*MockChain)(nil).AddChain), arg0) } @@ -64,7 +69,7 @@ func (m *MockChain) AddRewardUTXO(arg0 ids.ID, arg1 *avax.UTXO) { } // AddRewardUTXO indicates an expected call of AddRewardUTXO. -func (mr *MockChainMockRecorder) AddRewardUTXO(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) AddRewardUTXO(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddRewardUTXO", reflect.TypeOf((*MockChain)(nil).AddRewardUTXO), arg0, arg1) } @@ -76,7 +81,7 @@ func (m *MockChain) AddSubnet(arg0 *txs.Tx) { } // AddSubnet indicates an expected call of AddSubnet. -func (mr *MockChainMockRecorder) AddSubnet(arg0 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) AddSubnet(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddSubnet", reflect.TypeOf((*MockChain)(nil).AddSubnet), arg0) } @@ -88,7 +93,7 @@ func (m *MockChain) AddSubnetTransformation(arg0 *txs.Tx) { } // AddSubnetTransformation indicates an expected call of AddSubnetTransformation. -func (mr *MockChainMockRecorder) AddSubnetTransformation(arg0 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) AddSubnetTransformation(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddSubnetTransformation", reflect.TypeOf((*MockChain)(nil).AddSubnetTransformation), arg0) } @@ -100,7 +105,7 @@ func (m *MockChain) AddTx(arg0 *txs.Tx, arg1 status.Status) { } // AddTx indicates an expected call of AddTx. -func (mr *MockChainMockRecorder) AddTx(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) AddTx(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddTx", reflect.TypeOf((*MockChain)(nil).AddTx), arg0, arg1) } @@ -112,7 +117,7 @@ func (m *MockChain) AddUTXO(arg0 *avax.UTXO) { } // AddUTXO indicates an expected call of AddUTXO. -func (mr *MockChainMockRecorder) AddUTXO(arg0 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) AddUTXO(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddUTXO", reflect.TypeOf((*MockChain)(nil).AddUTXO), arg0) } @@ -124,7 +129,7 @@ func (m *MockChain) DeleteCurrentDelegator(arg0 *Staker) { } // DeleteCurrentDelegator indicates an expected call of DeleteCurrentDelegator. -func (mr *MockChainMockRecorder) DeleteCurrentDelegator(arg0 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) DeleteCurrentDelegator(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteCurrentDelegator", reflect.TypeOf((*MockChain)(nil).DeleteCurrentDelegator), arg0) } @@ -136,7 +141,7 @@ func (m *MockChain) DeleteCurrentValidator(arg0 *Staker) { } // DeleteCurrentValidator indicates an expected call of DeleteCurrentValidator. -func (mr *MockChainMockRecorder) DeleteCurrentValidator(arg0 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) DeleteCurrentValidator(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteCurrentValidator", reflect.TypeOf((*MockChain)(nil).DeleteCurrentValidator), arg0) } @@ -148,7 +153,7 @@ func (m *MockChain) DeletePendingDelegator(arg0 *Staker) { } // DeletePendingDelegator indicates an expected call of DeletePendingDelegator. -func (mr *MockChainMockRecorder) DeletePendingDelegator(arg0 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) DeletePendingDelegator(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeletePendingDelegator", reflect.TypeOf((*MockChain)(nil).DeletePendingDelegator), arg0) } @@ -160,7 +165,7 @@ func (m *MockChain) DeletePendingValidator(arg0 *Staker) { } // DeletePendingValidator indicates an expected call of DeletePendingValidator. -func (mr *MockChainMockRecorder) DeletePendingValidator(arg0 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) DeletePendingValidator(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeletePendingValidator", reflect.TypeOf((*MockChain)(nil).DeletePendingValidator), arg0) } @@ -172,7 +177,7 @@ func (m *MockChain) DeleteUTXO(arg0 ids.ID) { } // DeleteUTXO indicates an expected call of DeleteUTXO. -func (mr *MockChainMockRecorder) DeleteUTXO(arg0 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) DeleteUTXO(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteUTXO", reflect.TypeOf((*MockChain)(nil).DeleteUTXO), arg0) } @@ -187,7 +192,7 @@ func (m *MockChain) GetCurrentDelegatorIterator(arg0 ids.ID, arg1 ids.NodeID) (S } // GetCurrentDelegatorIterator indicates an expected call of GetCurrentDelegatorIterator. -func (mr *MockChainMockRecorder) GetCurrentDelegatorIterator(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) GetCurrentDelegatorIterator(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCurrentDelegatorIterator", reflect.TypeOf((*MockChain)(nil).GetCurrentDelegatorIterator), arg0, arg1) } @@ -217,7 +222,7 @@ func (m *MockChain) GetCurrentSupply(arg0 ids.ID) (uint64, error) { } // GetCurrentSupply indicates an expected call of GetCurrentSupply. -func (mr *MockChainMockRecorder) GetCurrentSupply(arg0 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) GetCurrentSupply(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCurrentSupply", reflect.TypeOf((*MockChain)(nil).GetCurrentSupply), arg0) } @@ -232,7 +237,7 @@ func (m *MockChain) GetCurrentValidator(arg0 ids.ID, arg1 ids.NodeID) (*Staker, } // GetCurrentValidator indicates an expected call of GetCurrentValidator. -func (mr *MockChainMockRecorder) GetCurrentValidator(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) GetCurrentValidator(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCurrentValidator", reflect.TypeOf((*MockChain)(nil).GetCurrentValidator), arg0, arg1) } @@ -247,7 +252,7 @@ func (m *MockChain) GetDelegateeReward(arg0 ids.ID, arg1 ids.NodeID) (uint64, er } // GetDelegateeReward indicates an expected call of GetDelegateeReward. -func (mr *MockChainMockRecorder) GetDelegateeReward(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) GetDelegateeReward(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDelegateeReward", reflect.TypeOf((*MockChain)(nil).GetDelegateeReward), arg0, arg1) } @@ -262,7 +267,7 @@ func (m *MockChain) GetPendingDelegatorIterator(arg0 ids.ID, arg1 ids.NodeID) (S } // GetPendingDelegatorIterator indicates an expected call of GetPendingDelegatorIterator. -func (mr *MockChainMockRecorder) GetPendingDelegatorIterator(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) GetPendingDelegatorIterator(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPendingDelegatorIterator", reflect.TypeOf((*MockChain)(nil).GetPendingDelegatorIterator), arg0, arg1) } @@ -292,7 +297,7 @@ func (m *MockChain) GetPendingValidator(arg0 ids.ID, arg1 ids.NodeID) (*Staker, } // GetPendingValidator indicates an expected call of GetPendingValidator. -func (mr *MockChainMockRecorder) GetPendingValidator(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) GetPendingValidator(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPendingValidator", reflect.TypeOf((*MockChain)(nil).GetPendingValidator), arg0, arg1) } @@ -307,7 +312,7 @@ func (m *MockChain) GetSubnetOwner(arg0 ids.ID) (fx.Owner, error) { } // GetSubnetOwner indicates an expected call of GetSubnetOwner. -func (mr *MockChainMockRecorder) GetSubnetOwner(arg0 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) GetSubnetOwner(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSubnetOwner", reflect.TypeOf((*MockChain)(nil).GetSubnetOwner), arg0) } @@ -322,7 +327,7 @@ func (m *MockChain) GetSubnetTransformation(arg0 ids.ID) (*txs.Tx, error) { } // GetSubnetTransformation indicates an expected call of GetSubnetTransformation. -func (mr *MockChainMockRecorder) GetSubnetTransformation(arg0 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) GetSubnetTransformation(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSubnetTransformation", reflect.TypeOf((*MockChain)(nil).GetSubnetTransformation), arg0) } @@ -352,7 +357,7 @@ func (m *MockChain) GetTx(arg0 ids.ID) (*txs.Tx, status.Status, error) { } // GetTx indicates an expected call of GetTx. -func (mr *MockChainMockRecorder) GetTx(arg0 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) GetTx(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTx", reflect.TypeOf((*MockChain)(nil).GetTx), arg0) } @@ -367,7 +372,7 @@ func (m *MockChain) GetUTXO(arg0 ids.ID) (*avax.UTXO, error) { } // GetUTXO indicates an expected call of GetUTXO. -func (mr *MockChainMockRecorder) GetUTXO(arg0 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) GetUTXO(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUTXO", reflect.TypeOf((*MockChain)(nil).GetUTXO), arg0) } @@ -379,7 +384,7 @@ func (m *MockChain) PutCurrentDelegator(arg0 *Staker) { } // PutCurrentDelegator indicates an expected call of PutCurrentDelegator. -func (mr *MockChainMockRecorder) PutCurrentDelegator(arg0 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) PutCurrentDelegator(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutCurrentDelegator", reflect.TypeOf((*MockChain)(nil).PutCurrentDelegator), arg0) } @@ -391,7 +396,7 @@ func (m *MockChain) PutCurrentValidator(arg0 *Staker) { } // PutCurrentValidator indicates an expected call of PutCurrentValidator. -func (mr *MockChainMockRecorder) PutCurrentValidator(arg0 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) PutCurrentValidator(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutCurrentValidator", reflect.TypeOf((*MockChain)(nil).PutCurrentValidator), arg0) } @@ -403,7 +408,7 @@ func (m *MockChain) PutPendingDelegator(arg0 *Staker) { } // PutPendingDelegator indicates an expected call of PutPendingDelegator. -func (mr *MockChainMockRecorder) PutPendingDelegator(arg0 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) PutPendingDelegator(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutPendingDelegator", reflect.TypeOf((*MockChain)(nil).PutPendingDelegator), arg0) } @@ -415,7 +420,7 @@ func (m *MockChain) PutPendingValidator(arg0 *Staker) { } // PutPendingValidator indicates an expected call of PutPendingValidator. -func (mr *MockChainMockRecorder) PutPendingValidator(arg0 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) PutPendingValidator(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutPendingValidator", reflect.TypeOf((*MockChain)(nil).PutPendingValidator), arg0) } @@ -427,7 +432,7 @@ func (m *MockChain) SetCurrentSupply(arg0 ids.ID, arg1 uint64) { } // SetCurrentSupply indicates an expected call of SetCurrentSupply. -func (mr *MockChainMockRecorder) SetCurrentSupply(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) SetCurrentSupply(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetCurrentSupply", reflect.TypeOf((*MockChain)(nil).SetCurrentSupply), arg0, arg1) } @@ -441,7 +446,7 @@ func (m *MockChain) SetDelegateeReward(arg0 ids.ID, arg1 ids.NodeID, arg2 uint64 } // SetDelegateeReward indicates an expected call of SetDelegateeReward. -func (mr *MockChainMockRecorder) SetDelegateeReward(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) SetDelegateeReward(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetDelegateeReward", reflect.TypeOf((*MockChain)(nil).SetDelegateeReward), arg0, arg1, arg2) } @@ -453,7 +458,7 @@ func (m *MockChain) SetSubnetOwner(arg0 ids.ID, arg1 fx.Owner) { } // SetSubnetOwner indicates an expected call of SetSubnetOwner. -func (mr *MockChainMockRecorder) SetSubnetOwner(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) SetSubnetOwner(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetSubnetOwner", reflect.TypeOf((*MockChain)(nil).SetSubnetOwner), arg0, arg1) } @@ -465,7 +470,7 @@ func (m *MockChain) SetTimestamp(arg0 time.Time) { } // SetTimestamp indicates an expected call of SetTimestamp. -func (mr *MockChainMockRecorder) SetTimestamp(arg0 interface{}) *gomock.Call { +func (mr *MockChainMockRecorder) SetTimestamp(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTimestamp", reflect.TypeOf((*MockChain)(nil).SetTimestamp), arg0) } @@ -500,7 +505,7 @@ func (m *MockDiff) AddChain(arg0 *txs.Tx) { } // AddChain indicates an expected call of AddChain. -func (mr *MockDiffMockRecorder) AddChain(arg0 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) AddChain(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddChain", reflect.TypeOf((*MockDiff)(nil).AddChain), arg0) } @@ -512,7 +517,7 @@ func (m *MockDiff) AddRewardUTXO(arg0 ids.ID, arg1 *avax.UTXO) { } // AddRewardUTXO indicates an expected call of AddRewardUTXO. -func (mr *MockDiffMockRecorder) AddRewardUTXO(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) AddRewardUTXO(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddRewardUTXO", reflect.TypeOf((*MockDiff)(nil).AddRewardUTXO), arg0, arg1) } @@ -524,7 +529,7 @@ func (m *MockDiff) AddSubnet(arg0 *txs.Tx) { } // AddSubnet indicates an expected call of AddSubnet. -func (mr *MockDiffMockRecorder) AddSubnet(arg0 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) AddSubnet(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddSubnet", reflect.TypeOf((*MockDiff)(nil).AddSubnet), arg0) } @@ -536,7 +541,7 @@ func (m *MockDiff) AddSubnetTransformation(arg0 *txs.Tx) { } // AddSubnetTransformation indicates an expected call of AddSubnetTransformation. -func (mr *MockDiffMockRecorder) AddSubnetTransformation(arg0 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) AddSubnetTransformation(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddSubnetTransformation", reflect.TypeOf((*MockDiff)(nil).AddSubnetTransformation), arg0) } @@ -548,7 +553,7 @@ func (m *MockDiff) AddTx(arg0 *txs.Tx, arg1 status.Status) { } // AddTx indicates an expected call of AddTx. -func (mr *MockDiffMockRecorder) AddTx(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) AddTx(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddTx", reflect.TypeOf((*MockDiff)(nil).AddTx), arg0, arg1) } @@ -560,7 +565,7 @@ func (m *MockDiff) AddUTXO(arg0 *avax.UTXO) { } // AddUTXO indicates an expected call of AddUTXO. -func (mr *MockDiffMockRecorder) AddUTXO(arg0 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) AddUTXO(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddUTXO", reflect.TypeOf((*MockDiff)(nil).AddUTXO), arg0) } @@ -574,7 +579,7 @@ func (m *MockDiff) Apply(arg0 Chain) error { } // Apply indicates an expected call of Apply. -func (mr *MockDiffMockRecorder) Apply(arg0 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) Apply(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Apply", reflect.TypeOf((*MockDiff)(nil).Apply), arg0) } @@ -586,7 +591,7 @@ func (m *MockDiff) DeleteCurrentDelegator(arg0 *Staker) { } // DeleteCurrentDelegator indicates an expected call of DeleteCurrentDelegator. -func (mr *MockDiffMockRecorder) DeleteCurrentDelegator(arg0 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) DeleteCurrentDelegator(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteCurrentDelegator", reflect.TypeOf((*MockDiff)(nil).DeleteCurrentDelegator), arg0) } @@ -598,7 +603,7 @@ func (m *MockDiff) DeleteCurrentValidator(arg0 *Staker) { } // DeleteCurrentValidator indicates an expected call of DeleteCurrentValidator. -func (mr *MockDiffMockRecorder) DeleteCurrentValidator(arg0 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) DeleteCurrentValidator(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteCurrentValidator", reflect.TypeOf((*MockDiff)(nil).DeleteCurrentValidator), arg0) } @@ -610,7 +615,7 @@ func (m *MockDiff) DeletePendingDelegator(arg0 *Staker) { } // DeletePendingDelegator indicates an expected call of DeletePendingDelegator. -func (mr *MockDiffMockRecorder) DeletePendingDelegator(arg0 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) DeletePendingDelegator(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeletePendingDelegator", reflect.TypeOf((*MockDiff)(nil).DeletePendingDelegator), arg0) } @@ -622,7 +627,7 @@ func (m *MockDiff) DeletePendingValidator(arg0 *Staker) { } // DeletePendingValidator indicates an expected call of DeletePendingValidator. -func (mr *MockDiffMockRecorder) DeletePendingValidator(arg0 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) DeletePendingValidator(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeletePendingValidator", reflect.TypeOf((*MockDiff)(nil).DeletePendingValidator), arg0) } @@ -634,7 +639,7 @@ func (m *MockDiff) DeleteUTXO(arg0 ids.ID) { } // DeleteUTXO indicates an expected call of DeleteUTXO. -func (mr *MockDiffMockRecorder) DeleteUTXO(arg0 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) DeleteUTXO(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteUTXO", reflect.TypeOf((*MockDiff)(nil).DeleteUTXO), arg0) } @@ -649,7 +654,7 @@ func (m *MockDiff) GetCurrentDelegatorIterator(arg0 ids.ID, arg1 ids.NodeID) (St } // GetCurrentDelegatorIterator indicates an expected call of GetCurrentDelegatorIterator. -func (mr *MockDiffMockRecorder) GetCurrentDelegatorIterator(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) GetCurrentDelegatorIterator(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCurrentDelegatorIterator", reflect.TypeOf((*MockDiff)(nil).GetCurrentDelegatorIterator), arg0, arg1) } @@ -679,7 +684,7 @@ func (m *MockDiff) GetCurrentSupply(arg0 ids.ID) (uint64, error) { } // GetCurrentSupply indicates an expected call of GetCurrentSupply. -func (mr *MockDiffMockRecorder) GetCurrentSupply(arg0 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) GetCurrentSupply(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCurrentSupply", reflect.TypeOf((*MockDiff)(nil).GetCurrentSupply), arg0) } @@ -694,7 +699,7 @@ func (m *MockDiff) GetCurrentValidator(arg0 ids.ID, arg1 ids.NodeID) (*Staker, e } // GetCurrentValidator indicates an expected call of GetCurrentValidator. -func (mr *MockDiffMockRecorder) GetCurrentValidator(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) GetCurrentValidator(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCurrentValidator", reflect.TypeOf((*MockDiff)(nil).GetCurrentValidator), arg0, arg1) } @@ -709,7 +714,7 @@ func (m *MockDiff) GetDelegateeReward(arg0 ids.ID, arg1 ids.NodeID) (uint64, err } // GetDelegateeReward indicates an expected call of GetDelegateeReward. -func (mr *MockDiffMockRecorder) GetDelegateeReward(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) GetDelegateeReward(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDelegateeReward", reflect.TypeOf((*MockDiff)(nil).GetDelegateeReward), arg0, arg1) } @@ -724,7 +729,7 @@ func (m *MockDiff) GetPendingDelegatorIterator(arg0 ids.ID, arg1 ids.NodeID) (St } // GetPendingDelegatorIterator indicates an expected call of GetPendingDelegatorIterator. -func (mr *MockDiffMockRecorder) GetPendingDelegatorIterator(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) GetPendingDelegatorIterator(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPendingDelegatorIterator", reflect.TypeOf((*MockDiff)(nil).GetPendingDelegatorIterator), arg0, arg1) } @@ -754,7 +759,7 @@ func (m *MockDiff) GetPendingValidator(arg0 ids.ID, arg1 ids.NodeID) (*Staker, e } // GetPendingValidator indicates an expected call of GetPendingValidator. -func (mr *MockDiffMockRecorder) GetPendingValidator(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) GetPendingValidator(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPendingValidator", reflect.TypeOf((*MockDiff)(nil).GetPendingValidator), arg0, arg1) } @@ -769,7 +774,7 @@ func (m *MockDiff) GetSubnetOwner(arg0 ids.ID) (fx.Owner, error) { } // GetSubnetOwner indicates an expected call of GetSubnetOwner. -func (mr *MockDiffMockRecorder) GetSubnetOwner(arg0 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) GetSubnetOwner(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSubnetOwner", reflect.TypeOf((*MockDiff)(nil).GetSubnetOwner), arg0) } @@ -784,7 +789,7 @@ func (m *MockDiff) GetSubnetTransformation(arg0 ids.ID) (*txs.Tx, error) { } // GetSubnetTransformation indicates an expected call of GetSubnetTransformation. -func (mr *MockDiffMockRecorder) GetSubnetTransformation(arg0 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) GetSubnetTransformation(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSubnetTransformation", reflect.TypeOf((*MockDiff)(nil).GetSubnetTransformation), arg0) } @@ -814,7 +819,7 @@ func (m *MockDiff) GetTx(arg0 ids.ID) (*txs.Tx, status.Status, error) { } // GetTx indicates an expected call of GetTx. -func (mr *MockDiffMockRecorder) GetTx(arg0 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) GetTx(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTx", reflect.TypeOf((*MockDiff)(nil).GetTx), arg0) } @@ -829,7 +834,7 @@ func (m *MockDiff) GetUTXO(arg0 ids.ID) (*avax.UTXO, error) { } // GetUTXO indicates an expected call of GetUTXO. -func (mr *MockDiffMockRecorder) GetUTXO(arg0 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) GetUTXO(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUTXO", reflect.TypeOf((*MockDiff)(nil).GetUTXO), arg0) } @@ -841,7 +846,7 @@ func (m *MockDiff) PutCurrentDelegator(arg0 *Staker) { } // PutCurrentDelegator indicates an expected call of PutCurrentDelegator. -func (mr *MockDiffMockRecorder) PutCurrentDelegator(arg0 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) PutCurrentDelegator(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutCurrentDelegator", reflect.TypeOf((*MockDiff)(nil).PutCurrentDelegator), arg0) } @@ -853,7 +858,7 @@ func (m *MockDiff) PutCurrentValidator(arg0 *Staker) { } // PutCurrentValidator indicates an expected call of PutCurrentValidator. -func (mr *MockDiffMockRecorder) PutCurrentValidator(arg0 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) PutCurrentValidator(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutCurrentValidator", reflect.TypeOf((*MockDiff)(nil).PutCurrentValidator), arg0) } @@ -865,7 +870,7 @@ func (m *MockDiff) PutPendingDelegator(arg0 *Staker) { } // PutPendingDelegator indicates an expected call of PutPendingDelegator. -func (mr *MockDiffMockRecorder) PutPendingDelegator(arg0 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) PutPendingDelegator(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutPendingDelegator", reflect.TypeOf((*MockDiff)(nil).PutPendingDelegator), arg0) } @@ -877,7 +882,7 @@ func (m *MockDiff) PutPendingValidator(arg0 *Staker) { } // PutPendingValidator indicates an expected call of PutPendingValidator. -func (mr *MockDiffMockRecorder) PutPendingValidator(arg0 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) PutPendingValidator(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutPendingValidator", reflect.TypeOf((*MockDiff)(nil).PutPendingValidator), arg0) } @@ -889,7 +894,7 @@ func (m *MockDiff) SetCurrentSupply(arg0 ids.ID, arg1 uint64) { } // SetCurrentSupply indicates an expected call of SetCurrentSupply. -func (mr *MockDiffMockRecorder) SetCurrentSupply(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) SetCurrentSupply(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetCurrentSupply", reflect.TypeOf((*MockDiff)(nil).SetCurrentSupply), arg0, arg1) } @@ -903,7 +908,7 @@ func (m *MockDiff) SetDelegateeReward(arg0 ids.ID, arg1 ids.NodeID, arg2 uint64) } // SetDelegateeReward indicates an expected call of SetDelegateeReward. -func (mr *MockDiffMockRecorder) SetDelegateeReward(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) SetDelegateeReward(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetDelegateeReward", reflect.TypeOf((*MockDiff)(nil).SetDelegateeReward), arg0, arg1, arg2) } @@ -915,7 +920,7 @@ func (m *MockDiff) SetSubnetOwner(arg0 ids.ID, arg1 fx.Owner) { } // SetSubnetOwner indicates an expected call of SetSubnetOwner. -func (mr *MockDiffMockRecorder) SetSubnetOwner(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) SetSubnetOwner(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetSubnetOwner", reflect.TypeOf((*MockDiff)(nil).SetSubnetOwner), arg0, arg1) } @@ -927,7 +932,7 @@ func (m *MockDiff) SetTimestamp(arg0 time.Time) { } // SetTimestamp indicates an expected call of SetTimestamp. -func (mr *MockDiffMockRecorder) SetTimestamp(arg0 interface{}) *gomock.Call { +func (mr *MockDiffMockRecorder) SetTimestamp(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTimestamp", reflect.TypeOf((*MockDiff)(nil).SetTimestamp), arg0) } @@ -974,7 +979,7 @@ func (m *MockState) AddChain(arg0 *txs.Tx) { } // AddChain indicates an expected call of AddChain. -func (mr *MockStateMockRecorder) AddChain(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) AddChain(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddChain", reflect.TypeOf((*MockState)(nil).AddChain), arg0) } @@ -986,7 +991,7 @@ func (m *MockState) AddRewardUTXO(arg0 ids.ID, arg1 *avax.UTXO) { } // AddRewardUTXO indicates an expected call of AddRewardUTXO. -func (mr *MockStateMockRecorder) AddRewardUTXO(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) AddRewardUTXO(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddRewardUTXO", reflect.TypeOf((*MockState)(nil).AddRewardUTXO), arg0, arg1) } @@ -998,7 +1003,7 @@ func (m *MockState) AddStatelessBlock(arg0 block.Block) { } // AddStatelessBlock indicates an expected call of AddStatelessBlock. -func (mr *MockStateMockRecorder) AddStatelessBlock(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) AddStatelessBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddStatelessBlock", reflect.TypeOf((*MockState)(nil).AddStatelessBlock), arg0) } @@ -1010,7 +1015,7 @@ func (m *MockState) AddSubnet(arg0 *txs.Tx) { } // AddSubnet indicates an expected call of AddSubnet. -func (mr *MockStateMockRecorder) AddSubnet(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) AddSubnet(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddSubnet", reflect.TypeOf((*MockState)(nil).AddSubnet), arg0) } @@ -1022,7 +1027,7 @@ func (m *MockState) AddSubnetTransformation(arg0 *txs.Tx) { } // AddSubnetTransformation indicates an expected call of AddSubnetTransformation. -func (mr *MockStateMockRecorder) AddSubnetTransformation(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) AddSubnetTransformation(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddSubnetTransformation", reflect.TypeOf((*MockState)(nil).AddSubnetTransformation), arg0) } @@ -1034,7 +1039,7 @@ func (m *MockState) AddTx(arg0 *txs.Tx, arg1 status.Status) { } // AddTx indicates an expected call of AddTx. -func (mr *MockStateMockRecorder) AddTx(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) AddTx(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddTx", reflect.TypeOf((*MockState)(nil).AddTx), arg0, arg1) } @@ -1046,7 +1051,7 @@ func (m *MockState) AddUTXO(arg0 *avax.UTXO) { } // AddUTXO indicates an expected call of AddUTXO. -func (mr *MockStateMockRecorder) AddUTXO(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) AddUTXO(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddUTXO", reflect.TypeOf((*MockState)(nil).AddUTXO), arg0) } @@ -1060,7 +1065,7 @@ func (m *MockState) ApplyValidatorPublicKeyDiffs(arg0 context.Context, arg1 map[ } // ApplyValidatorPublicKeyDiffs indicates an expected call of ApplyValidatorPublicKeyDiffs. -func (mr *MockStateMockRecorder) ApplyValidatorPublicKeyDiffs(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) ApplyValidatorPublicKeyDiffs(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ApplyValidatorPublicKeyDiffs", reflect.TypeOf((*MockState)(nil).ApplyValidatorPublicKeyDiffs), arg0, arg1, arg2, arg3) } @@ -1074,7 +1079,7 @@ func (m *MockState) ApplyValidatorWeightDiffs(arg0 context.Context, arg1 map[ids } // ApplyValidatorWeightDiffs indicates an expected call of ApplyValidatorWeightDiffs. -func (mr *MockStateMockRecorder) ApplyValidatorWeightDiffs(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) ApplyValidatorWeightDiffs(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ApplyValidatorWeightDiffs", reflect.TypeOf((*MockState)(nil).ApplyValidatorWeightDiffs), arg0, arg1, arg2, arg3, arg4) } @@ -1143,7 +1148,7 @@ func (m *MockState) DeleteCurrentDelegator(arg0 *Staker) { } // DeleteCurrentDelegator indicates an expected call of DeleteCurrentDelegator. -func (mr *MockStateMockRecorder) DeleteCurrentDelegator(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) DeleteCurrentDelegator(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteCurrentDelegator", reflect.TypeOf((*MockState)(nil).DeleteCurrentDelegator), arg0) } @@ -1155,7 +1160,7 @@ func (m *MockState) DeleteCurrentValidator(arg0 *Staker) { } // DeleteCurrentValidator indicates an expected call of DeleteCurrentValidator. -func (mr *MockStateMockRecorder) DeleteCurrentValidator(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) DeleteCurrentValidator(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteCurrentValidator", reflect.TypeOf((*MockState)(nil).DeleteCurrentValidator), arg0) } @@ -1167,7 +1172,7 @@ func (m *MockState) DeletePendingDelegator(arg0 *Staker) { } // DeletePendingDelegator indicates an expected call of DeletePendingDelegator. -func (mr *MockStateMockRecorder) DeletePendingDelegator(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) DeletePendingDelegator(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeletePendingDelegator", reflect.TypeOf((*MockState)(nil).DeletePendingDelegator), arg0) } @@ -1179,7 +1184,7 @@ func (m *MockState) DeletePendingValidator(arg0 *Staker) { } // DeletePendingValidator indicates an expected call of DeletePendingValidator. -func (mr *MockStateMockRecorder) DeletePendingValidator(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) DeletePendingValidator(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeletePendingValidator", reflect.TypeOf((*MockState)(nil).DeletePendingValidator), arg0) } @@ -1191,7 +1196,7 @@ func (m *MockState) DeleteUTXO(arg0 ids.ID) { } // DeleteUTXO indicates an expected call of DeleteUTXO. -func (mr *MockStateMockRecorder) DeleteUTXO(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) DeleteUTXO(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteUTXO", reflect.TypeOf((*MockState)(nil).DeleteUTXO), arg0) } @@ -1206,7 +1211,7 @@ func (m *MockState) GetBlockIDAtHeight(arg0 uint64) (ids.ID, error) { } // GetBlockIDAtHeight indicates an expected call of GetBlockIDAtHeight. -func (mr *MockStateMockRecorder) GetBlockIDAtHeight(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) GetBlockIDAtHeight(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlockIDAtHeight", reflect.TypeOf((*MockState)(nil).GetBlockIDAtHeight), arg0) } @@ -1221,7 +1226,7 @@ func (m *MockState) GetChains(arg0 ids.ID) ([]*txs.Tx, error) { } // GetChains indicates an expected call of GetChains. -func (mr *MockStateMockRecorder) GetChains(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) GetChains(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetChains", reflect.TypeOf((*MockState)(nil).GetChains), arg0) } @@ -1236,7 +1241,7 @@ func (m *MockState) GetCurrentDelegatorIterator(arg0 ids.ID, arg1 ids.NodeID) (S } // GetCurrentDelegatorIterator indicates an expected call of GetCurrentDelegatorIterator. -func (mr *MockStateMockRecorder) GetCurrentDelegatorIterator(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) GetCurrentDelegatorIterator(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCurrentDelegatorIterator", reflect.TypeOf((*MockState)(nil).GetCurrentDelegatorIterator), arg0, arg1) } @@ -1266,7 +1271,7 @@ func (m *MockState) GetCurrentSupply(arg0 ids.ID) (uint64, error) { } // GetCurrentSupply indicates an expected call of GetCurrentSupply. -func (mr *MockStateMockRecorder) GetCurrentSupply(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) GetCurrentSupply(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCurrentSupply", reflect.TypeOf((*MockState)(nil).GetCurrentSupply), arg0) } @@ -1281,7 +1286,7 @@ func (m *MockState) GetCurrentValidator(arg0 ids.ID, arg1 ids.NodeID) (*Staker, } // GetCurrentValidator indicates an expected call of GetCurrentValidator. -func (mr *MockStateMockRecorder) GetCurrentValidator(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) GetCurrentValidator(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCurrentValidator", reflect.TypeOf((*MockState)(nil).GetCurrentValidator), arg0, arg1) } @@ -1296,7 +1301,7 @@ func (m *MockState) GetDelegateeReward(arg0 ids.ID, arg1 ids.NodeID) (uint64, er } // GetDelegateeReward indicates an expected call of GetDelegateeReward. -func (mr *MockStateMockRecorder) GetDelegateeReward(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) GetDelegateeReward(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDelegateeReward", reflect.TypeOf((*MockState)(nil).GetDelegateeReward), arg0, arg1) } @@ -1325,7 +1330,7 @@ func (m *MockState) GetPendingDelegatorIterator(arg0 ids.ID, arg1 ids.NodeID) (S } // GetPendingDelegatorIterator indicates an expected call of GetPendingDelegatorIterator. -func (mr *MockStateMockRecorder) GetPendingDelegatorIterator(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) GetPendingDelegatorIterator(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPendingDelegatorIterator", reflect.TypeOf((*MockState)(nil).GetPendingDelegatorIterator), arg0, arg1) } @@ -1355,7 +1360,7 @@ func (m *MockState) GetPendingValidator(arg0 ids.ID, arg1 ids.NodeID) (*Staker, } // GetPendingValidator indicates an expected call of GetPendingValidator. -func (mr *MockStateMockRecorder) GetPendingValidator(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) GetPendingValidator(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPendingValidator", reflect.TypeOf((*MockState)(nil).GetPendingValidator), arg0, arg1) } @@ -1370,7 +1375,7 @@ func (m *MockState) GetRewardUTXOs(arg0 ids.ID) ([]*avax.UTXO, error) { } // GetRewardUTXOs indicates an expected call of GetRewardUTXOs. -func (mr *MockStateMockRecorder) GetRewardUTXOs(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) GetRewardUTXOs(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRewardUTXOs", reflect.TypeOf((*MockState)(nil).GetRewardUTXOs), arg0) } @@ -1385,7 +1390,7 @@ func (m *MockState) GetStartTime(arg0 ids.NodeID, arg1 ids.ID) (time.Time, error } // GetStartTime indicates an expected call of GetStartTime. -func (mr *MockStateMockRecorder) GetStartTime(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) GetStartTime(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStartTime", reflect.TypeOf((*MockState)(nil).GetStartTime), arg0, arg1) } @@ -1400,7 +1405,7 @@ func (m *MockState) GetStatelessBlock(arg0 ids.ID) (block.Block, error) { } // GetStatelessBlock indicates an expected call of GetStatelessBlock. -func (mr *MockStateMockRecorder) GetStatelessBlock(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) GetStatelessBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStatelessBlock", reflect.TypeOf((*MockState)(nil).GetStatelessBlock), arg0) } @@ -1415,7 +1420,7 @@ func (m *MockState) GetSubnetOwner(arg0 ids.ID) (fx.Owner, error) { } // GetSubnetOwner indicates an expected call of GetSubnetOwner. -func (mr *MockStateMockRecorder) GetSubnetOwner(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) GetSubnetOwner(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSubnetOwner", reflect.TypeOf((*MockState)(nil).GetSubnetOwner), arg0) } @@ -1430,7 +1435,7 @@ func (m *MockState) GetSubnetTransformation(arg0 ids.ID) (*txs.Tx, error) { } // GetSubnetTransformation indicates an expected call of GetSubnetTransformation. -func (mr *MockStateMockRecorder) GetSubnetTransformation(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) GetSubnetTransformation(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSubnetTransformation", reflect.TypeOf((*MockState)(nil).GetSubnetTransformation), arg0) } @@ -1475,7 +1480,7 @@ func (m *MockState) GetTx(arg0 ids.ID) (*txs.Tx, status.Status, error) { } // GetTx indicates an expected call of GetTx. -func (mr *MockStateMockRecorder) GetTx(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) GetTx(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTx", reflect.TypeOf((*MockState)(nil).GetTx), arg0) } @@ -1490,7 +1495,7 @@ func (m *MockState) GetUTXO(arg0 ids.ID) (*avax.UTXO, error) { } // GetUTXO indicates an expected call of GetUTXO. -func (mr *MockStateMockRecorder) GetUTXO(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) GetUTXO(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUTXO", reflect.TypeOf((*MockState)(nil).GetUTXO), arg0) } @@ -1506,7 +1511,7 @@ func (m *MockState) GetUptime(arg0 ids.NodeID, arg1 ids.ID) (time.Duration, time } // GetUptime indicates an expected call of GetUptime. -func (mr *MockStateMockRecorder) GetUptime(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) GetUptime(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUptime", reflect.TypeOf((*MockState)(nil).GetUptime), arg0, arg1) } @@ -1520,7 +1525,7 @@ func (m *MockState) PruneAndIndex(arg0 sync.Locker, arg1 logging.Logger) error { } // PruneAndIndex indicates an expected call of PruneAndIndex. -func (mr *MockStateMockRecorder) PruneAndIndex(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) PruneAndIndex(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PruneAndIndex", reflect.TypeOf((*MockState)(nil).PruneAndIndex), arg0, arg1) } @@ -1532,7 +1537,7 @@ func (m *MockState) PutCurrentDelegator(arg0 *Staker) { } // PutCurrentDelegator indicates an expected call of PutCurrentDelegator. -func (mr *MockStateMockRecorder) PutCurrentDelegator(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) PutCurrentDelegator(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutCurrentDelegator", reflect.TypeOf((*MockState)(nil).PutCurrentDelegator), arg0) } @@ -1544,7 +1549,7 @@ func (m *MockState) PutCurrentValidator(arg0 *Staker) { } // PutCurrentValidator indicates an expected call of PutCurrentValidator. -func (mr *MockStateMockRecorder) PutCurrentValidator(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) PutCurrentValidator(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutCurrentValidator", reflect.TypeOf((*MockState)(nil).PutCurrentValidator), arg0) } @@ -1556,7 +1561,7 @@ func (m *MockState) PutPendingDelegator(arg0 *Staker) { } // PutPendingDelegator indicates an expected call of PutPendingDelegator. -func (mr *MockStateMockRecorder) PutPendingDelegator(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) PutPendingDelegator(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutPendingDelegator", reflect.TypeOf((*MockState)(nil).PutPendingDelegator), arg0) } @@ -1568,7 +1573,7 @@ func (m *MockState) PutPendingValidator(arg0 *Staker) { } // PutPendingValidator indicates an expected call of PutPendingValidator. -func (mr *MockStateMockRecorder) PutPendingValidator(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) PutPendingValidator(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutPendingValidator", reflect.TypeOf((*MockState)(nil).PutPendingValidator), arg0) } @@ -1580,7 +1585,7 @@ func (m *MockState) SetCurrentSupply(arg0 ids.ID, arg1 uint64) { } // SetCurrentSupply indicates an expected call of SetCurrentSupply. -func (mr *MockStateMockRecorder) SetCurrentSupply(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) SetCurrentSupply(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetCurrentSupply", reflect.TypeOf((*MockState)(nil).SetCurrentSupply), arg0, arg1) } @@ -1594,7 +1599,7 @@ func (m *MockState) SetDelegateeReward(arg0 ids.ID, arg1 ids.NodeID, arg2 uint64 } // SetDelegateeReward indicates an expected call of SetDelegateeReward. -func (mr *MockStateMockRecorder) SetDelegateeReward(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) SetDelegateeReward(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetDelegateeReward", reflect.TypeOf((*MockState)(nil).SetDelegateeReward), arg0, arg1, arg2) } @@ -1606,7 +1611,7 @@ func (m *MockState) SetHeight(arg0 uint64) { } // SetHeight indicates an expected call of SetHeight. -func (mr *MockStateMockRecorder) SetHeight(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) SetHeight(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetHeight", reflect.TypeOf((*MockState)(nil).SetHeight), arg0) } @@ -1618,7 +1623,7 @@ func (m *MockState) SetLastAccepted(arg0 ids.ID) { } // SetLastAccepted indicates an expected call of SetLastAccepted. -func (mr *MockStateMockRecorder) SetLastAccepted(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) SetLastAccepted(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetLastAccepted", reflect.TypeOf((*MockState)(nil).SetLastAccepted), arg0) } @@ -1630,7 +1635,7 @@ func (m *MockState) SetSubnetOwner(arg0 ids.ID, arg1 fx.Owner) { } // SetSubnetOwner indicates an expected call of SetSubnetOwner. -func (mr *MockStateMockRecorder) SetSubnetOwner(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) SetSubnetOwner(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetSubnetOwner", reflect.TypeOf((*MockState)(nil).SetSubnetOwner), arg0, arg1) } @@ -1642,7 +1647,7 @@ func (m *MockState) SetTimestamp(arg0 time.Time) { } // SetTimestamp indicates an expected call of SetTimestamp. -func (mr *MockStateMockRecorder) SetTimestamp(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) SetTimestamp(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTimestamp", reflect.TypeOf((*MockState)(nil).SetTimestamp), arg0) } @@ -1656,7 +1661,7 @@ func (m *MockState) SetUptime(arg0 ids.NodeID, arg1 ids.ID, arg2 time.Duration, } // SetUptime indicates an expected call of SetUptime. -func (mr *MockStateMockRecorder) SetUptime(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) SetUptime(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetUptime", reflect.TypeOf((*MockState)(nil).SetUptime), arg0, arg1, arg2, arg3) } @@ -1686,7 +1691,7 @@ func (m *MockState) UTXOIDs(arg0 []byte, arg1 ids.ID, arg2 int) ([]ids.ID, error } // UTXOIDs indicates an expected call of UTXOIDs. -func (mr *MockStateMockRecorder) UTXOIDs(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) UTXOIDs(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UTXOIDs", reflect.TypeOf((*MockState)(nil).UTXOIDs), arg0, arg1, arg2) } @@ -1724,7 +1729,7 @@ func (m *MockVersions) GetState(arg0 ids.ID) (Chain, bool) { } // GetState indicates an expected call of GetState. -func (mr *MockVersionsMockRecorder) GetState(arg0 interface{}) *gomock.Call { +func (mr *MockVersionsMockRecorder) GetState(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetState", reflect.TypeOf((*MockVersions)(nil).GetState), arg0) } diff --git a/vms/platformvm/txs/mempool/mock_mempool.go b/vms/platformvm/txs/mempool/mock_mempool.go index d88f0592571a..c47f42e92718 100644 --- a/vms/platformvm/txs/mempool/mock_mempool.go +++ b/vms/platformvm/txs/mempool/mock_mempool.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms/platformvm/txs/mempool (interfaces: Mempool) +// +// Generated by this command: +// +// mockgen -package=mempool -destination=vms/platformvm/txs/mempool/mock_mempool.go github.com/ava-labs/avalanchego/vms/platformvm/txs/mempool Mempool +// // Package mempool is a generated GoMock package. package mempool @@ -44,7 +49,7 @@ func (m *MockMempool) Add(arg0 *txs.Tx) error { } // Add indicates an expected call of Add. -func (mr *MockMempoolMockRecorder) Add(arg0 interface{}) *gomock.Call { +func (mr *MockMempoolMockRecorder) Add(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Add", reflect.TypeOf((*MockMempool)(nil).Add), arg0) } @@ -59,7 +64,7 @@ func (m *MockMempool) Get(arg0 ids.ID) (*txs.Tx, bool) { } // Get indicates an expected call of Get. -func (mr *MockMempoolMockRecorder) Get(arg0 interface{}) *gomock.Call { +func (mr *MockMempoolMockRecorder) Get(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockMempool)(nil).Get), arg0) } @@ -73,7 +78,7 @@ func (m *MockMempool) GetDropReason(arg0 ids.ID) error { } // GetDropReason indicates an expected call of GetDropReason. -func (mr *MockMempoolMockRecorder) GetDropReason(arg0 interface{}) *gomock.Call { +func (mr *MockMempoolMockRecorder) GetDropReason(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDropReason", reflect.TypeOf((*MockMempool)(nil).GetDropReason), arg0) } @@ -85,7 +90,7 @@ func (m *MockMempool) Iterate(arg0 func(*txs.Tx) bool) { } // Iterate indicates an expected call of Iterate. -func (mr *MockMempoolMockRecorder) Iterate(arg0 interface{}) *gomock.Call { +func (mr *MockMempoolMockRecorder) Iterate(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Iterate", reflect.TypeOf((*MockMempool)(nil).Iterate), arg0) } @@ -111,7 +116,7 @@ func (m *MockMempool) MarkDropped(arg0 ids.ID, arg1 error) { } // MarkDropped indicates an expected call of MarkDropped. -func (mr *MockMempoolMockRecorder) MarkDropped(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMempoolMockRecorder) MarkDropped(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarkDropped", reflect.TypeOf((*MockMempool)(nil).MarkDropped), arg0, arg1) } @@ -134,7 +139,7 @@ func (mr *MockMempoolMockRecorder) Peek() *gomock.Call { // Remove mocks base method. func (m *MockMempool) Remove(arg0 ...*txs.Tx) { m.ctrl.T.Helper() - varargs := []interface{}{} + varargs := []any{} for _, a := range arg0 { varargs = append(varargs, a) } @@ -142,7 +147,7 @@ func (m *MockMempool) Remove(arg0 ...*txs.Tx) { } // Remove indicates an expected call of Remove. -func (mr *MockMempoolMockRecorder) Remove(arg0 ...interface{}) *gomock.Call { +func (mr *MockMempoolMockRecorder) Remove(arg0 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Remove", reflect.TypeOf((*MockMempool)(nil).Remove), arg0...) } @@ -154,7 +159,7 @@ func (m *MockMempool) RequestBuildBlock(arg0 bool) { } // RequestBuildBlock indicates an expected call of RequestBuildBlock. -func (mr *MockMempoolMockRecorder) RequestBuildBlock(arg0 interface{}) *gomock.Call { +func (mr *MockMempoolMockRecorder) RequestBuildBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RequestBuildBlock", reflect.TypeOf((*MockMempool)(nil).RequestBuildBlock), arg0) } diff --git a/vms/platformvm/utxo/mock_verifier.go b/vms/platformvm/utxo/mock_verifier.go index 15766981f685..0447806cb7ae 100644 --- a/vms/platformvm/utxo/mock_verifier.go +++ b/vms/platformvm/utxo/mock_verifier.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms/platformvm/utxo (interfaces: Verifier) +// +// Generated by this command: +// +// mockgen -package=utxo -destination=vms/platformvm/utxo/mock_verifier.go github.com/ava-labs/avalanchego/vms/platformvm/utxo Verifier +// // Package utxo is a generated GoMock package. package utxo @@ -46,7 +51,7 @@ func (m *MockVerifier) VerifySpend(arg0 txs.UnsignedTx, arg1 avax.UTXOGetter, ar } // VerifySpend indicates an expected call of VerifySpend. -func (mr *MockVerifierMockRecorder) VerifySpend(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call { +func (mr *MockVerifierMockRecorder) VerifySpend(arg0, arg1, arg2, arg3, arg4, arg5 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VerifySpend", reflect.TypeOf((*MockVerifier)(nil).VerifySpend), arg0, arg1, arg2, arg3, arg4, arg5) } @@ -60,7 +65,7 @@ func (m *MockVerifier) VerifySpendUTXOs(arg0 txs.UnsignedTx, arg1 []*avax.UTXO, } // VerifySpendUTXOs indicates an expected call of VerifySpendUTXOs. -func (mr *MockVerifierMockRecorder) VerifySpendUTXOs(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call { +func (mr *MockVerifierMockRecorder) VerifySpendUTXOs(arg0, arg1, arg2, arg3, arg4, arg5 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VerifySpendUTXOs", reflect.TypeOf((*MockVerifier)(nil).VerifySpendUTXOs), arg0, arg1, arg2, arg3, arg4, arg5) } diff --git a/vms/proposervm/mock_post_fork_block.go b/vms/proposervm/mock_post_fork_block.go index 23c87ea5fa00..ab449b6363bf 100644 --- a/vms/proposervm/mock_post_fork_block.go +++ b/vms/proposervm/mock_post_fork_block.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms/proposervm (interfaces: PostForkBlock) +// +// Generated by this command: +// +// mockgen -package=proposervm -destination=vms/proposervm/mock_post_fork_block.go github.com/ava-labs/avalanchego/vms/proposervm PostForkBlock +// // Package proposervm is a generated GoMock package. package proposervm @@ -48,7 +53,7 @@ func (m *MockPostForkBlock) Accept(arg0 context.Context) error { } // Accept indicates an expected call of Accept. -func (mr *MockPostForkBlockMockRecorder) Accept(arg0 interface{}) *gomock.Call { +func (mr *MockPostForkBlockMockRecorder) Accept(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Accept", reflect.TypeOf((*MockPostForkBlock)(nil).Accept), arg0) } @@ -118,7 +123,7 @@ func (m *MockPostForkBlock) Reject(arg0 context.Context) error { } // Reject indicates an expected call of Reject. -func (mr *MockPostForkBlockMockRecorder) Reject(arg0 interface{}) *gomock.Call { +func (mr *MockPostForkBlockMockRecorder) Reject(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Reject", reflect.TypeOf((*MockPostForkBlock)(nil).Reject), arg0) } @@ -160,7 +165,7 @@ func (m *MockPostForkBlock) Verify(arg0 context.Context) error { } // Verify indicates an expected call of Verify. -func (mr *MockPostForkBlockMockRecorder) Verify(arg0 interface{}) *gomock.Call { +func (mr *MockPostForkBlockMockRecorder) Verify(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Verify", reflect.TypeOf((*MockPostForkBlock)(nil).Verify), arg0) } @@ -174,7 +179,7 @@ func (m *MockPostForkBlock) acceptInnerBlk(arg0 context.Context) error { } // acceptInnerBlk indicates an expected call of acceptInnerBlk. -func (mr *MockPostForkBlockMockRecorder) acceptInnerBlk(arg0 interface{}) *gomock.Call { +func (mr *MockPostForkBlockMockRecorder) acceptInnerBlk(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "acceptInnerBlk", reflect.TypeOf((*MockPostForkBlock)(nil).acceptInnerBlk), arg0) } @@ -203,7 +208,7 @@ func (m *MockPostForkBlock) buildChild(arg0 context.Context) (Block, error) { } // buildChild indicates an expected call of buildChild. -func (mr *MockPostForkBlockMockRecorder) buildChild(arg0 interface{}) *gomock.Call { +func (mr *MockPostForkBlockMockRecorder) buildChild(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "buildChild", reflect.TypeOf((*MockPostForkBlock)(nil).buildChild), arg0) } @@ -246,7 +251,7 @@ func (m *MockPostForkBlock) pChainHeight(arg0 context.Context) (uint64, error) { } // pChainHeight indicates an expected call of pChainHeight. -func (mr *MockPostForkBlockMockRecorder) pChainHeight(arg0 interface{}) *gomock.Call { +func (mr *MockPostForkBlockMockRecorder) pChainHeight(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "pChainHeight", reflect.TypeOf((*MockPostForkBlock)(nil).pChainHeight), arg0) } @@ -258,7 +263,7 @@ func (m *MockPostForkBlock) setInnerBlk(arg0 snowman.Block) { } // setInnerBlk indicates an expected call of setInnerBlk. -func (mr *MockPostForkBlockMockRecorder) setInnerBlk(arg0 interface{}) *gomock.Call { +func (mr *MockPostForkBlockMockRecorder) setInnerBlk(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "setInnerBlk", reflect.TypeOf((*MockPostForkBlock)(nil).setInnerBlk), arg0) } @@ -270,7 +275,7 @@ func (m *MockPostForkBlock) setStatus(arg0 choices.Status) { } // setStatus indicates an expected call of setStatus. -func (mr *MockPostForkBlockMockRecorder) setStatus(arg0 interface{}) *gomock.Call { +func (mr *MockPostForkBlockMockRecorder) setStatus(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "setStatus", reflect.TypeOf((*MockPostForkBlock)(nil).setStatus), arg0) } @@ -284,7 +289,7 @@ func (m *MockPostForkBlock) verifyPostForkChild(arg0 context.Context, arg1 *post } // verifyPostForkChild indicates an expected call of verifyPostForkChild. -func (mr *MockPostForkBlockMockRecorder) verifyPostForkChild(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockPostForkBlockMockRecorder) verifyPostForkChild(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "verifyPostForkChild", reflect.TypeOf((*MockPostForkBlock)(nil).verifyPostForkChild), arg0, arg1) } @@ -298,7 +303,7 @@ func (m *MockPostForkBlock) verifyPostForkOption(arg0 context.Context, arg1 *pos } // verifyPostForkOption indicates an expected call of verifyPostForkOption. -func (mr *MockPostForkBlockMockRecorder) verifyPostForkOption(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockPostForkBlockMockRecorder) verifyPostForkOption(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "verifyPostForkOption", reflect.TypeOf((*MockPostForkBlock)(nil).verifyPostForkOption), arg0, arg1) } @@ -312,7 +317,7 @@ func (m *MockPostForkBlock) verifyPreForkChild(arg0 context.Context, arg1 *preFo } // verifyPreForkChild indicates an expected call of verifyPreForkChild. -func (mr *MockPostForkBlockMockRecorder) verifyPreForkChild(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockPostForkBlockMockRecorder) verifyPreForkChild(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "verifyPreForkChild", reflect.TypeOf((*MockPostForkBlock)(nil).verifyPreForkChild), arg0, arg1) } diff --git a/vms/proposervm/proposer/mock_windower.go b/vms/proposervm/proposer/mock_windower.go index d5e142b93791..5384da8ccf80 100644 --- a/vms/proposervm/proposer/mock_windower.go +++ b/vms/proposervm/proposer/mock_windower.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms/proposervm/proposer (interfaces: Windower) +// +// Generated by this command: +// +// mockgen -package=proposer -destination=vms/proposervm/proposer/mock_windower.go github.com/ava-labs/avalanchego/vms/proposervm/proposer Windower +// // Package proposer is a generated GoMock package. package proposer @@ -46,7 +51,7 @@ func (m *MockWindower) Delay(arg0 context.Context, arg1, arg2 uint64, arg3 ids.N } // Delay indicates an expected call of Delay. -func (mr *MockWindowerMockRecorder) Delay(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { +func (mr *MockWindowerMockRecorder) Delay(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delay", reflect.TypeOf((*MockWindower)(nil).Delay), arg0, arg1, arg2, arg3, arg4) } @@ -61,7 +66,7 @@ func (m *MockWindower) ExpectedProposer(arg0 context.Context, arg1, arg2, arg3 u } // ExpectedProposer indicates an expected call of ExpectedProposer. -func (mr *MockWindowerMockRecorder) ExpectedProposer(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockWindowerMockRecorder) ExpectedProposer(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExpectedProposer", reflect.TypeOf((*MockWindower)(nil).ExpectedProposer), arg0, arg1, arg2, arg3) } @@ -76,7 +81,7 @@ func (m *MockWindower) MinDelayForProposer(arg0 context.Context, arg1, arg2 uint } // MinDelayForProposer indicates an expected call of MinDelayForProposer. -func (mr *MockWindowerMockRecorder) MinDelayForProposer(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { +func (mr *MockWindowerMockRecorder) MinDelayForProposer(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MinDelayForProposer", reflect.TypeOf((*MockWindower)(nil).MinDelayForProposer), arg0, arg1, arg2, arg3, arg4) } @@ -91,7 +96,7 @@ func (m *MockWindower) Proposers(arg0 context.Context, arg1, arg2 uint64, arg3 i } // Proposers indicates an expected call of Proposers. -func (mr *MockWindowerMockRecorder) Proposers(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockWindowerMockRecorder) Proposers(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Proposers", reflect.TypeOf((*MockWindower)(nil).Proposers), arg0, arg1, arg2, arg3) } diff --git a/vms/proposervm/scheduler/mock_scheduler.go b/vms/proposervm/scheduler/mock_scheduler.go index 9018cad9b5ff..f4a8f1e62197 100644 --- a/vms/proposervm/scheduler/mock_scheduler.go +++ b/vms/proposervm/scheduler/mock_scheduler.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms/proposervm/scheduler (interfaces: Scheduler) +// +// Generated by this command: +// +// mockgen -package=scheduler -destination=vms/proposervm/scheduler/mock_scheduler.go github.com/ava-labs/avalanchego/vms/proposervm/scheduler Scheduler +// // Package scheduler is a generated GoMock package. package scheduler @@ -53,7 +58,7 @@ func (m *MockScheduler) Dispatch(arg0 time.Time) { } // Dispatch indicates an expected call of Dispatch. -func (mr *MockSchedulerMockRecorder) Dispatch(arg0 interface{}) *gomock.Call { +func (mr *MockSchedulerMockRecorder) Dispatch(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Dispatch", reflect.TypeOf((*MockScheduler)(nil).Dispatch), arg0) } @@ -65,7 +70,7 @@ func (m *MockScheduler) SetBuildBlockTime(arg0 time.Time) { } // SetBuildBlockTime indicates an expected call of SetBuildBlockTime. -func (mr *MockSchedulerMockRecorder) SetBuildBlockTime(arg0 interface{}) *gomock.Call { +func (mr *MockSchedulerMockRecorder) SetBuildBlockTime(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetBuildBlockTime", reflect.TypeOf((*MockScheduler)(nil).SetBuildBlockTime), arg0) } diff --git a/vms/proposervm/state/mock_state.go b/vms/proposervm/state/mock_state.go index fcd266f2d790..6384528a61dd 100644 --- a/vms/proposervm/state/mock_state.go +++ b/vms/proposervm/state/mock_state.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms/proposervm/state (interfaces: State) +// +// Generated by this command: +// +// mockgen -package=state -destination=vms/proposervm/state/mock_state.go github.com/ava-labs/avalanchego/vms/proposervm/state State +// // Package state is a generated GoMock package. package state @@ -59,7 +64,7 @@ func (m *MockState) DeleteBlock(arg0 ids.ID) error { } // DeleteBlock indicates an expected call of DeleteBlock. -func (mr *MockStateMockRecorder) DeleteBlock(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) DeleteBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteBlock", reflect.TypeOf((*MockState)(nil).DeleteBlock), arg0) } @@ -73,7 +78,7 @@ func (m *MockState) DeleteBlockIDAtHeight(arg0 uint64) error { } // DeleteBlockIDAtHeight indicates an expected call of DeleteBlockIDAtHeight. -func (mr *MockStateMockRecorder) DeleteBlockIDAtHeight(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) DeleteBlockIDAtHeight(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteBlockIDAtHeight", reflect.TypeOf((*MockState)(nil).DeleteBlockIDAtHeight), arg0) } @@ -117,7 +122,7 @@ func (m *MockState) GetBlock(arg0 ids.ID) (block.Block, choices.Status, error) { } // GetBlock indicates an expected call of GetBlock. -func (mr *MockStateMockRecorder) GetBlock(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) GetBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlock", reflect.TypeOf((*MockState)(nil).GetBlock), arg0) } @@ -132,7 +137,7 @@ func (m *MockState) GetBlockIDAtHeight(arg0 uint64) (ids.ID, error) { } // GetBlockIDAtHeight indicates an expected call of GetBlockIDAtHeight. -func (mr *MockStateMockRecorder) GetBlockIDAtHeight(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) GetBlockIDAtHeight(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlockIDAtHeight", reflect.TypeOf((*MockState)(nil).GetBlockIDAtHeight), arg0) } @@ -206,7 +211,7 @@ func (m *MockState) PutBlock(arg0 block.Block, arg1 choices.Status) error { } // PutBlock indicates an expected call of PutBlock. -func (mr *MockStateMockRecorder) PutBlock(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) PutBlock(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutBlock", reflect.TypeOf((*MockState)(nil).PutBlock), arg0, arg1) } @@ -220,7 +225,7 @@ func (m *MockState) SetBlockIDAtHeight(arg0 uint64, arg1 ids.ID) error { } // SetBlockIDAtHeight indicates an expected call of SetBlockIDAtHeight. -func (mr *MockStateMockRecorder) SetBlockIDAtHeight(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) SetBlockIDAtHeight(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetBlockIDAtHeight", reflect.TypeOf((*MockState)(nil).SetBlockIDAtHeight), arg0, arg1) } @@ -234,7 +239,7 @@ func (m *MockState) SetCheckpoint(arg0 ids.ID) error { } // SetCheckpoint indicates an expected call of SetCheckpoint. -func (mr *MockStateMockRecorder) SetCheckpoint(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) SetCheckpoint(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetCheckpoint", reflect.TypeOf((*MockState)(nil).SetCheckpoint), arg0) } @@ -248,7 +253,7 @@ func (m *MockState) SetForkHeight(arg0 uint64) error { } // SetForkHeight indicates an expected call of SetForkHeight. -func (mr *MockStateMockRecorder) SetForkHeight(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) SetForkHeight(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetForkHeight", reflect.TypeOf((*MockState)(nil).SetForkHeight), arg0) } @@ -262,7 +267,7 @@ func (m *MockState) SetLastAccepted(arg0 ids.ID) error { } // SetLastAccepted indicates an expected call of SetLastAccepted. -func (mr *MockStateMockRecorder) SetLastAccepted(arg0 interface{}) *gomock.Call { +func (mr *MockStateMockRecorder) SetLastAccepted(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetLastAccepted", reflect.TypeOf((*MockState)(nil).SetLastAccepted), arg0) } diff --git a/vms/registry/mock_vm_getter.go b/vms/registry/mock_vm_getter.go index 1645c521c518..30c38f1b6a74 100644 --- a/vms/registry/mock_vm_getter.go +++ b/vms/registry/mock_vm_getter.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms/registry (interfaces: VMGetter) +// +// Generated by this command: +// +// mockgen -package=registry -destination=vms/registry/mock_vm_getter.go github.com/ava-labs/avalanchego/vms/registry VMGetter +// // Package registry is a generated GoMock package. package registry diff --git a/vms/registry/mock_vm_registry.go b/vms/registry/mock_vm_registry.go index 4febab38fc5e..43efd85a6015 100644 --- a/vms/registry/mock_vm_registry.go +++ b/vms/registry/mock_vm_registry.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms/registry (interfaces: VMRegistry) +// +// Generated by this command: +// +// mockgen -package=registry -destination=vms/registry/mock_vm_registry.go github.com/ava-labs/avalanchego/vms/registry VMRegistry +// // Package registry is a generated GoMock package. package registry @@ -46,7 +51,7 @@ func (m *MockVMRegistry) Reload(arg0 context.Context) ([]ids.ID, map[ids.ID]erro } // Reload indicates an expected call of Reload. -func (mr *MockVMRegistryMockRecorder) Reload(arg0 interface{}) *gomock.Call { +func (mr *MockVMRegistryMockRecorder) Reload(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Reload", reflect.TypeOf((*MockVMRegistry)(nil).Reload), arg0) } diff --git a/x/sync/mock_client.go b/x/sync/mock_client.go index 9bbd81127e35..98fa6d69fd9f 100644 --- a/x/sync/mock_client.go +++ b/x/sync/mock_client.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/x/sync (interfaces: Client) +// +// Generated by this command: +// +// mockgen -package=sync -destination=x/sync/mock_client.go github.com/ava-labs/avalanchego/x/sync Client +// // Package sync is a generated GoMock package. package sync @@ -46,7 +51,7 @@ func (m *MockClient) GetChangeProof(arg0 context.Context, arg1 *sync.SyncGetChan } // GetChangeProof indicates an expected call of GetChangeProof. -func (mr *MockClientMockRecorder) GetChangeProof(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) GetChangeProof(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetChangeProof", reflect.TypeOf((*MockClient)(nil).GetChangeProof), arg0, arg1, arg2) } @@ -61,7 +66,7 @@ func (m *MockClient) GetRangeProof(arg0 context.Context, arg1 *sync.SyncGetRange } // GetRangeProof indicates an expected call of GetRangeProof. -func (mr *MockClientMockRecorder) GetRangeProof(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) GetRangeProof(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRangeProof", reflect.TypeOf((*MockClient)(nil).GetRangeProof), arg0, arg1) } diff --git a/x/sync/mock_network_client.go b/x/sync/mock_network_client.go index 027b4f549366..428191492c4d 100644 --- a/x/sync/mock_network_client.go +++ b/x/sync/mock_network_client.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/x/sync (interfaces: NetworkClient) +// +// Generated by this command: +// +// mockgen -package=sync -destination=x/sync/mock_network_client.go github.com/ava-labs/avalanchego/x/sync NetworkClient +// // Package sync is a generated GoMock package. package sync @@ -45,7 +50,7 @@ func (m *MockNetworkClient) AppRequestFailed(arg0 context.Context, arg1 ids.Node } // AppRequestFailed indicates an expected call of AppRequestFailed. -func (mr *MockNetworkClientMockRecorder) AppRequestFailed(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockNetworkClientMockRecorder) AppRequestFailed(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AppRequestFailed", reflect.TypeOf((*MockNetworkClient)(nil).AppRequestFailed), arg0, arg1, arg2) } @@ -59,7 +64,7 @@ func (m *MockNetworkClient) AppResponse(arg0 context.Context, arg1 ids.NodeID, a } // AppResponse indicates an expected call of AppResponse. -func (mr *MockNetworkClientMockRecorder) AppResponse(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockNetworkClientMockRecorder) AppResponse(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AppResponse", reflect.TypeOf((*MockNetworkClient)(nil).AppResponse), arg0, arg1, arg2, arg3) } @@ -73,7 +78,7 @@ func (m *MockNetworkClient) Connected(arg0 context.Context, arg1 ids.NodeID, arg } // Connected indicates an expected call of Connected. -func (mr *MockNetworkClientMockRecorder) Connected(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockNetworkClientMockRecorder) Connected(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Connected", reflect.TypeOf((*MockNetworkClient)(nil).Connected), arg0, arg1, arg2) } @@ -87,7 +92,7 @@ func (m *MockNetworkClient) Disconnected(arg0 context.Context, arg1 ids.NodeID) } // Disconnected indicates an expected call of Disconnected. -func (mr *MockNetworkClientMockRecorder) Disconnected(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockNetworkClientMockRecorder) Disconnected(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Disconnected", reflect.TypeOf((*MockNetworkClient)(nil).Disconnected), arg0, arg1) } @@ -102,7 +107,7 @@ func (m *MockNetworkClient) Request(arg0 context.Context, arg1 ids.NodeID, arg2 } // Request indicates an expected call of Request. -func (mr *MockNetworkClientMockRecorder) Request(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockNetworkClientMockRecorder) Request(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Request", reflect.TypeOf((*MockNetworkClient)(nil).Request), arg0, arg1, arg2) } @@ -118,7 +123,7 @@ func (m *MockNetworkClient) RequestAny(arg0 context.Context, arg1 *version.Appli } // RequestAny indicates an expected call of RequestAny. -func (mr *MockNetworkClientMockRecorder) RequestAny(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockNetworkClientMockRecorder) RequestAny(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RequestAny", reflect.TypeOf((*MockNetworkClient)(nil).RequestAny), arg0, arg1, arg2) } From d23eecca9762e38eb86cdb97a86454bb95ae507c Mon Sep 17 00:00:00 2001 From: Dhruba Basu <7675102+dhrubabasu@users.noreply.github.com> Date: Wed, 17 Jan 2024 12:18:59 -0500 Subject: [PATCH 45/57] Add `mockgen` source mode for generics + bls imports (#2615) --- scripts/mock.gen.sh | 16 ++ scripts/mocks.mockgen.source.txt | 10 + snow/engine/common/mock_sender.go | 194 +++++++------- snow/networking/router/mock_router.go | 78 +++--- .../networking/sender/mock_external_sender.go | 26 +- snow/validators/mock_manager.go | 130 +++++----- vms/avm/block/executor/mock_manager.go | 60 ++--- vms/avm/txs/mock_unsigned_tx.go | 34 +-- vms/platformvm/block/executor/mock_manager.go | 22 +- vms/platformvm/txs/mock_staker.go | 126 ---------- ..._scheduled_staker.go => mock_staker_tx.go} | 116 ++++++++- vms/platformvm/txs/mock_unsigned_tx.go | 42 ++-- x/merkledb/mock_db.go | 236 +++++++++--------- 13 files changed, 548 insertions(+), 542 deletions(-) create mode 100644 scripts/mocks.mockgen.source.txt delete mode 100644 vms/platformvm/txs/mock_staker.go rename vms/platformvm/txs/{mock_scheduled_staker.go => mock_staker_tx.go} (57%) diff --git a/scripts/mock.gen.sh b/scripts/mock.gen.sh index a4e74488c5df..e7eb04618016 100755 --- a/scripts/mock.gen.sh +++ b/scripts/mock.gen.sh @@ -27,4 +27,20 @@ do done < "$input" +# tuples of (source import path, comma-separated interface names to exclude, output file path) +input="scripts/mocks.mockgen.source.txt" +while IFS= read -r line +do + IFS='=' read source_path exclude_interfaces output_path <<< "${line}" + package_name=$(basename $(dirname $output_path)) + echo "Generating ${output_path}..." + + mockgen \ + -source=${source_path} \ + -destination=${output_path} \ + -package=${package_name} \ + -exclude_interfaces=${exclude_interfaces} + +done < "$input" + echo "SUCCESS" diff --git a/scripts/mocks.mockgen.source.txt b/scripts/mocks.mockgen.source.txt new file mode 100644 index 000000000000..02782a7b7d9c --- /dev/null +++ b/scripts/mocks.mockgen.source.txt @@ -0,0 +1,10 @@ +snow/engine/common/sender.go=StateSummarySender,AcceptedStateSummarySender,FrontierSender,AcceptedSender,FetchSender,AppSender,QuerySender,CrossChainAppSender,NetworkAppSender,Gossiper=snow/engine/common/mock_sender.go +snow/networking/router/router.go=InternalHandler=snow/networking/router/mock_router.go +snow/networking/sender/external_sender.go==snow/networking/sender/mock_external_sender.go +snow/validators/manager.go=SetCallbackListener=snow/validators/mock_manager.go +vms/avm/block/executor/manager.go==vms/avm/block/executor/mock_manager.go +vms/avm/txs/tx.go==vms/avm/txs/mock_unsigned_tx.go +vms/platformvm/block/executor/manager.go==vms/platformvm/block/executor/mock_manager.go +vms/platformvm/txs/staker_tx.go=ValidatorTx,DelegatorTx,StakerTx,PermissionlessStaker=vms/platformvm/txs/mock_staker_tx.go +vms/platformvm/txs/unsigned_tx.go==vms/platformvm/txs/mock_unsigned_tx.go +x/merkledb/db.go=ChangeProofer,RangeProofer,Clearer,Prefetcher=x/merkledb/mock_db.go diff --git a/snow/engine/common/mock_sender.go b/snow/engine/common/mock_sender.go index 3850c198a236..6ebeeb636675 100644 --- a/snow/engine/common/mock_sender.go +++ b/snow/engine/common/mock_sender.go @@ -1,8 +1,10 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/ava-labs/avalanchego/snow/engine/common (interfaces: Sender) +// Source: snow/engine/common/sender.go +// +// Generated by this command: +// +// mockgen -source=snow/engine/common/sender.go -destination=snow/engine/common/mock_sender.go -package=common -exclude_interfaces=StateSummarySender,AcceptedStateSummarySender,FrontierSender,AcceptedSender,FetchSender,AppSender,QuerySender,CrossChainAppSender,NetworkAppSender,Gossiper +// // Package common is a generated GoMock package. package common @@ -41,291 +43,291 @@ func (m *MockSender) EXPECT() *MockSenderMockRecorder { } // Accept mocks base method. -func (m *MockSender) Accept(arg0 *snow.ConsensusContext, arg1 ids.ID, arg2 []byte) error { +func (m *MockSender) Accept(ctx *snow.ConsensusContext, containerID ids.ID, container []byte) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Accept", arg0, arg1, arg2) + ret := m.ctrl.Call(m, "Accept", ctx, containerID, container) ret0, _ := ret[0].(error) return ret0 } // Accept indicates an expected call of Accept. -func (mr *MockSenderMockRecorder) Accept(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockSenderMockRecorder) Accept(ctx, containerID, container any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Accept", reflect.TypeOf((*MockSender)(nil).Accept), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Accept", reflect.TypeOf((*MockSender)(nil).Accept), ctx, containerID, container) } // SendAccepted mocks base method. -func (m *MockSender) SendAccepted(arg0 context.Context, arg1 ids.NodeID, arg2 uint32, arg3 []ids.ID) { +func (m *MockSender) SendAccepted(ctx context.Context, nodeID ids.NodeID, requestID uint32, containerIDs []ids.ID) { m.ctrl.T.Helper() - m.ctrl.Call(m, "SendAccepted", arg0, arg1, arg2, arg3) + m.ctrl.Call(m, "SendAccepted", ctx, nodeID, requestID, containerIDs) } // SendAccepted indicates an expected call of SendAccepted. -func (mr *MockSenderMockRecorder) SendAccepted(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockSenderMockRecorder) SendAccepted(ctx, nodeID, requestID, containerIDs any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendAccepted", reflect.TypeOf((*MockSender)(nil).SendAccepted), arg0, arg1, arg2, arg3) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendAccepted", reflect.TypeOf((*MockSender)(nil).SendAccepted), ctx, nodeID, requestID, containerIDs) } // SendAcceptedFrontier mocks base method. -func (m *MockSender) SendAcceptedFrontier(arg0 context.Context, arg1 ids.NodeID, arg2 uint32, arg3 []ids.ID) { +func (m *MockSender) SendAcceptedFrontier(ctx context.Context, nodeID ids.NodeID, requestID uint32, containerID ids.ID) { m.ctrl.T.Helper() - m.ctrl.Call(m, "SendAcceptedFrontier", arg0, arg1, arg2, arg3) + m.ctrl.Call(m, "SendAcceptedFrontier", ctx, nodeID, requestID, containerID) } // SendAcceptedFrontier indicates an expected call of SendAcceptedFrontier. -func (mr *MockSenderMockRecorder) SendAcceptedFrontier(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockSenderMockRecorder) SendAcceptedFrontier(ctx, nodeID, requestID, containerID any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendAcceptedFrontier", reflect.TypeOf((*MockSender)(nil).SendAcceptedFrontier), arg0, arg1, arg2, arg3) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendAcceptedFrontier", reflect.TypeOf((*MockSender)(nil).SendAcceptedFrontier), ctx, nodeID, requestID, containerID) } // SendAcceptedStateSummary mocks base method. -func (m *MockSender) SendAcceptedStateSummary(arg0 context.Context, arg1 ids.NodeID, arg2 uint32, arg3 []ids.ID) { +func (m *MockSender) SendAcceptedStateSummary(ctx context.Context, nodeID ids.NodeID, requestID uint32, summaryIDs []ids.ID) { m.ctrl.T.Helper() - m.ctrl.Call(m, "SendAcceptedStateSummary", arg0, arg1, arg2, arg3) + m.ctrl.Call(m, "SendAcceptedStateSummary", ctx, nodeID, requestID, summaryIDs) } // SendAcceptedStateSummary indicates an expected call of SendAcceptedStateSummary. -func (mr *MockSenderMockRecorder) SendAcceptedStateSummary(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockSenderMockRecorder) SendAcceptedStateSummary(ctx, nodeID, requestID, summaryIDs any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendAcceptedStateSummary", reflect.TypeOf((*MockSender)(nil).SendAcceptedStateSummary), arg0, arg1, arg2, arg3) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendAcceptedStateSummary", reflect.TypeOf((*MockSender)(nil).SendAcceptedStateSummary), ctx, nodeID, requestID, summaryIDs) } // SendAncestors mocks base method. -func (m *MockSender) SendAncestors(arg0 context.Context, arg1 ids.NodeID, arg2 uint32, arg3 [][]byte) { +func (m *MockSender) SendAncestors(ctx context.Context, nodeID ids.NodeID, requestID uint32, containers [][]byte) { m.ctrl.T.Helper() - m.ctrl.Call(m, "SendAncestors", arg0, arg1, arg2, arg3) + m.ctrl.Call(m, "SendAncestors", ctx, nodeID, requestID, containers) } // SendAncestors indicates an expected call of SendAncestors. -func (mr *MockSenderMockRecorder) SendAncestors(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockSenderMockRecorder) SendAncestors(ctx, nodeID, requestID, containers any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendAncestors", reflect.TypeOf((*MockSender)(nil).SendAncestors), arg0, arg1, arg2, arg3) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendAncestors", reflect.TypeOf((*MockSender)(nil).SendAncestors), ctx, nodeID, requestID, containers) } // SendAppGossip mocks base method. -func (m *MockSender) SendAppGossip(arg0 context.Context, arg1 []byte) error { +func (m *MockSender) SendAppGossip(ctx context.Context, appGossipBytes []byte) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SendAppGossip", arg0, arg1) + ret := m.ctrl.Call(m, "SendAppGossip", ctx, appGossipBytes) ret0, _ := ret[0].(error) return ret0 } // SendAppGossip indicates an expected call of SendAppGossip. -func (mr *MockSenderMockRecorder) SendAppGossip(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockSenderMockRecorder) SendAppGossip(ctx, appGossipBytes any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendAppGossip", reflect.TypeOf((*MockSender)(nil).SendAppGossip), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendAppGossip", reflect.TypeOf((*MockSender)(nil).SendAppGossip), ctx, appGossipBytes) } // SendAppGossipSpecific mocks base method. -func (m *MockSender) SendAppGossipSpecific(arg0 context.Context, arg1 set.Set[ids.NodeID], arg2 []byte) error { +func (m *MockSender) SendAppGossipSpecific(ctx context.Context, nodeIDs set.Set[ids.NodeID], appGossipBytes []byte) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SendAppGossipSpecific", arg0, arg1, arg2) + ret := m.ctrl.Call(m, "SendAppGossipSpecific", ctx, nodeIDs, appGossipBytes) ret0, _ := ret[0].(error) return ret0 } // SendAppGossipSpecific indicates an expected call of SendAppGossipSpecific. -func (mr *MockSenderMockRecorder) SendAppGossipSpecific(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockSenderMockRecorder) SendAppGossipSpecific(ctx, nodeIDs, appGossipBytes any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendAppGossipSpecific", reflect.TypeOf((*MockSender)(nil).SendAppGossipSpecific), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendAppGossipSpecific", reflect.TypeOf((*MockSender)(nil).SendAppGossipSpecific), ctx, nodeIDs, appGossipBytes) } // SendAppRequest mocks base method. -func (m *MockSender) SendAppRequest(arg0 context.Context, arg1 set.Set[ids.NodeID], arg2 uint32, arg3 []byte) error { +func (m *MockSender) SendAppRequest(ctx context.Context, nodeIDs set.Set[ids.NodeID], requestID uint32, appRequestBytes []byte) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SendAppRequest", arg0, arg1, arg2, arg3) + ret := m.ctrl.Call(m, "SendAppRequest", ctx, nodeIDs, requestID, appRequestBytes) ret0, _ := ret[0].(error) return ret0 } // SendAppRequest indicates an expected call of SendAppRequest. -func (mr *MockSenderMockRecorder) SendAppRequest(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockSenderMockRecorder) SendAppRequest(ctx, nodeIDs, requestID, appRequestBytes any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendAppRequest", reflect.TypeOf((*MockSender)(nil).SendAppRequest), arg0, arg1, arg2, arg3) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendAppRequest", reflect.TypeOf((*MockSender)(nil).SendAppRequest), ctx, nodeIDs, requestID, appRequestBytes) } // SendAppResponse mocks base method. -func (m *MockSender) SendAppResponse(arg0 context.Context, arg1 ids.NodeID, arg2 uint32, arg3 []byte) error { +func (m *MockSender) SendAppResponse(ctx context.Context, nodeID ids.NodeID, requestID uint32, appResponseBytes []byte) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SendAppResponse", arg0, arg1, arg2, arg3) + ret := m.ctrl.Call(m, "SendAppResponse", ctx, nodeID, requestID, appResponseBytes) ret0, _ := ret[0].(error) return ret0 } // SendAppResponse indicates an expected call of SendAppResponse. -func (mr *MockSenderMockRecorder) SendAppResponse(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockSenderMockRecorder) SendAppResponse(ctx, nodeID, requestID, appResponseBytes any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendAppResponse", reflect.TypeOf((*MockSender)(nil).SendAppResponse), arg0, arg1, arg2, arg3) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendAppResponse", reflect.TypeOf((*MockSender)(nil).SendAppResponse), ctx, nodeID, requestID, appResponseBytes) } // SendChits mocks base method. -func (m *MockSender) SendChits(arg0 context.Context, arg1 ids.NodeID, arg2 uint32, arg3, arg4 ids.ID) { +func (m *MockSender) SendChits(ctx context.Context, nodeID ids.NodeID, requestID uint32, preferredID, preferredIDAtHeight, acceptedID ids.ID) { m.ctrl.T.Helper() - m.ctrl.Call(m, "SendChits", arg0, arg1, arg2, arg3, arg4) + m.ctrl.Call(m, "SendChits", ctx, nodeID, requestID, preferredID, preferredIDAtHeight, acceptedID) } // SendChits indicates an expected call of SendChits. -func (mr *MockSenderMockRecorder) SendChits(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { +func (mr *MockSenderMockRecorder) SendChits(ctx, nodeID, requestID, preferredID, preferredIDAtHeight, acceptedID any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendChits", reflect.TypeOf((*MockSender)(nil).SendChits), arg0, arg1, arg2, arg3, arg4) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendChits", reflect.TypeOf((*MockSender)(nil).SendChits), ctx, nodeID, requestID, preferredID, preferredIDAtHeight, acceptedID) } // SendCrossChainAppRequest mocks base method. -func (m *MockSender) SendCrossChainAppRequest(arg0 context.Context, arg1 ids.ID, arg2 uint32, arg3 []byte) error { +func (m *MockSender) SendCrossChainAppRequest(ctx context.Context, chainID ids.ID, requestID uint32, appRequestBytes []byte) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SendCrossChainAppRequest", arg0, arg1, arg2, arg3) + ret := m.ctrl.Call(m, "SendCrossChainAppRequest", ctx, chainID, requestID, appRequestBytes) ret0, _ := ret[0].(error) return ret0 } // SendCrossChainAppRequest indicates an expected call of SendCrossChainAppRequest. -func (mr *MockSenderMockRecorder) SendCrossChainAppRequest(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockSenderMockRecorder) SendCrossChainAppRequest(ctx, chainID, requestID, appRequestBytes any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCrossChainAppRequest", reflect.TypeOf((*MockSender)(nil).SendCrossChainAppRequest), arg0, arg1, arg2, arg3) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCrossChainAppRequest", reflect.TypeOf((*MockSender)(nil).SendCrossChainAppRequest), ctx, chainID, requestID, appRequestBytes) } // SendCrossChainAppResponse mocks base method. -func (m *MockSender) SendCrossChainAppResponse(arg0 context.Context, arg1 ids.ID, arg2 uint32, arg3 []byte) error { +func (m *MockSender) SendCrossChainAppResponse(ctx context.Context, chainID ids.ID, requestID uint32, appResponseBytes []byte) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SendCrossChainAppResponse", arg0, arg1, arg2, arg3) + ret := m.ctrl.Call(m, "SendCrossChainAppResponse", ctx, chainID, requestID, appResponseBytes) ret0, _ := ret[0].(error) return ret0 } // SendCrossChainAppResponse indicates an expected call of SendCrossChainAppResponse. -func (mr *MockSenderMockRecorder) SendCrossChainAppResponse(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockSenderMockRecorder) SendCrossChainAppResponse(ctx, chainID, requestID, appResponseBytes any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCrossChainAppResponse", reflect.TypeOf((*MockSender)(nil).SendCrossChainAppResponse), arg0, arg1, arg2, arg3) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCrossChainAppResponse", reflect.TypeOf((*MockSender)(nil).SendCrossChainAppResponse), ctx, chainID, requestID, appResponseBytes) } // SendGet mocks base method. -func (m *MockSender) SendGet(arg0 context.Context, arg1 ids.NodeID, arg2 uint32, arg3 ids.ID) { +func (m *MockSender) SendGet(ctx context.Context, nodeID ids.NodeID, requestID uint32, containerID ids.ID) { m.ctrl.T.Helper() - m.ctrl.Call(m, "SendGet", arg0, arg1, arg2, arg3) + m.ctrl.Call(m, "SendGet", ctx, nodeID, requestID, containerID) } // SendGet indicates an expected call of SendGet. -func (mr *MockSenderMockRecorder) SendGet(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockSenderMockRecorder) SendGet(ctx, nodeID, requestID, containerID any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendGet", reflect.TypeOf((*MockSender)(nil).SendGet), arg0, arg1, arg2, arg3) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendGet", reflect.TypeOf((*MockSender)(nil).SendGet), ctx, nodeID, requestID, containerID) } // SendGetAccepted mocks base method. -func (m *MockSender) SendGetAccepted(arg0 context.Context, arg1 set.Set[ids.NodeID], arg2 uint32, arg3 []ids.ID) { +func (m *MockSender) SendGetAccepted(ctx context.Context, nodeIDs set.Set[ids.NodeID], requestID uint32, containerIDs []ids.ID) { m.ctrl.T.Helper() - m.ctrl.Call(m, "SendGetAccepted", arg0, arg1, arg2, arg3) + m.ctrl.Call(m, "SendGetAccepted", ctx, nodeIDs, requestID, containerIDs) } // SendGetAccepted indicates an expected call of SendGetAccepted. -func (mr *MockSenderMockRecorder) SendGetAccepted(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockSenderMockRecorder) SendGetAccepted(ctx, nodeIDs, requestID, containerIDs any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendGetAccepted", reflect.TypeOf((*MockSender)(nil).SendGetAccepted), arg0, arg1, arg2, arg3) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendGetAccepted", reflect.TypeOf((*MockSender)(nil).SendGetAccepted), ctx, nodeIDs, requestID, containerIDs) } // SendGetAcceptedFrontier mocks base method. -func (m *MockSender) SendGetAcceptedFrontier(arg0 context.Context, arg1 set.Set[ids.NodeID], arg2 uint32) { +func (m *MockSender) SendGetAcceptedFrontier(ctx context.Context, nodeIDs set.Set[ids.NodeID], requestID uint32) { m.ctrl.T.Helper() - m.ctrl.Call(m, "SendGetAcceptedFrontier", arg0, arg1, arg2) + m.ctrl.Call(m, "SendGetAcceptedFrontier", ctx, nodeIDs, requestID) } // SendGetAcceptedFrontier indicates an expected call of SendGetAcceptedFrontier. -func (mr *MockSenderMockRecorder) SendGetAcceptedFrontier(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockSenderMockRecorder) SendGetAcceptedFrontier(ctx, nodeIDs, requestID any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendGetAcceptedFrontier", reflect.TypeOf((*MockSender)(nil).SendGetAcceptedFrontier), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendGetAcceptedFrontier", reflect.TypeOf((*MockSender)(nil).SendGetAcceptedFrontier), ctx, nodeIDs, requestID) } // SendGetAcceptedStateSummary mocks base method. -func (m *MockSender) SendGetAcceptedStateSummary(arg0 context.Context, arg1 set.Set[ids.NodeID], arg2 uint32, arg3 []uint64) { +func (m *MockSender) SendGetAcceptedStateSummary(ctx context.Context, nodeIDs set.Set[ids.NodeID], requestID uint32, heights []uint64) { m.ctrl.T.Helper() - m.ctrl.Call(m, "SendGetAcceptedStateSummary", arg0, arg1, arg2, arg3) + m.ctrl.Call(m, "SendGetAcceptedStateSummary", ctx, nodeIDs, requestID, heights) } // SendGetAcceptedStateSummary indicates an expected call of SendGetAcceptedStateSummary. -func (mr *MockSenderMockRecorder) SendGetAcceptedStateSummary(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockSenderMockRecorder) SendGetAcceptedStateSummary(ctx, nodeIDs, requestID, heights any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendGetAcceptedStateSummary", reflect.TypeOf((*MockSender)(nil).SendGetAcceptedStateSummary), arg0, arg1, arg2, arg3) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendGetAcceptedStateSummary", reflect.TypeOf((*MockSender)(nil).SendGetAcceptedStateSummary), ctx, nodeIDs, requestID, heights) } // SendGetAncestors mocks base method. -func (m *MockSender) SendGetAncestors(arg0 context.Context, arg1 ids.NodeID, arg2 uint32, arg3 ids.ID) { +func (m *MockSender) SendGetAncestors(ctx context.Context, nodeID ids.NodeID, requestID uint32, containerID ids.ID) { m.ctrl.T.Helper() - m.ctrl.Call(m, "SendGetAncestors", arg0, arg1, arg2, arg3) + m.ctrl.Call(m, "SendGetAncestors", ctx, nodeID, requestID, containerID) } // SendGetAncestors indicates an expected call of SendGetAncestors. -func (mr *MockSenderMockRecorder) SendGetAncestors(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockSenderMockRecorder) SendGetAncestors(ctx, nodeID, requestID, containerID any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendGetAncestors", reflect.TypeOf((*MockSender)(nil).SendGetAncestors), arg0, arg1, arg2, arg3) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendGetAncestors", reflect.TypeOf((*MockSender)(nil).SendGetAncestors), ctx, nodeID, requestID, containerID) } // SendGetStateSummaryFrontier mocks base method. -func (m *MockSender) SendGetStateSummaryFrontier(arg0 context.Context, arg1 set.Set[ids.NodeID], arg2 uint32) { +func (m *MockSender) SendGetStateSummaryFrontier(ctx context.Context, nodeIDs set.Set[ids.NodeID], requestID uint32) { m.ctrl.T.Helper() - m.ctrl.Call(m, "SendGetStateSummaryFrontier", arg0, arg1, arg2) + m.ctrl.Call(m, "SendGetStateSummaryFrontier", ctx, nodeIDs, requestID) } // SendGetStateSummaryFrontier indicates an expected call of SendGetStateSummaryFrontier. -func (mr *MockSenderMockRecorder) SendGetStateSummaryFrontier(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockSenderMockRecorder) SendGetStateSummaryFrontier(ctx, nodeIDs, requestID any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendGetStateSummaryFrontier", reflect.TypeOf((*MockSender)(nil).SendGetStateSummaryFrontier), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendGetStateSummaryFrontier", reflect.TypeOf((*MockSender)(nil).SendGetStateSummaryFrontier), ctx, nodeIDs, requestID) } // SendGossip mocks base method. -func (m *MockSender) SendGossip(arg0 context.Context, arg1 []byte) { +func (m *MockSender) SendGossip(ctx context.Context, container []byte) { m.ctrl.T.Helper() - m.ctrl.Call(m, "SendGossip", arg0, arg1) + m.ctrl.Call(m, "SendGossip", ctx, container) } // SendGossip indicates an expected call of SendGossip. -func (mr *MockSenderMockRecorder) SendGossip(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockSenderMockRecorder) SendGossip(ctx, container any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendGossip", reflect.TypeOf((*MockSender)(nil).SendGossip), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendGossip", reflect.TypeOf((*MockSender)(nil).SendGossip), ctx, container) } // SendPullQuery mocks base method. -func (m *MockSender) SendPullQuery(arg0 context.Context, arg1 set.Set[ids.NodeID], arg2 uint32, arg3 ids.ID) { +func (m *MockSender) SendPullQuery(ctx context.Context, nodeIDs set.Set[ids.NodeID], requestID uint32, containerID ids.ID, requestedHeight uint64) { m.ctrl.T.Helper() - m.ctrl.Call(m, "SendPullQuery", arg0, arg1, arg2, arg3) + m.ctrl.Call(m, "SendPullQuery", ctx, nodeIDs, requestID, containerID, requestedHeight) } // SendPullQuery indicates an expected call of SendPullQuery. -func (mr *MockSenderMockRecorder) SendPullQuery(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockSenderMockRecorder) SendPullQuery(ctx, nodeIDs, requestID, containerID, requestedHeight any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendPullQuery", reflect.TypeOf((*MockSender)(nil).SendPullQuery), arg0, arg1, arg2, arg3) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendPullQuery", reflect.TypeOf((*MockSender)(nil).SendPullQuery), ctx, nodeIDs, requestID, containerID, requestedHeight) } // SendPushQuery mocks base method. -func (m *MockSender) SendPushQuery(arg0 context.Context, arg1 set.Set[ids.NodeID], arg2 uint32, arg3 []byte) { +func (m *MockSender) SendPushQuery(ctx context.Context, nodeIDs set.Set[ids.NodeID], requestID uint32, container []byte, requestedHeight uint64) { m.ctrl.T.Helper() - m.ctrl.Call(m, "SendPushQuery", arg0, arg1, arg2, arg3) + m.ctrl.Call(m, "SendPushQuery", ctx, nodeIDs, requestID, container, requestedHeight) } // SendPushQuery indicates an expected call of SendPushQuery. -func (mr *MockSenderMockRecorder) SendPushQuery(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockSenderMockRecorder) SendPushQuery(ctx, nodeIDs, requestID, container, requestedHeight any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendPushQuery", reflect.TypeOf((*MockSender)(nil).SendPushQuery), arg0, arg1, arg2, arg3) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendPushQuery", reflect.TypeOf((*MockSender)(nil).SendPushQuery), ctx, nodeIDs, requestID, container, requestedHeight) } // SendPut mocks base method. -func (m *MockSender) SendPut(arg0 context.Context, arg1 ids.NodeID, arg2 uint32, arg3 []byte) { +func (m *MockSender) SendPut(ctx context.Context, nodeID ids.NodeID, requestID uint32, container []byte) { m.ctrl.T.Helper() - m.ctrl.Call(m, "SendPut", arg0, arg1, arg2, arg3) + m.ctrl.Call(m, "SendPut", ctx, nodeID, requestID, container) } // SendPut indicates an expected call of SendPut. -func (mr *MockSenderMockRecorder) SendPut(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockSenderMockRecorder) SendPut(ctx, nodeID, requestID, container any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendPut", reflect.TypeOf((*MockSender)(nil).SendPut), arg0, arg1, arg2, arg3) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendPut", reflect.TypeOf((*MockSender)(nil).SendPut), ctx, nodeID, requestID, container) } // SendStateSummaryFrontier mocks base method. -func (m *MockSender) SendStateSummaryFrontier(arg0 context.Context, arg1 ids.NodeID, arg2 uint32, arg3 []byte) { +func (m *MockSender) SendStateSummaryFrontier(ctx context.Context, nodeID ids.NodeID, requestID uint32, summary []byte) { m.ctrl.T.Helper() - m.ctrl.Call(m, "SendStateSummaryFrontier", arg0, arg1, arg2, arg3) + m.ctrl.Call(m, "SendStateSummaryFrontier", ctx, nodeID, requestID, summary) } // SendStateSummaryFrontier indicates an expected call of SendStateSummaryFrontier. -func (mr *MockSenderMockRecorder) SendStateSummaryFrontier(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockSenderMockRecorder) SendStateSummaryFrontier(ctx, nodeID, requestID, summary any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendStateSummaryFrontier", reflect.TypeOf((*MockSender)(nil).SendStateSummaryFrontier), arg0, arg1, arg2, arg3) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendStateSummaryFrontier", reflect.TypeOf((*MockSender)(nil).SendStateSummaryFrontier), ctx, nodeID, requestID, summary) } diff --git a/snow/networking/router/mock_router.go b/snow/networking/router/mock_router.go index e644edd2d6b2..c9146a777138 100644 --- a/snow/networking/router/mock_router.go +++ b/snow/networking/router/mock_router.go @@ -1,8 +1,10 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/ava-labs/avalanchego/snow/networking/router (interfaces: Router) +// Source: snow/networking/router/router.go +// +// Generated by this command: +// +// mockgen -source=snow/networking/router/router.go -destination=snow/networking/router/mock_router.go -package=router -exclude_interfaces=InternalHandler +// // Package router is a generated GoMock package. package router @@ -20,8 +22,8 @@ import ( logging "github.com/ava-labs/avalanchego/utils/logging" set "github.com/ava-labs/avalanchego/utils/set" version "github.com/ava-labs/avalanchego/version" - gomock "go.uber.org/mock/gomock" prometheus "github.com/prometheus/client_golang/prometheus" + gomock "go.uber.org/mock/gomock" ) // MockRouter is a mock of Router interface. @@ -48,51 +50,51 @@ func (m *MockRouter) EXPECT() *MockRouterMockRecorder { } // AddChain mocks base method. -func (m *MockRouter) AddChain(arg0 context.Context, arg1 handler.Handler) { +func (m *MockRouter) AddChain(ctx context.Context, chain handler.Handler) { m.ctrl.T.Helper() - m.ctrl.Call(m, "AddChain", arg0, arg1) + m.ctrl.Call(m, "AddChain", ctx, chain) } // AddChain indicates an expected call of AddChain. -func (mr *MockRouterMockRecorder) AddChain(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockRouterMockRecorder) AddChain(ctx, chain any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddChain", reflect.TypeOf((*MockRouter)(nil).AddChain), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddChain", reflect.TypeOf((*MockRouter)(nil).AddChain), ctx, chain) } // Benched mocks base method. -func (m *MockRouter) Benched(arg0 ids.ID, arg1 ids.NodeID) { +func (m *MockRouter) Benched(chainID ids.ID, validatorID ids.NodeID) { m.ctrl.T.Helper() - m.ctrl.Call(m, "Benched", arg0, arg1) + m.ctrl.Call(m, "Benched", chainID, validatorID) } // Benched indicates an expected call of Benched. -func (mr *MockRouterMockRecorder) Benched(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockRouterMockRecorder) Benched(chainID, validatorID any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Benched", reflect.TypeOf((*MockRouter)(nil).Benched), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Benched", reflect.TypeOf((*MockRouter)(nil).Benched), chainID, validatorID) } // Connected mocks base method. -func (m *MockRouter) Connected(arg0 ids.NodeID, arg1 *version.Application, arg2 ids.ID) { +func (m *MockRouter) Connected(nodeID ids.NodeID, nodeVersion *version.Application, subnetID ids.ID) { m.ctrl.T.Helper() - m.ctrl.Call(m, "Connected", arg0, arg1, arg2) + m.ctrl.Call(m, "Connected", nodeID, nodeVersion, subnetID) } // Connected indicates an expected call of Connected. -func (mr *MockRouterMockRecorder) Connected(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockRouterMockRecorder) Connected(nodeID, nodeVersion, subnetID any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Connected", reflect.TypeOf((*MockRouter)(nil).Connected), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Connected", reflect.TypeOf((*MockRouter)(nil).Connected), nodeID, nodeVersion, subnetID) } // Disconnected mocks base method. -func (m *MockRouter) Disconnected(arg0 ids.NodeID) { +func (m *MockRouter) Disconnected(nodeID ids.NodeID) { m.ctrl.T.Helper() - m.ctrl.Call(m, "Disconnected", arg0) + m.ctrl.Call(m, "Disconnected", nodeID) } // Disconnected indicates an expected call of Disconnected. -func (mr *MockRouterMockRecorder) Disconnected(arg0 interface{}) *gomock.Call { +func (mr *MockRouterMockRecorder) Disconnected(nodeID any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Disconnected", reflect.TypeOf((*MockRouter)(nil).Disconnected), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Disconnected", reflect.TypeOf((*MockRouter)(nil).Disconnected), nodeID) } // HandleInbound mocks base method. @@ -102,50 +104,50 @@ func (m *MockRouter) HandleInbound(arg0 context.Context, arg1 message.InboundMes } // HandleInbound indicates an expected call of HandleInbound. -func (mr *MockRouterMockRecorder) HandleInbound(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockRouterMockRecorder) HandleInbound(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleInbound", reflect.TypeOf((*MockRouter)(nil).HandleInbound), arg0, arg1) } // HealthCheck mocks base method. -func (m *MockRouter) HealthCheck(arg0 context.Context) (interface{}, error) { +func (m *MockRouter) HealthCheck(arg0 context.Context) (any, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "HealthCheck", arg0) - ret0, _ := ret[0].(interface{}) + ret0, _ := ret[0].(any) ret1, _ := ret[1].(error) return ret0, ret1 } // HealthCheck indicates an expected call of HealthCheck. -func (mr *MockRouterMockRecorder) HealthCheck(arg0 interface{}) *gomock.Call { +func (mr *MockRouterMockRecorder) HealthCheck(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HealthCheck", reflect.TypeOf((*MockRouter)(nil).HealthCheck), arg0) } // Initialize mocks base method. -func (m *MockRouter) Initialize(arg0 ids.NodeID, arg1 logging.Logger, arg2 timeout.Manager, arg3 time.Duration, arg4 set.Set[ids.ID], arg5 bool, arg6 set.Set[ids.ID], arg7 func(int), arg8 HealthConfig, arg9 string, arg10 prometheus.Registerer) error { +func (m *MockRouter) Initialize(nodeID ids.NodeID, log logging.Logger, timeouts timeout.Manager, shutdownTimeout time.Duration, criticalChains set.Set[ids.ID], sybilProtectionEnabled bool, trackedSubnets set.Set[ids.ID], onFatal func(int), healthConfig HealthConfig, metricsNamespace string, metricsRegisterer prometheus.Registerer) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Initialize", arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10) + ret := m.ctrl.Call(m, "Initialize", nodeID, log, timeouts, shutdownTimeout, criticalChains, sybilProtectionEnabled, trackedSubnets, onFatal, healthConfig, metricsNamespace, metricsRegisterer) ret0, _ := ret[0].(error) return ret0 } // Initialize indicates an expected call of Initialize. -func (mr *MockRouterMockRecorder) Initialize(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10 interface{}) *gomock.Call { +func (mr *MockRouterMockRecorder) Initialize(nodeID, log, timeouts, shutdownTimeout, criticalChains, sybilProtectionEnabled, trackedSubnets, onFatal, healthConfig, metricsNamespace, metricsRegisterer any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Initialize", reflect.TypeOf((*MockRouter)(nil).Initialize), arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Initialize", reflect.TypeOf((*MockRouter)(nil).Initialize), nodeID, log, timeouts, shutdownTimeout, criticalChains, sybilProtectionEnabled, trackedSubnets, onFatal, healthConfig, metricsNamespace, metricsRegisterer) } // RegisterRequest mocks base method. -func (m *MockRouter) RegisterRequest(arg0 context.Context, arg1 ids.NodeID, arg2, arg3 ids.ID, arg4 uint32, arg5 message.Op, arg6 message.InboundMessage, arg7 p2p.EngineType) { +func (m *MockRouter) RegisterRequest(ctx context.Context, nodeID ids.NodeID, sourceChainID, destinationChainID ids.ID, requestID uint32, op message.Op, failedMsg message.InboundMessage, engineType p2p.EngineType) { m.ctrl.T.Helper() - m.ctrl.Call(m, "RegisterRequest", arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) + m.ctrl.Call(m, "RegisterRequest", ctx, nodeID, sourceChainID, destinationChainID, requestID, op, failedMsg, engineType) } // RegisterRequest indicates an expected call of RegisterRequest. -func (mr *MockRouterMockRecorder) RegisterRequest(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7 interface{}) *gomock.Call { +func (mr *MockRouterMockRecorder) RegisterRequest(ctx, nodeID, sourceChainID, destinationChainID, requestID, op, failedMsg, engineType any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterRequest", reflect.TypeOf((*MockRouter)(nil).RegisterRequest), arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterRequest", reflect.TypeOf((*MockRouter)(nil).RegisterRequest), ctx, nodeID, sourceChainID, destinationChainID, requestID, op, failedMsg, engineType) } // Shutdown mocks base method. @@ -155,19 +157,19 @@ func (m *MockRouter) Shutdown(arg0 context.Context) { } // Shutdown indicates an expected call of Shutdown. -func (mr *MockRouterMockRecorder) Shutdown(arg0 interface{}) *gomock.Call { +func (mr *MockRouterMockRecorder) Shutdown(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Shutdown", reflect.TypeOf((*MockRouter)(nil).Shutdown), arg0) } // Unbenched mocks base method. -func (m *MockRouter) Unbenched(arg0 ids.ID, arg1 ids.NodeID) { +func (m *MockRouter) Unbenched(chainID ids.ID, validatorID ids.NodeID) { m.ctrl.T.Helper() - m.ctrl.Call(m, "Unbenched", arg0, arg1) + m.ctrl.Call(m, "Unbenched", chainID, validatorID) } // Unbenched indicates an expected call of Unbenched. -func (mr *MockRouterMockRecorder) Unbenched(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockRouterMockRecorder) Unbenched(chainID, validatorID any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Unbenched", reflect.TypeOf((*MockRouter)(nil).Unbenched), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Unbenched", reflect.TypeOf((*MockRouter)(nil).Unbenched), chainID, validatorID) } diff --git a/snow/networking/sender/mock_external_sender.go b/snow/networking/sender/mock_external_sender.go index d3d4717b2959..9dc0a50d1af9 100644 --- a/snow/networking/sender/mock_external_sender.go +++ b/snow/networking/sender/mock_external_sender.go @@ -1,8 +1,10 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/ava-labs/avalanchego/snow/networking/sender (interfaces: ExternalSender) +// Source: snow/networking/sender/external_sender.go +// +// Generated by this command: +// +// mockgen -source=snow/networking/sender/external_sender.go -destination=snow/networking/sender/mock_external_sender.go -package=sender -exclude_interfaces= +// // Package sender is a generated GoMock package. package sender @@ -41,29 +43,29 @@ func (m *MockExternalSender) EXPECT() *MockExternalSenderMockRecorder { } // Gossip mocks base method. -func (m *MockExternalSender) Gossip(arg0 message.OutboundMessage, arg1 ids.ID, arg2, arg3, arg4 int, arg5 subnets.Allower) set.Set[ids.NodeID] { +func (m *MockExternalSender) Gossip(msg message.OutboundMessage, subnetID ids.ID, numValidatorsToSend, numNonValidatorsToSend, numPeersToSend int, allower subnets.Allower) set.Set[ids.NodeID] { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Gossip", arg0, arg1, arg2, arg3, arg4, arg5) + ret := m.ctrl.Call(m, "Gossip", msg, subnetID, numValidatorsToSend, numNonValidatorsToSend, numPeersToSend, allower) ret0, _ := ret[0].(set.Set[ids.NodeID]) return ret0 } // Gossip indicates an expected call of Gossip. -func (mr *MockExternalSenderMockRecorder) Gossip(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call { +func (mr *MockExternalSenderMockRecorder) Gossip(msg, subnetID, numValidatorsToSend, numNonValidatorsToSend, numPeersToSend, allower any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Gossip", reflect.TypeOf((*MockExternalSender)(nil).Gossip), arg0, arg1, arg2, arg3, arg4, arg5) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Gossip", reflect.TypeOf((*MockExternalSender)(nil).Gossip), msg, subnetID, numValidatorsToSend, numNonValidatorsToSend, numPeersToSend, allower) } // Send mocks base method. -func (m *MockExternalSender) Send(arg0 message.OutboundMessage, arg1 set.Set[ids.NodeID], arg2 ids.ID, arg3 subnets.Allower) set.Set[ids.NodeID] { +func (m *MockExternalSender) Send(msg message.OutboundMessage, nodeIDs set.Set[ids.NodeID], subnetID ids.ID, allower subnets.Allower) set.Set[ids.NodeID] { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Send", arg0, arg1, arg2, arg3) + ret := m.ctrl.Call(m, "Send", msg, nodeIDs, subnetID, allower) ret0, _ := ret[0].(set.Set[ids.NodeID]) return ret0 } // Send indicates an expected call of Send. -func (mr *MockExternalSenderMockRecorder) Send(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockExternalSenderMockRecorder) Send(msg, nodeIDs, subnetID, allower any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockExternalSender)(nil).Send), arg0, arg1, arg2, arg3) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockExternalSender)(nil).Send), msg, nodeIDs, subnetID, allower) } diff --git a/snow/validators/mock_manager.go b/snow/validators/mock_manager.go index 2b99245710fb..b622ba11223a 100644 --- a/snow/validators/mock_manager.go +++ b/snow/validators/mock_manager.go @@ -1,9 +1,10 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - -// Do not include this in mocks.mockgen.txt as bls package won't be available. // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/ava-labs/avalanchego/snow/validators (interfaces: Manager) +// Source: snow/validators/manager.go +// +// Generated by this command: +// +// mockgen -source=snow/validators/manager.go -destination=snow/validators/mock_manager.go -package=validators -exclude_interfaces=SetCallbackListener +// // Package validators is a generated GoMock package. package validators @@ -41,158 +42,143 @@ func (m *MockManager) EXPECT() *MockManagerMockRecorder { } // AddStaker mocks base method. -func (m *MockManager) AddStaker(arg0 ids.ID, arg1 ids.NodeID, arg2 *bls.PublicKey, arg3 ids.ID, arg4 uint64) error { +func (m *MockManager) AddStaker(subnetID ids.ID, nodeID ids.NodeID, pk *bls.PublicKey, txID ids.ID, weight uint64) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "AddStaker", arg0, arg1, arg2, arg3, arg4) + ret := m.ctrl.Call(m, "AddStaker", subnetID, nodeID, pk, txID, weight) ret0, _ := ret[0].(error) return ret0 } // AddStaker indicates an expected call of AddStaker. -func (mr *MockManagerMockRecorder) AddStaker(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) AddStaker(subnetID, nodeID, pk, txID, weight any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddStaker", reflect.TypeOf((*MockManager)(nil).AddStaker), arg0, arg1, arg2, arg3, arg4) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddStaker", reflect.TypeOf((*MockManager)(nil).AddStaker), subnetID, nodeID, pk, txID, weight) } // AddWeight mocks base method. -func (m *MockManager) AddWeight(arg0 ids.ID, arg1 ids.NodeID, arg2 uint64) error { +func (m *MockManager) AddWeight(subnetID ids.ID, nodeID ids.NodeID, weight uint64) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "AddWeight", arg0, arg1, arg2) + ret := m.ctrl.Call(m, "AddWeight", subnetID, nodeID, weight) ret0, _ := ret[0].(error) return ret0 } // AddWeight indicates an expected call of AddWeight. -func (mr *MockManagerMockRecorder) AddWeight(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) AddWeight(subnetID, nodeID, weight any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddWeight", reflect.TypeOf((*MockManager)(nil).AddWeight), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddWeight", reflect.TypeOf((*MockManager)(nil).AddWeight), subnetID, nodeID, weight) } -// Contains mocks base method. -func (m *MockManager) Contains(arg0 ids.ID, arg1 ids.NodeID) bool { +// Count mocks base method. +func (m *MockManager) Count(subnetID ids.ID) int { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Contains", arg0, arg1) - ret0, _ := ret[0].(bool) + ret := m.ctrl.Call(m, "Count", subnetID) + ret0, _ := ret[0].(int) return ret0 } -// Contains indicates an expected call of Contains. -func (mr *MockManagerMockRecorder) Contains(arg0, arg1 interface{}) *gomock.Call { +// Count indicates an expected call of Count. +func (mr *MockManagerMockRecorder) Count(subnetID any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Contains", reflect.TypeOf((*MockManager)(nil).Contains), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Count", reflect.TypeOf((*MockManager)(nil).Count), subnetID) } // GetMap mocks base method. -func (m *MockManager) GetMap(arg0 ids.ID) map[ids.NodeID]*GetValidatorOutput { +func (m *MockManager) GetMap(subnetID ids.ID) map[ids.NodeID]*GetValidatorOutput { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetMap", arg0) + ret := m.ctrl.Call(m, "GetMap", subnetID) ret0, _ := ret[0].(map[ids.NodeID]*GetValidatorOutput) return ret0 } // GetMap indicates an expected call of GetMap. -func (mr *MockManagerMockRecorder) GetMap(arg0 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) GetMap(subnetID any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMap", reflect.TypeOf((*MockManager)(nil).GetMap), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMap", reflect.TypeOf((*MockManager)(nil).GetMap), subnetID) } // GetValidator mocks base method. -func (m *MockManager) GetValidator(arg0 ids.ID, arg1 ids.NodeID) (*Validator, bool) { +func (m *MockManager) GetValidator(subnetID ids.ID, nodeID ids.NodeID) (*Validator, bool) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetValidator", arg0, arg1) + ret := m.ctrl.Call(m, "GetValidator", subnetID, nodeID) ret0, _ := ret[0].(*Validator) ret1, _ := ret[1].(bool) return ret0, ret1 } // GetValidator indicates an expected call of GetValidator. -func (mr *MockManagerMockRecorder) GetValidator(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) GetValidator(subnetID, nodeID any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidator", reflect.TypeOf((*MockManager)(nil).GetValidator), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidator", reflect.TypeOf((*MockManager)(nil).GetValidator), subnetID, nodeID) } // GetValidatorIDs mocks base method. -func (m *MockManager) GetValidatorIDs(arg0 ids.ID) ([]ids.NodeID, error) { +func (m *MockManager) GetValidatorIDs(subnetID ids.ID) []ids.NodeID { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetValidatorIDs", arg0) + ret := m.ctrl.Call(m, "GetValidatorIDs", subnetID) ret0, _ := ret[0].([]ids.NodeID) - ret1, _ := ret[1].(error) - return ret0, ret1 + return ret0 } // GetValidatorIDs indicates an expected call of GetValidatorIDs. -func (mr *MockManagerMockRecorder) GetValidatorIDs(arg0 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) GetValidatorIDs(subnetID any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidatorIDs", reflect.TypeOf((*MockManager)(nil).GetValidatorIDs), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidatorIDs", reflect.TypeOf((*MockManager)(nil).GetValidatorIDs), subnetID) } // GetWeight mocks base method. -func (m *MockManager) GetWeight(arg0 ids.ID, arg1 ids.NodeID) uint64 { +func (m *MockManager) GetWeight(subnetID ids.ID, nodeID ids.NodeID) uint64 { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetWeight", arg0, arg1) + ret := m.ctrl.Call(m, "GetWeight", subnetID, nodeID) ret0, _ := ret[0].(uint64) return ret0 } // GetWeight indicates an expected call of GetWeight. -func (mr *MockManagerMockRecorder) GetWeight(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetWeight", reflect.TypeOf((*MockManager)(nil).GetWeight), arg0, arg1) -} - -// Len mocks base method. -func (m *MockManager) Len(arg0 ids.ID) int { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Len", arg0) - ret0, _ := ret[0].(int) - return ret0 -} - -// Len indicates an expected call of Len. -func (mr *MockManagerMockRecorder) Len(arg0 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) GetWeight(subnetID, nodeID any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Len", reflect.TypeOf((*MockManager)(nil).Len), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetWeight", reflect.TypeOf((*MockManager)(nil).GetWeight), subnetID, nodeID) } // RegisterCallbackListener mocks base method. -func (m *MockManager) RegisterCallbackListener(arg0 ids.ID, arg1 SetCallbackListener) { +func (m *MockManager) RegisterCallbackListener(subnetID ids.ID, listener SetCallbackListener) { m.ctrl.T.Helper() - m.ctrl.Call(m, "RegisterCallbackListener", arg0, arg1) + m.ctrl.Call(m, "RegisterCallbackListener", subnetID, listener) } // RegisterCallbackListener indicates an expected call of RegisterCallbackListener. -func (mr *MockManagerMockRecorder) RegisterCallbackListener(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) RegisterCallbackListener(subnetID, listener any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterCallbackListener", reflect.TypeOf((*MockManager)(nil).RegisterCallbackListener), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterCallbackListener", reflect.TypeOf((*MockManager)(nil).RegisterCallbackListener), subnetID, listener) } // RemoveWeight mocks base method. -func (m *MockManager) RemoveWeight(arg0 ids.ID, arg1 ids.NodeID, arg2 uint64) error { +func (m *MockManager) RemoveWeight(subnetID ids.ID, nodeID ids.NodeID, weight uint64) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "RemoveWeight", arg0, arg1, arg2) + ret := m.ctrl.Call(m, "RemoveWeight", subnetID, nodeID, weight) ret0, _ := ret[0].(error) return ret0 } // RemoveWeight indicates an expected call of RemoveWeight. -func (mr *MockManagerMockRecorder) RemoveWeight(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) RemoveWeight(subnetID, nodeID, weight any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveWeight", reflect.TypeOf((*MockManager)(nil).RemoveWeight), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveWeight", reflect.TypeOf((*MockManager)(nil).RemoveWeight), subnetID, nodeID, weight) } // Sample mocks base method. -func (m *MockManager) Sample(arg0 ids.ID, arg1 int) ([]ids.NodeID, error) { +func (m *MockManager) Sample(subnetID ids.ID, size int) ([]ids.NodeID, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Sample", arg0, arg1) + ret := m.ctrl.Call(m, "Sample", subnetID, size) ret0, _ := ret[0].([]ids.NodeID) ret1, _ := ret[1].(error) return ret0, ret1 } // Sample indicates an expected call of Sample. -func (mr *MockManagerMockRecorder) Sample(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) Sample(subnetID, size any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Sample", reflect.TypeOf((*MockManager)(nil).Sample), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Sample", reflect.TypeOf((*MockManager)(nil).Sample), subnetID, size) } // String mocks base method. @@ -210,31 +196,31 @@ func (mr *MockManagerMockRecorder) String() *gomock.Call { } // SubsetWeight mocks base method. -func (m *MockManager) SubsetWeight(arg0 ids.ID, arg1 set.Set[ids.NodeID]) (uint64, error) { +func (m *MockManager) SubsetWeight(subnetID ids.ID, validatorIDs set.Set[ids.NodeID]) (uint64, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SubsetWeight", arg0, arg1) + ret := m.ctrl.Call(m, "SubsetWeight", subnetID, validatorIDs) ret0, _ := ret[0].(uint64) ret1, _ := ret[1].(error) return ret0, ret1 } // SubsetWeight indicates an expected call of SubsetWeight. -func (mr *MockManagerMockRecorder) SubsetWeight(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) SubsetWeight(subnetID, validatorIDs any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubsetWeight", reflect.TypeOf((*MockManager)(nil).SubsetWeight), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubsetWeight", reflect.TypeOf((*MockManager)(nil).SubsetWeight), subnetID, validatorIDs) } // TotalWeight mocks base method. -func (m *MockManager) TotalWeight(arg0 ids.ID) (uint64, error) { +func (m *MockManager) TotalWeight(subnetID ids.ID) (uint64, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "TotalWeight", arg0) + ret := m.ctrl.Call(m, "TotalWeight", subnetID) ret0, _ := ret[0].(uint64) ret1, _ := ret[1].(error) return ret0, ret1 } // TotalWeight indicates an expected call of TotalWeight. -func (mr *MockManagerMockRecorder) TotalWeight(arg0 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) TotalWeight(subnetID any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TotalWeight", reflect.TypeOf((*MockManager)(nil).TotalWeight), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TotalWeight", reflect.TypeOf((*MockManager)(nil).TotalWeight), subnetID) } diff --git a/vms/avm/block/executor/mock_manager.go b/vms/avm/block/executor/mock_manager.go index 5e27089b19fa..a882ec519fba 100644 --- a/vms/avm/block/executor/mock_manager.go +++ b/vms/avm/block/executor/mock_manager.go @@ -1,8 +1,10 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/ava-labs/avalanchego/vms/avm/block/executor (interfaces: Manager) +// Source: vms/avm/block/executor/manager.go +// +// Generated by this command: +// +// mockgen -source=vms/avm/block/executor/manager.go -destination=vms/avm/block/executor/mock_manager.go -package=executor -exclude_interfaces= +// // Package executor is a generated GoMock package. package executor @@ -43,48 +45,48 @@ func (m *MockManager) EXPECT() *MockManagerMockRecorder { } // GetBlock mocks base method. -func (m *MockManager) GetBlock(arg0 ids.ID) (snowman.Block, error) { +func (m *MockManager) GetBlock(blkID ids.ID) (snowman.Block, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetBlock", arg0) + ret := m.ctrl.Call(m, "GetBlock", blkID) ret0, _ := ret[0].(snowman.Block) ret1, _ := ret[1].(error) return ret0, ret1 } // GetBlock indicates an expected call of GetBlock. -func (mr *MockManagerMockRecorder) GetBlock(arg0 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) GetBlock(blkID any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlock", reflect.TypeOf((*MockManager)(nil).GetBlock), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlock", reflect.TypeOf((*MockManager)(nil).GetBlock), blkID) } // GetState mocks base method. -func (m *MockManager) GetState(arg0 ids.ID) (state.Chain, bool) { +func (m *MockManager) GetState(blkID ids.ID) (state.Chain, bool) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetState", arg0) + ret := m.ctrl.Call(m, "GetState", blkID) ret0, _ := ret[0].(state.Chain) ret1, _ := ret[1].(bool) return ret0, ret1 } // GetState indicates an expected call of GetState. -func (mr *MockManagerMockRecorder) GetState(arg0 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) GetState(blkID any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetState", reflect.TypeOf((*MockManager)(nil).GetState), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetState", reflect.TypeOf((*MockManager)(nil).GetState), blkID) } // GetStatelessBlock mocks base method. -func (m *MockManager) GetStatelessBlock(arg0 ids.ID) (block.Block, error) { +func (m *MockManager) GetStatelessBlock(blkID ids.ID) (block.Block, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetStatelessBlock", arg0) + ret := m.ctrl.Call(m, "GetStatelessBlock", blkID) ret0, _ := ret[0].(block.Block) ret1, _ := ret[1].(error) return ret0, ret1 } // GetStatelessBlock indicates an expected call of GetStatelessBlock. -func (mr *MockManagerMockRecorder) GetStatelessBlock(arg0 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) GetStatelessBlock(blkID any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStatelessBlock", reflect.TypeOf((*MockManager)(nil).GetStatelessBlock), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStatelessBlock", reflect.TypeOf((*MockManager)(nil).GetStatelessBlock), blkID) } // LastAccepted mocks base method. @@ -110,7 +112,7 @@ func (m *MockManager) NewBlock(arg0 block.Block) snowman.Block { } // NewBlock indicates an expected call of NewBlock. -func (mr *MockManagerMockRecorder) NewBlock(arg0 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) NewBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewBlock", reflect.TypeOf((*MockManager)(nil).NewBlock), arg0) } @@ -130,41 +132,41 @@ func (mr *MockManagerMockRecorder) Preferred() *gomock.Call { } // SetPreference mocks base method. -func (m *MockManager) SetPreference(arg0 ids.ID) { +func (m *MockManager) SetPreference(blkID ids.ID) { m.ctrl.T.Helper() - m.ctrl.Call(m, "SetPreference", arg0) + m.ctrl.Call(m, "SetPreference", blkID) } // SetPreference indicates an expected call of SetPreference. -func (mr *MockManagerMockRecorder) SetPreference(arg0 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) SetPreference(blkID any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetPreference", reflect.TypeOf((*MockManager)(nil).SetPreference), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetPreference", reflect.TypeOf((*MockManager)(nil).SetPreference), blkID) } // VerifyTx mocks base method. -func (m *MockManager) VerifyTx(arg0 *txs.Tx) error { +func (m *MockManager) VerifyTx(tx *txs.Tx) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "VerifyTx", arg0) + ret := m.ctrl.Call(m, "VerifyTx", tx) ret0, _ := ret[0].(error) return ret0 } // VerifyTx indicates an expected call of VerifyTx. -func (mr *MockManagerMockRecorder) VerifyTx(arg0 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) VerifyTx(tx any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VerifyTx", reflect.TypeOf((*MockManager)(nil).VerifyTx), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VerifyTx", reflect.TypeOf((*MockManager)(nil).VerifyTx), tx) } // VerifyUniqueInputs mocks base method. -func (m *MockManager) VerifyUniqueInputs(arg0 ids.ID, arg1 set.Set[ids.ID]) error { +func (m *MockManager) VerifyUniqueInputs(blkID ids.ID, inputs set.Set[ids.ID]) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "VerifyUniqueInputs", arg0, arg1) + ret := m.ctrl.Call(m, "VerifyUniqueInputs", blkID, inputs) ret0, _ := ret[0].(error) return ret0 } // VerifyUniqueInputs indicates an expected call of VerifyUniqueInputs. -func (mr *MockManagerMockRecorder) VerifyUniqueInputs(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) VerifyUniqueInputs(blkID, inputs any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VerifyUniqueInputs", reflect.TypeOf((*MockManager)(nil).VerifyUniqueInputs), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VerifyUniqueInputs", reflect.TypeOf((*MockManager)(nil).VerifyUniqueInputs), blkID, inputs) } diff --git a/vms/avm/txs/mock_unsigned_tx.go b/vms/avm/txs/mock_unsigned_tx.go index c6504c7855a0..25bc9d501a16 100644 --- a/vms/avm/txs/mock_unsigned_tx.go +++ b/vms/avm/txs/mock_unsigned_tx.go @@ -1,8 +1,10 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/ava-labs/avalanchego/vms/avm/txs (interfaces: UnsignedTx) +// Source: vms/avm/txs/tx.go +// +// Generated by this command: +// +// mockgen -source=vms/avm/txs/tx.go -destination=vms/avm/txs/mock_unsigned_tx.go -package=txs -exclude_interfaces= +// // Package txs is a generated GoMock package. package txs @@ -55,15 +57,15 @@ func (mr *MockUnsignedTxMockRecorder) Bytes() *gomock.Call { } // InitCtx mocks base method. -func (m *MockUnsignedTx) InitCtx(arg0 *snow.Context) { +func (m *MockUnsignedTx) InitCtx(ctx *snow.Context) { m.ctrl.T.Helper() - m.ctrl.Call(m, "InitCtx", arg0) + m.ctrl.Call(m, "InitCtx", ctx) } // InitCtx indicates an expected call of InitCtx. -func (mr *MockUnsignedTxMockRecorder) InitCtx(arg0 interface{}) *gomock.Call { +func (mr *MockUnsignedTxMockRecorder) InitCtx(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitCtx", reflect.TypeOf((*MockUnsignedTx)(nil).InitCtx), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitCtx", reflect.TypeOf((*MockUnsignedTx)(nil).InitCtx), ctx) } // InputIDs mocks base method. @@ -109,27 +111,27 @@ func (mr *MockUnsignedTxMockRecorder) NumCredentials() *gomock.Call { } // SetBytes mocks base method. -func (m *MockUnsignedTx) SetBytes(arg0 []byte) { +func (m *MockUnsignedTx) SetBytes(unsignedBytes []byte) { m.ctrl.T.Helper() - m.ctrl.Call(m, "SetBytes", arg0) + m.ctrl.Call(m, "SetBytes", unsignedBytes) } // SetBytes indicates an expected call of SetBytes. -func (mr *MockUnsignedTxMockRecorder) SetBytes(arg0 interface{}) *gomock.Call { +func (mr *MockUnsignedTxMockRecorder) SetBytes(unsignedBytes any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetBytes", reflect.TypeOf((*MockUnsignedTx)(nil).SetBytes), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetBytes", reflect.TypeOf((*MockUnsignedTx)(nil).SetBytes), unsignedBytes) } // Visit mocks base method. -func (m *MockUnsignedTx) Visit(arg0 Visitor) error { +func (m *MockUnsignedTx) Visit(visitor Visitor) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Visit", arg0) + ret := m.ctrl.Call(m, "Visit", visitor) ret0, _ := ret[0].(error) return ret0 } // Visit indicates an expected call of Visit. -func (mr *MockUnsignedTxMockRecorder) Visit(arg0 interface{}) *gomock.Call { +func (mr *MockUnsignedTxMockRecorder) Visit(visitor any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Visit", reflect.TypeOf((*MockUnsignedTx)(nil).Visit), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Visit", reflect.TypeOf((*MockUnsignedTx)(nil).Visit), visitor) } diff --git a/vms/platformvm/block/executor/mock_manager.go b/vms/platformvm/block/executor/mock_manager.go index a6a7a9c95bcf..5e8222383071 100644 --- a/vms/platformvm/block/executor/mock_manager.go +++ b/vms/platformvm/block/executor/mock_manager.go @@ -1,8 +1,10 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: vms/platformvm/block/executor/manager.go +// +// Generated by this command: +// +// mockgen -source=vms/platformvm/block/executor/manager.go -destination=vms/platformvm/block/executor/mock_manager.go -package=executor -exclude_interfaces= +// // Package executor is a generated GoMock package. package executor @@ -52,7 +54,7 @@ func (m *MockManager) GetBlock(blkID ids.ID) (snowman.Block, error) { } // GetBlock indicates an expected call of GetBlock. -func (mr *MockManagerMockRecorder) GetBlock(blkID interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) GetBlock(blkID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlock", reflect.TypeOf((*MockManager)(nil).GetBlock), blkID) } @@ -67,7 +69,7 @@ func (m *MockManager) GetState(blkID ids.ID) (state.Chain, bool) { } // GetState indicates an expected call of GetState. -func (mr *MockManagerMockRecorder) GetState(blkID interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) GetState(blkID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetState", reflect.TypeOf((*MockManager)(nil).GetState), blkID) } @@ -82,7 +84,7 @@ func (m *MockManager) GetStatelessBlock(blkID ids.ID) (block.Block, error) { } // GetStatelessBlock indicates an expected call of GetStatelessBlock. -func (mr *MockManagerMockRecorder) GetStatelessBlock(blkID interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) GetStatelessBlock(blkID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStatelessBlock", reflect.TypeOf((*MockManager)(nil).GetStatelessBlock), blkID) } @@ -110,7 +112,7 @@ func (m *MockManager) NewBlock(arg0 block.Block) snowman.Block { } // NewBlock indicates an expected call of NewBlock. -func (mr *MockManagerMockRecorder) NewBlock(arg0 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) NewBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewBlock", reflect.TypeOf((*MockManager)(nil).NewBlock), arg0) } @@ -138,7 +140,7 @@ func (m *MockManager) SetPreference(blkID ids.ID) bool { } // SetPreference indicates an expected call of SetPreference. -func (mr *MockManagerMockRecorder) SetPreference(blkID interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) SetPreference(blkID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetPreference", reflect.TypeOf((*MockManager)(nil).SetPreference), blkID) } @@ -152,7 +154,7 @@ func (m *MockManager) VerifyTx(tx *txs.Tx) error { } // VerifyTx indicates an expected call of VerifyTx. -func (mr *MockManagerMockRecorder) VerifyTx(tx interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) VerifyTx(tx any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VerifyTx", reflect.TypeOf((*MockManager)(nil).VerifyTx), tx) } @@ -166,7 +168,7 @@ func (m *MockManager) VerifyUniqueInputs(blkID ids.ID, inputs set.Set[ids.ID]) e } // VerifyUniqueInputs indicates an expected call of VerifyUniqueInputs. -func (mr *MockManagerMockRecorder) VerifyUniqueInputs(blkID, inputs interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) VerifyUniqueInputs(blkID, inputs any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VerifyUniqueInputs", reflect.TypeOf((*MockManager)(nil).VerifyUniqueInputs), blkID, inputs) } diff --git a/vms/platformvm/txs/mock_staker.go b/vms/platformvm/txs/mock_staker.go deleted file mode 100644 index f74c2534ca39..000000000000 --- a/vms/platformvm/txs/mock_staker.go +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - -// Code generated by MockGen. DO NOT EDIT. -// Source: github.com/ava-labs/avalanchego/vms/platformvm/txs (interfaces: Staker) - -// Package txs is a generated GoMock package. -package txs - -import ( - reflect "reflect" - time "time" - - ids "github.com/ava-labs/avalanchego/ids" - bls "github.com/ava-labs/avalanchego/utils/crypto/bls" - gomock "go.uber.org/mock/gomock" -) - -// MockStaker is a mock of Staker interface. -type MockStaker struct { - ctrl *gomock.Controller - recorder *MockStakerMockRecorder -} - -// MockStakerMockRecorder is the mock recorder for MockStaker. -type MockStakerMockRecorder struct { - mock *MockStaker -} - -// NewMockStaker creates a new mock instance. -func NewMockStaker(ctrl *gomock.Controller) *MockStaker { - mock := &MockStaker{ctrl: ctrl} - mock.recorder = &MockStakerMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockStaker) EXPECT() *MockStakerMockRecorder { - return m.recorder -} - -// CurrentPriority mocks base method. -func (m *MockStaker) CurrentPriority() Priority { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "CurrentPriority") - ret0, _ := ret[0].(Priority) - return ret0 -} - -// CurrentPriority indicates an expected call of CurrentPriority. -func (mr *MockStakerMockRecorder) CurrentPriority() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CurrentPriority", reflect.TypeOf((*MockStaker)(nil).CurrentPriority)) -} - -// EndTime mocks base method. -func (m *MockStaker) EndTime() time.Time { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "EndTime") - ret0, _ := ret[0].(time.Time) - return ret0 -} - -// EndTime indicates an expected call of EndTime. -func (mr *MockStakerMockRecorder) EndTime() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EndTime", reflect.TypeOf((*MockStaker)(nil).EndTime)) -} - -// NodeID mocks base method. -func (m *MockStaker) NodeID() ids.NodeID { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NodeID") - ret0, _ := ret[0].(ids.NodeID) - return ret0 -} - -// NodeID indicates an expected call of NodeID. -func (mr *MockStakerMockRecorder) NodeID() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeID", reflect.TypeOf((*MockStaker)(nil).NodeID)) -} - -// PublicKey mocks base method. -func (m *MockStaker) PublicKey() (*bls.PublicKey, bool, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "PublicKey") - ret0, _ := ret[0].(*bls.PublicKey) - ret1, _ := ret[1].(bool) - ret2, _ := ret[2].(error) - return ret0, ret1, ret2 -} - -// PublicKey indicates an expected call of PublicKey. -func (mr *MockStakerMockRecorder) PublicKey() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PublicKey", reflect.TypeOf((*MockStaker)(nil).PublicKey)) -} - -// SubnetID mocks base method. -func (m *MockStaker) SubnetID() ids.ID { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SubnetID") - ret0, _ := ret[0].(ids.ID) - return ret0 -} - -// SubnetID indicates an expected call of SubnetID. -func (mr *MockStakerMockRecorder) SubnetID() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubnetID", reflect.TypeOf((*MockStaker)(nil).SubnetID)) -} - -// Weight mocks base method. -func (m *MockStaker) Weight() uint64 { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Weight") - ret0, _ := ret[0].(uint64) - return ret0 -} - -// Weight indicates an expected call of Weight. -func (mr *MockStakerMockRecorder) Weight() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Weight", reflect.TypeOf((*MockStaker)(nil).Weight)) -} diff --git a/vms/platformvm/txs/mock_scheduled_staker.go b/vms/platformvm/txs/mock_staker_tx.go similarity index 57% rename from vms/platformvm/txs/mock_scheduled_staker.go rename to vms/platformvm/txs/mock_staker_tx.go index ce1a22b4eda0..2e01b15b3813 100644 --- a/vms/platformvm/txs/mock_scheduled_staker.go +++ b/vms/platformvm/txs/mock_staker_tx.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/ava-labs/avalanchego/vms/platformvm/txs (interfaces: ScheduledStaker) +// Source: vms/platformvm/txs/staker_tx.go +// +// Generated by this command: +// +// mockgen -source=vms/platformvm/txs/staker_tx.go -destination=vms/platformvm/txs/mock_staker_tx.go -package=txs -exclude_interfaces=ValidatorTx,DelegatorTx,StakerTx,PermissionlessStaker +// // Package txs is a generated GoMock package. package txs @@ -13,6 +18,115 @@ import ( gomock "go.uber.org/mock/gomock" ) +// MockStaker is a mock of Staker interface. +type MockStaker struct { + ctrl *gomock.Controller + recorder *MockStakerMockRecorder +} + +// MockStakerMockRecorder is the mock recorder for MockStaker. +type MockStakerMockRecorder struct { + mock *MockStaker +} + +// NewMockStaker creates a new mock instance. +func NewMockStaker(ctrl *gomock.Controller) *MockStaker { + mock := &MockStaker{ctrl: ctrl} + mock.recorder = &MockStakerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockStaker) EXPECT() *MockStakerMockRecorder { + return m.recorder +} + +// CurrentPriority mocks base method. +func (m *MockStaker) CurrentPriority() Priority { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CurrentPriority") + ret0, _ := ret[0].(Priority) + return ret0 +} + +// CurrentPriority indicates an expected call of CurrentPriority. +func (mr *MockStakerMockRecorder) CurrentPriority() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CurrentPriority", reflect.TypeOf((*MockStaker)(nil).CurrentPriority)) +} + +// EndTime mocks base method. +func (m *MockStaker) EndTime() time.Time { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "EndTime") + ret0, _ := ret[0].(time.Time) + return ret0 +} + +// EndTime indicates an expected call of EndTime. +func (mr *MockStakerMockRecorder) EndTime() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EndTime", reflect.TypeOf((*MockStaker)(nil).EndTime)) +} + +// NodeID mocks base method. +func (m *MockStaker) NodeID() ids.NodeID { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "NodeID") + ret0, _ := ret[0].(ids.NodeID) + return ret0 +} + +// NodeID indicates an expected call of NodeID. +func (mr *MockStakerMockRecorder) NodeID() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeID", reflect.TypeOf((*MockStaker)(nil).NodeID)) +} + +// PublicKey mocks base method. +func (m *MockStaker) PublicKey() (*bls.PublicKey, bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "PublicKey") + ret0, _ := ret[0].(*bls.PublicKey) + ret1, _ := ret[1].(bool) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// PublicKey indicates an expected call of PublicKey. +func (mr *MockStakerMockRecorder) PublicKey() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PublicKey", reflect.TypeOf((*MockStaker)(nil).PublicKey)) +} + +// SubnetID mocks base method. +func (m *MockStaker) SubnetID() ids.ID { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SubnetID") + ret0, _ := ret[0].(ids.ID) + return ret0 +} + +// SubnetID indicates an expected call of SubnetID. +func (mr *MockStakerMockRecorder) SubnetID() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubnetID", reflect.TypeOf((*MockStaker)(nil).SubnetID)) +} + +// Weight mocks base method. +func (m *MockStaker) Weight() uint64 { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Weight") + ret0, _ := ret[0].(uint64) + return ret0 +} + +// Weight indicates an expected call of Weight. +func (mr *MockStakerMockRecorder) Weight() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Weight", reflect.TypeOf((*MockStaker)(nil).Weight)) +} + // MockScheduledStaker is a mock of ScheduledStaker interface. type MockScheduledStaker struct { ctrl *gomock.Controller diff --git a/vms/platformvm/txs/mock_unsigned_tx.go b/vms/platformvm/txs/mock_unsigned_tx.go index 9d9ec6c94dd4..f775c5203a4f 100644 --- a/vms/platformvm/txs/mock_unsigned_tx.go +++ b/vms/platformvm/txs/mock_unsigned_tx.go @@ -1,8 +1,10 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/ava-labs/avalanchego/vms/platformvm/txs (interfaces: UnsignedTx) +// Source: vms/platformvm/txs/unsigned_tx.go +// +// Generated by this command: +// +// mockgen -source=vms/platformvm/txs/unsigned_tx.go -destination=vms/platformvm/txs/mock_unsigned_tx.go -package=txs -exclude_interfaces= +// // Package txs is a generated GoMock package. package txs @@ -55,15 +57,15 @@ func (mr *MockUnsignedTxMockRecorder) Bytes() *gomock.Call { } // InitCtx mocks base method. -func (m *MockUnsignedTx) InitCtx(arg0 *snow.Context) { +func (m *MockUnsignedTx) InitCtx(ctx *snow.Context) { m.ctrl.T.Helper() - m.ctrl.Call(m, "InitCtx", arg0) + m.ctrl.Call(m, "InitCtx", ctx) } // InitCtx indicates an expected call of InitCtx. -func (mr *MockUnsignedTxMockRecorder) InitCtx(arg0 interface{}) *gomock.Call { +func (mr *MockUnsignedTxMockRecorder) InitCtx(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitCtx", reflect.TypeOf((*MockUnsignedTx)(nil).InitCtx), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitCtx", reflect.TypeOf((*MockUnsignedTx)(nil).InitCtx), ctx) } // InputIDs mocks base method. @@ -95,41 +97,41 @@ func (mr *MockUnsignedTxMockRecorder) Outputs() *gomock.Call { } // SetBytes mocks base method. -func (m *MockUnsignedTx) SetBytes(arg0 []byte) { +func (m *MockUnsignedTx) SetBytes(unsignedBytes []byte) { m.ctrl.T.Helper() - m.ctrl.Call(m, "SetBytes", arg0) + m.ctrl.Call(m, "SetBytes", unsignedBytes) } // SetBytes indicates an expected call of SetBytes. -func (mr *MockUnsignedTxMockRecorder) SetBytes(arg0 interface{}) *gomock.Call { +func (mr *MockUnsignedTxMockRecorder) SetBytes(unsignedBytes any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetBytes", reflect.TypeOf((*MockUnsignedTx)(nil).SetBytes), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetBytes", reflect.TypeOf((*MockUnsignedTx)(nil).SetBytes), unsignedBytes) } // SyntacticVerify mocks base method. -func (m *MockUnsignedTx) SyntacticVerify(arg0 *snow.Context) error { +func (m *MockUnsignedTx) SyntacticVerify(ctx *snow.Context) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SyntacticVerify", arg0) + ret := m.ctrl.Call(m, "SyntacticVerify", ctx) ret0, _ := ret[0].(error) return ret0 } // SyntacticVerify indicates an expected call of SyntacticVerify. -func (mr *MockUnsignedTxMockRecorder) SyntacticVerify(arg0 interface{}) *gomock.Call { +func (mr *MockUnsignedTxMockRecorder) SyntacticVerify(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyntacticVerify", reflect.TypeOf((*MockUnsignedTx)(nil).SyntacticVerify), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyntacticVerify", reflect.TypeOf((*MockUnsignedTx)(nil).SyntacticVerify), ctx) } // Visit mocks base method. -func (m *MockUnsignedTx) Visit(arg0 Visitor) error { +func (m *MockUnsignedTx) Visit(visitor Visitor) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Visit", arg0) + ret := m.ctrl.Call(m, "Visit", visitor) ret0, _ := ret[0].(error) return ret0 } // Visit indicates an expected call of Visit. -func (mr *MockUnsignedTxMockRecorder) Visit(arg0 interface{}) *gomock.Call { +func (mr *MockUnsignedTxMockRecorder) Visit(visitor any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Visit", reflect.TypeOf((*MockUnsignedTx)(nil).Visit), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Visit", reflect.TypeOf((*MockUnsignedTx)(nil).Visit), visitor) } diff --git a/x/merkledb/mock_db.go b/x/merkledb/mock_db.go index faca3d9c00cf..d43e276103f7 100644 --- a/x/merkledb/mock_db.go +++ b/x/merkledb/mock_db.go @@ -1,16 +1,22 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/ava-labs/avalanchego/x/merkledb (interfaces: MerkleDB) +// Source: x/merkledb/db.go +// +// Generated by this command: +// +// mockgen -source=x/merkledb/db.go -destination=x/merkledb/mock_db.go -package=merkledb -exclude_interfaces=ChangeProofer,RangeProofer,Clearer,Prefetcher +// // Package merkledb is a generated GoMock package. package merkledb import ( context "context" + reflect "reflect" + database "github.com/ava-labs/avalanchego/database" ids "github.com/ava-labs/avalanchego/ids" maybe "github.com/ava-labs/avalanchego/utils/maybe" gomock "go.uber.org/mock/gomock" - reflect "reflect" ) // MockMerkleDB is a mock of MerkleDB interface. @@ -65,207 +71,207 @@ func (mr *MockMerkleDBMockRecorder) Close() *gomock.Call { } // CommitChangeProof mocks base method. -func (m *MockMerkleDB) CommitChangeProof(arg0 context.Context, arg1 *ChangeProof) error { +func (m *MockMerkleDB) CommitChangeProof(ctx context.Context, proof *ChangeProof) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "CommitChangeProof", arg0, arg1) + ret := m.ctrl.Call(m, "CommitChangeProof", ctx, proof) ret0, _ := ret[0].(error) return ret0 } // CommitChangeProof indicates an expected call of CommitChangeProof. -func (mr *MockMerkleDBMockRecorder) CommitChangeProof(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMerkleDBMockRecorder) CommitChangeProof(ctx, proof any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CommitChangeProof", reflect.TypeOf((*MockMerkleDB)(nil).CommitChangeProof), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CommitChangeProof", reflect.TypeOf((*MockMerkleDB)(nil).CommitChangeProof), ctx, proof) } // CommitRangeProof mocks base method. -func (m *MockMerkleDB) CommitRangeProof(arg0 context.Context, arg1, arg2 maybe.Maybe[[]uint8], arg3 *RangeProof) error { +func (m *MockMerkleDB) CommitRangeProof(ctx context.Context, start, end maybe.Maybe[[]byte], proof *RangeProof) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "CommitRangeProof", arg0, arg1, arg2, arg3) + ret := m.ctrl.Call(m, "CommitRangeProof", ctx, start, end, proof) ret0, _ := ret[0].(error) return ret0 } // CommitRangeProof indicates an expected call of CommitRangeProof. -func (mr *MockMerkleDBMockRecorder) CommitRangeProof(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockMerkleDBMockRecorder) CommitRangeProof(ctx, start, end, proof any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CommitRangeProof", reflect.TypeOf((*MockMerkleDB)(nil).CommitRangeProof), arg0, arg1, arg2, arg3) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CommitRangeProof", reflect.TypeOf((*MockMerkleDB)(nil).CommitRangeProof), ctx, start, end, proof) } // Compact mocks base method. -func (m *MockMerkleDB) Compact(arg0, arg1 []byte) error { +func (m *MockMerkleDB) Compact(start, limit []byte) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Compact", arg0, arg1) + ret := m.ctrl.Call(m, "Compact", start, limit) ret0, _ := ret[0].(error) return ret0 } // Compact indicates an expected call of Compact. -func (mr *MockMerkleDBMockRecorder) Compact(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMerkleDBMockRecorder) Compact(start, limit any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Compact", reflect.TypeOf((*MockMerkleDB)(nil).Compact), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Compact", reflect.TypeOf((*MockMerkleDB)(nil).Compact), start, limit) } // Delete mocks base method. -func (m *MockMerkleDB) Delete(arg0 []byte) error { +func (m *MockMerkleDB) Delete(key []byte) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Delete", arg0) + ret := m.ctrl.Call(m, "Delete", key) ret0, _ := ret[0].(error) return ret0 } // Delete indicates an expected call of Delete. -func (mr *MockMerkleDBMockRecorder) Delete(arg0 interface{}) *gomock.Call { +func (mr *MockMerkleDBMockRecorder) Delete(key any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockMerkleDB)(nil).Delete), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockMerkleDB)(nil).Delete), key) } // Get mocks base method. -func (m *MockMerkleDB) Get(arg0 []byte) ([]byte, error) { +func (m *MockMerkleDB) Get(key []byte) ([]byte, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Get", arg0) + ret := m.ctrl.Call(m, "Get", key) ret0, _ := ret[0].([]byte) ret1, _ := ret[1].(error) return ret0, ret1 } // Get indicates an expected call of Get. -func (mr *MockMerkleDBMockRecorder) Get(arg0 interface{}) *gomock.Call { +func (mr *MockMerkleDBMockRecorder) Get(key any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockMerkleDB)(nil).Get), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockMerkleDB)(nil).Get), key) } // GetChangeProof mocks base method. -func (m *MockMerkleDB) GetChangeProof(arg0 context.Context, arg1, arg2 ids.ID, arg3, arg4 maybe.Maybe[[]uint8], arg5 int) (*ChangeProof, error) { +func (m *MockMerkleDB) GetChangeProof(ctx context.Context, startRootID, endRootID ids.ID, start, end maybe.Maybe[[]byte], maxLength int) (*ChangeProof, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetChangeProof", arg0, arg1, arg2, arg3, arg4, arg5) + ret := m.ctrl.Call(m, "GetChangeProof", ctx, startRootID, endRootID, start, end, maxLength) ret0, _ := ret[0].(*ChangeProof) ret1, _ := ret[1].(error) return ret0, ret1 } // GetChangeProof indicates an expected call of GetChangeProof. -func (mr *MockMerkleDBMockRecorder) GetChangeProof(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call { +func (mr *MockMerkleDBMockRecorder) GetChangeProof(ctx, startRootID, endRootID, start, end, maxLength any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetChangeProof", reflect.TypeOf((*MockMerkleDB)(nil).GetChangeProof), arg0, arg1, arg2, arg3, arg4, arg5) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetChangeProof", reflect.TypeOf((*MockMerkleDB)(nil).GetChangeProof), ctx, startRootID, endRootID, start, end, maxLength) } // GetMerkleRoot mocks base method. -func (m *MockMerkleDB) GetMerkleRoot(arg0 context.Context) (ids.ID, error) { +func (m *MockMerkleDB) GetMerkleRoot(ctx context.Context) (ids.ID, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetMerkleRoot", arg0) + ret := m.ctrl.Call(m, "GetMerkleRoot", ctx) ret0, _ := ret[0].(ids.ID) ret1, _ := ret[1].(error) return ret0, ret1 } // GetMerkleRoot indicates an expected call of GetMerkleRoot. -func (mr *MockMerkleDBMockRecorder) GetMerkleRoot(arg0 interface{}) *gomock.Call { +func (mr *MockMerkleDBMockRecorder) GetMerkleRoot(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMerkleRoot", reflect.TypeOf((*MockMerkleDB)(nil).GetMerkleRoot), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMerkleRoot", reflect.TypeOf((*MockMerkleDB)(nil).GetMerkleRoot), ctx) } // GetProof mocks base method. -func (m *MockMerkleDB) GetProof(arg0 context.Context, arg1 []byte) (*Proof, error) { +func (m *MockMerkleDB) GetProof(ctx context.Context, keyBytes []byte) (*Proof, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetProof", arg0, arg1) + ret := m.ctrl.Call(m, "GetProof", ctx, keyBytes) ret0, _ := ret[0].(*Proof) ret1, _ := ret[1].(error) return ret0, ret1 } // GetProof indicates an expected call of GetProof. -func (mr *MockMerkleDBMockRecorder) GetProof(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMerkleDBMockRecorder) GetProof(ctx, keyBytes any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetProof", reflect.TypeOf((*MockMerkleDB)(nil).GetProof), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetProof", reflect.TypeOf((*MockMerkleDB)(nil).GetProof), ctx, keyBytes) } // GetRangeProof mocks base method. -func (m *MockMerkleDB) GetRangeProof(arg0 context.Context, arg1, arg2 maybe.Maybe[[]uint8], arg3 int) (*RangeProof, error) { +func (m *MockMerkleDB) GetRangeProof(ctx context.Context, start, end maybe.Maybe[[]byte], maxLength int) (*RangeProof, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetRangeProof", arg0, arg1, arg2, arg3) + ret := m.ctrl.Call(m, "GetRangeProof", ctx, start, end, maxLength) ret0, _ := ret[0].(*RangeProof) ret1, _ := ret[1].(error) return ret0, ret1 } // GetRangeProof indicates an expected call of GetRangeProof. -func (mr *MockMerkleDBMockRecorder) GetRangeProof(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockMerkleDBMockRecorder) GetRangeProof(ctx, start, end, maxLength any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRangeProof", reflect.TypeOf((*MockMerkleDB)(nil).GetRangeProof), arg0, arg1, arg2, arg3) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRangeProof", reflect.TypeOf((*MockMerkleDB)(nil).GetRangeProof), ctx, start, end, maxLength) } // GetRangeProofAtRoot mocks base method. -func (m *MockMerkleDB) GetRangeProofAtRoot(arg0 context.Context, arg1 ids.ID, arg2, arg3 maybe.Maybe[[]uint8], arg4 int) (*RangeProof, error) { +func (m *MockMerkleDB) GetRangeProofAtRoot(ctx context.Context, rootID ids.ID, start, end maybe.Maybe[[]byte], maxLength int) (*RangeProof, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetRangeProofAtRoot", arg0, arg1, arg2, arg3, arg4) + ret := m.ctrl.Call(m, "GetRangeProofAtRoot", ctx, rootID, start, end, maxLength) ret0, _ := ret[0].(*RangeProof) ret1, _ := ret[1].(error) return ret0, ret1 } // GetRangeProofAtRoot indicates an expected call of GetRangeProofAtRoot. -func (mr *MockMerkleDBMockRecorder) GetRangeProofAtRoot(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { +func (mr *MockMerkleDBMockRecorder) GetRangeProofAtRoot(ctx, rootID, start, end, maxLength any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRangeProofAtRoot", reflect.TypeOf((*MockMerkleDB)(nil).GetRangeProofAtRoot), arg0, arg1, arg2, arg3, arg4) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRangeProofAtRoot", reflect.TypeOf((*MockMerkleDB)(nil).GetRangeProofAtRoot), ctx, rootID, start, end, maxLength) } // GetValue mocks base method. -func (m *MockMerkleDB) GetValue(arg0 context.Context, arg1 []byte) ([]byte, error) { +func (m *MockMerkleDB) GetValue(ctx context.Context, key []byte) ([]byte, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetValue", arg0, arg1) + ret := m.ctrl.Call(m, "GetValue", ctx, key) ret0, _ := ret[0].([]byte) ret1, _ := ret[1].(error) return ret0, ret1 } // GetValue indicates an expected call of GetValue. -func (mr *MockMerkleDBMockRecorder) GetValue(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMerkleDBMockRecorder) GetValue(ctx, key any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValue", reflect.TypeOf((*MockMerkleDB)(nil).GetValue), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValue", reflect.TypeOf((*MockMerkleDB)(nil).GetValue), ctx, key) } // GetValues mocks base method. -func (m *MockMerkleDB) GetValues(arg0 context.Context, arg1 [][]byte) ([][]byte, []error) { +func (m *MockMerkleDB) GetValues(ctx context.Context, keys [][]byte) ([][]byte, []error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetValues", arg0, arg1) + ret := m.ctrl.Call(m, "GetValues", ctx, keys) ret0, _ := ret[0].([][]byte) ret1, _ := ret[1].([]error) return ret0, ret1 } // GetValues indicates an expected call of GetValues. -func (mr *MockMerkleDBMockRecorder) GetValues(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMerkleDBMockRecorder) GetValues(ctx, keys any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValues", reflect.TypeOf((*MockMerkleDB)(nil).GetValues), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValues", reflect.TypeOf((*MockMerkleDB)(nil).GetValues), ctx, keys) } // Has mocks base method. -func (m *MockMerkleDB) Has(arg0 []byte) (bool, error) { +func (m *MockMerkleDB) Has(key []byte) (bool, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Has", arg0) + ret := m.ctrl.Call(m, "Has", key) ret0, _ := ret[0].(bool) ret1, _ := ret[1].(error) return ret0, ret1 } // Has indicates an expected call of Has. -func (mr *MockMerkleDBMockRecorder) Has(arg0 interface{}) *gomock.Call { +func (mr *MockMerkleDBMockRecorder) Has(key any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Has", reflect.TypeOf((*MockMerkleDB)(nil).Has), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Has", reflect.TypeOf((*MockMerkleDB)(nil).Has), key) } // HealthCheck mocks base method. -func (m *MockMerkleDB) HealthCheck(arg0 context.Context) (interface{}, error) { +func (m *MockMerkleDB) HealthCheck(arg0 context.Context) (any, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "HealthCheck", arg0) - ret0, _ := ret[0].(interface{}) + ret0, _ := ret[0].(any) ret1, _ := ret[1].(error) return ret0, ret1 } // HealthCheck indicates an expected call of HealthCheck. -func (mr *MockMerkleDBMockRecorder) HealthCheck(arg0 interface{}) *gomock.Call { +func (mr *MockMerkleDBMockRecorder) HealthCheck(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HealthCheck", reflect.TypeOf((*MockMerkleDB)(nil).HealthCheck), arg0) } @@ -299,174 +305,160 @@ func (mr *MockMerkleDBMockRecorder) NewIterator() *gomock.Call { } // NewIteratorWithPrefix mocks base method. -func (m *MockMerkleDB) NewIteratorWithPrefix(arg0 []byte) database.Iterator { +func (m *MockMerkleDB) NewIteratorWithPrefix(prefix []byte) database.Iterator { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NewIteratorWithPrefix", arg0) + ret := m.ctrl.Call(m, "NewIteratorWithPrefix", prefix) ret0, _ := ret[0].(database.Iterator) return ret0 } // NewIteratorWithPrefix indicates an expected call of NewIteratorWithPrefix. -func (mr *MockMerkleDBMockRecorder) NewIteratorWithPrefix(arg0 interface{}) *gomock.Call { +func (mr *MockMerkleDBMockRecorder) NewIteratorWithPrefix(prefix any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewIteratorWithPrefix", reflect.TypeOf((*MockMerkleDB)(nil).NewIteratorWithPrefix), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewIteratorWithPrefix", reflect.TypeOf((*MockMerkleDB)(nil).NewIteratorWithPrefix), prefix) } // NewIteratorWithStart mocks base method. -func (m *MockMerkleDB) NewIteratorWithStart(arg0 []byte) database.Iterator { +func (m *MockMerkleDB) NewIteratorWithStart(start []byte) database.Iterator { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NewIteratorWithStart", arg0) + ret := m.ctrl.Call(m, "NewIteratorWithStart", start) ret0, _ := ret[0].(database.Iterator) return ret0 } // NewIteratorWithStart indicates an expected call of NewIteratorWithStart. -func (mr *MockMerkleDBMockRecorder) NewIteratorWithStart(arg0 interface{}) *gomock.Call { +func (mr *MockMerkleDBMockRecorder) NewIteratorWithStart(start any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewIteratorWithStart", reflect.TypeOf((*MockMerkleDB)(nil).NewIteratorWithStart), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewIteratorWithStart", reflect.TypeOf((*MockMerkleDB)(nil).NewIteratorWithStart), start) } // NewIteratorWithStartAndPrefix mocks base method. -func (m *MockMerkleDB) NewIteratorWithStartAndPrefix(arg0, arg1 []byte) database.Iterator { +func (m *MockMerkleDB) NewIteratorWithStartAndPrefix(start, prefix []byte) database.Iterator { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NewIteratorWithStartAndPrefix", arg0, arg1) + ret := m.ctrl.Call(m, "NewIteratorWithStartAndPrefix", start, prefix) ret0, _ := ret[0].(database.Iterator) return ret0 } // NewIteratorWithStartAndPrefix indicates an expected call of NewIteratorWithStartAndPrefix. -func (mr *MockMerkleDBMockRecorder) NewIteratorWithStartAndPrefix(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMerkleDBMockRecorder) NewIteratorWithStartAndPrefix(start, prefix any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewIteratorWithStartAndPrefix", reflect.TypeOf((*MockMerkleDB)(nil).NewIteratorWithStartAndPrefix), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewIteratorWithStartAndPrefix", reflect.TypeOf((*MockMerkleDB)(nil).NewIteratorWithStartAndPrefix), start, prefix) } // NewView mocks base method. -func (m *MockMerkleDB) NewView(arg0 context.Context, arg1 ViewChanges) (View, error) { +func (m *MockMerkleDB) NewView(ctx context.Context, changes ViewChanges) (View, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NewView", arg0, arg1) + ret := m.ctrl.Call(m, "NewView", ctx, changes) ret0, _ := ret[0].(View) ret1, _ := ret[1].(error) return ret0, ret1 } // NewView indicates an expected call of NewView. -func (mr *MockMerkleDBMockRecorder) NewView(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMerkleDBMockRecorder) NewView(ctx, changes any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewView", reflect.TypeOf((*MockMerkleDB)(nil).NewView), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewView", reflect.TypeOf((*MockMerkleDB)(nil).NewView), ctx, changes) } // PrefetchPath mocks base method. -func (m *MockMerkleDB) PrefetchPath(arg0 []byte) error { +func (m *MockMerkleDB) PrefetchPath(key []byte) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "PrefetchPath", arg0) + ret := m.ctrl.Call(m, "PrefetchPath", key) ret0, _ := ret[0].(error) return ret0 } // PrefetchPath indicates an expected call of PrefetchPath. -func (mr *MockMerkleDBMockRecorder) PrefetchPath(arg0 interface{}) *gomock.Call { +func (mr *MockMerkleDBMockRecorder) PrefetchPath(key any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PrefetchPath", reflect.TypeOf((*MockMerkleDB)(nil).PrefetchPath), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PrefetchPath", reflect.TypeOf((*MockMerkleDB)(nil).PrefetchPath), key) } // PrefetchPaths mocks base method. -func (m *MockMerkleDB) PrefetchPaths(arg0 [][]byte) error { +func (m *MockMerkleDB) PrefetchPaths(keys [][]byte) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "PrefetchPaths", arg0) + ret := m.ctrl.Call(m, "PrefetchPaths", keys) ret0, _ := ret[0].(error) return ret0 } // PrefetchPaths indicates an expected call of PrefetchPaths. -func (mr *MockMerkleDBMockRecorder) PrefetchPaths(arg0 interface{}) *gomock.Call { +func (mr *MockMerkleDBMockRecorder) PrefetchPaths(keys any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PrefetchPaths", reflect.TypeOf((*MockMerkleDB)(nil).PrefetchPaths), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PrefetchPaths", reflect.TypeOf((*MockMerkleDB)(nil).PrefetchPaths), keys) } // Put mocks base method. -func (m *MockMerkleDB) Put(arg0, arg1 []byte) error { +func (m *MockMerkleDB) Put(key, value []byte) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Put", arg0, arg1) + ret := m.ctrl.Call(m, "Put", key, value) ret0, _ := ret[0].(error) return ret0 } // Put indicates an expected call of Put. -func (mr *MockMerkleDBMockRecorder) Put(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMerkleDBMockRecorder) Put(key, value any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Put", reflect.TypeOf((*MockMerkleDB)(nil).Put), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Put", reflect.TypeOf((*MockMerkleDB)(nil).Put), key, value) } // VerifyChangeProof mocks base method. -func (m *MockMerkleDB) VerifyChangeProof(arg0 context.Context, arg1 *ChangeProof, arg2, arg3 maybe.Maybe[[]uint8], arg4 ids.ID) error { +func (m *MockMerkleDB) VerifyChangeProof(ctx context.Context, proof *ChangeProof, start, end maybe.Maybe[[]byte], expectedEndRootID ids.ID) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "VerifyChangeProof", arg0, arg1, arg2, arg3, arg4) + ret := m.ctrl.Call(m, "VerifyChangeProof", ctx, proof, start, end, expectedEndRootID) ret0, _ := ret[0].(error) return ret0 } // VerifyChangeProof indicates an expected call of VerifyChangeProof. -func (mr *MockMerkleDBMockRecorder) VerifyChangeProof(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { +func (mr *MockMerkleDBMockRecorder) VerifyChangeProof(ctx, proof, start, end, expectedEndRootID any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VerifyChangeProof", reflect.TypeOf((*MockMerkleDB)(nil).VerifyChangeProof), arg0, arg1, arg2, arg3, arg4) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VerifyChangeProof", reflect.TypeOf((*MockMerkleDB)(nil).VerifyChangeProof), ctx, proof, start, end, expectedEndRootID) } // getEditableNode mocks base method. -func (m *MockMerkleDB) getEditableNode(arg0 Key, arg1 bool) (*node, error) { +func (m *MockMerkleDB) getEditableNode(key Key, hasValue bool) (*node, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "getEditableNode", arg0, arg1) + ret := m.ctrl.Call(m, "getEditableNode", key, hasValue) ret0, _ := ret[0].(*node) ret1, _ := ret[1].(error) return ret0, ret1 } // getEditableNode indicates an expected call of getEditableNode. -func (mr *MockMerkleDBMockRecorder) getEditableNode(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMerkleDBMockRecorder) getEditableNode(key, hasValue any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "getEditableNode", reflect.TypeOf((*MockMerkleDB)(nil).getEditableNode), arg0, arg1) -} - -// getRoot mocks base method. -func (m *MockMerkleDB) getRoot() maybe.Maybe[*node] { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "getRoot") - ret0, _ := ret[0].(maybe.Maybe[*node]) - return ret0 -} - -// getRoot indicates an expected call of getRoot. -func (mr *MockMerkleDBMockRecorder) getRoot() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "getRoot", reflect.TypeOf((*MockMerkleDB)(nil).getRoot)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "getEditableNode", reflect.TypeOf((*MockMerkleDB)(nil).getEditableNode), key, hasValue) } // getNode mocks base method. -func (m *MockMerkleDB) getNode(arg0 Key, arg1 bool) (*node, error) { +func (m *MockMerkleDB) getNode(key Key, hasValue bool) (*node, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "getNode", arg0, arg1) + ret := m.ctrl.Call(m, "getNode", key, hasValue) ret0, _ := ret[0].(*node) ret1, _ := ret[1].(error) return ret0, ret1 } // getNode indicates an expected call of getNode. -func (mr *MockMerkleDBMockRecorder) getNode(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMerkleDBMockRecorder) getNode(key, hasValue any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "getNode", reflect.TypeOf((*MockMerkleDB)(nil).getNode), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "getNode", reflect.TypeOf((*MockMerkleDB)(nil).getNode), key, hasValue) } -// getSentinelNode mocks base method. -func (m *MockMerkleDB) getSentinelNode() *node { +// getRoot mocks base method. +func (m *MockMerkleDB) getRoot() maybe.Maybe[*node] { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "getSentinelNode") - ret0, _ := ret[0].(*node) + ret := m.ctrl.Call(m, "getRoot") + ret0, _ := ret[0].(maybe.Maybe[*node]) return ret0 } -// getSentinelNode indicates an expected call of getSentinelNode. -func (mr *MockMerkleDBMockRecorder) getSentinelNode() *gomock.Call { +// getRoot indicates an expected call of getRoot. +func (mr *MockMerkleDBMockRecorder) getRoot() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "getSentinelNode", reflect.TypeOf((*MockMerkleDB)(nil).getSentinelNode)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "getRoot", reflect.TypeOf((*MockMerkleDB)(nil).getRoot)) } // getTokenSize mocks base method. @@ -484,16 +476,16 @@ func (mr *MockMerkleDBMockRecorder) getTokenSize() *gomock.Call { } // getValue mocks base method. -func (m *MockMerkleDB) getValue(arg0 Key) ([]byte, error) { +func (m *MockMerkleDB) getValue(key Key) ([]byte, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "getValue", arg0) + ret := m.ctrl.Call(m, "getValue", key) ret0, _ := ret[0].([]byte) ret1, _ := ret[1].(error) return ret0, ret1 } // getValue indicates an expected call of getValue. -func (mr *MockMerkleDBMockRecorder) getValue(arg0 interface{}) *gomock.Call { +func (mr *MockMerkleDBMockRecorder) getValue(key any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "getValue", reflect.TypeOf((*MockMerkleDB)(nil).getValue), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "getValue", reflect.TypeOf((*MockMerkleDB)(nil).getValue), key) } From cde054f7cecc7a54f1143e9166a78173ee40f2e3 Mon Sep 17 00:00:00 2001 From: Dhruba Basu <7675102+dhrubabasu@users.noreply.github.com> Date: Wed, 17 Jan 2024 13:50:21 -0500 Subject: [PATCH 46/57] Verify all MockGen generated files are re-generated in CI (#2616) --- scripts/mock.gen.sh | 20 ++++++++++ vms/components/avax/mock_transferable_out.go | 22 ++++++++-- vms/platformvm/fx/mock_fx.go | 42 ++++++++++++++------ 3 files changed, 67 insertions(+), 17 deletions(-) diff --git a/scripts/mock.gen.sh b/scripts/mock.gen.sh index e7eb04618016..75997d18b86e 100755 --- a/scripts/mock.gen.sh +++ b/scripts/mock.gen.sh @@ -16,6 +16,8 @@ fi source ./scripts/constants.sh +outputted_files=() + # tuples of (source interface import path, comma-separated interface names, output file path) input="scripts/mocks.mockgen.txt" while IFS= read -r line @@ -23,6 +25,7 @@ do IFS='=' read src_import_path interface_name output_path <<< "${line}" package_name=$(basename $(dirname $output_path)) echo "Generating ${output_path}..." + outputted_files+=(${output_path}) mockgen -package=${package_name} -destination=${output_path} ${src_import_path} ${interface_name} done < "$input" @@ -33,6 +36,7 @@ while IFS= read -r line do IFS='=' read source_path exclude_interfaces output_path <<< "${line}" package_name=$(basename $(dirname $output_path)) + outputted_files+=(${output_path}) echo "Generating ${output_path}..." mockgen \ @@ -43,4 +47,20 @@ do done < "$input" +all_generated_files=( $(grep -Rl 'Code generated by MockGen. DO NOT EDIT.') ) + +# Exclude certain files +outputted_files+=('scripts/mock.gen.sh') # This file +outputted_files+=('vms/components/avax/mock_transferable_out.go') # Embedded verify.IsState +outputted_files+=('vms/platformvm/fx/mock_fx.go') # Embedded verify.IsNotState + +diff_files=(`echo ${all_generated_files[@]} ${outputted_files[@]} | tr ' ' '\n' | sort | uniq -u`) + +if (( ${#diff_files[@]} )); then + printf "\nFAILURE\n" + echo "Detected MockGen generated files that are not in scripts/mocks.mockgen.source.txt or scripts/mocks.mockgen.txt:" + printf "%s\n" "${diff_files[@]}" + exit 255 +fi + echo "SUCCESS" diff --git a/vms/components/avax/mock_transferable_out.go b/vms/components/avax/mock_transferable_out.go index bf1836002214..b518b86302d4 100644 --- a/vms/components/avax/mock_transferable_out.go +++ b/vms/components/avax/mock_transferable_out.go @@ -1,8 +1,10 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms/components/avax (interfaces: TransferableOut) +// +// Generated by this command: +// +// mockgen -package=avax -destination=vms/components/avax/mock_transferable_out.go github.com/ava-labs/avalanchego/vms/components/avax TransferableOut +// // Package avax is a generated GoMock package. package avax @@ -61,7 +63,7 @@ func (m *MockTransferableOut) InitCtx(arg0 *snow.Context) { } // InitCtx indicates an expected call of InitCtx. -func (mr *MockTransferableOutMockRecorder) InitCtx(arg0 interface{}) *gomock.Call { +func (mr *MockTransferableOutMockRecorder) InitCtx(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitCtx", reflect.TypeOf((*MockTransferableOut)(nil).InitCtx), arg0) } @@ -79,3 +81,15 @@ func (mr *MockTransferableOutMockRecorder) Verify() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Verify", reflect.TypeOf((*MockTransferableOut)(nil).Verify)) } + +// isState mocks base method. +func (m *MockTransferableOut) isState() { + m.ctrl.T.Helper() + m.ctrl.Call(m, "isState") +} + +// isState indicates an expected call of isState. +func (mr *MockTransferableOutMockRecorder) isState() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "isState", reflect.TypeOf((*MockTransferableOut)(nil).isState)) +} diff --git a/vms/platformvm/fx/mock_fx.go b/vms/platformvm/fx/mock_fx.go index b0a2d761c7b2..6878c124b822 100644 --- a/vms/platformvm/fx/mock_fx.go +++ b/vms/platformvm/fx/mock_fx.go @@ -1,8 +1,10 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ava-labs/avalanchego/vms/platformvm/fx (interfaces: Fx,Owner) +// +// Generated by this command: +// +// mockgen -package=fx -destination=vms/platformvm/fx/mock_fx.go github.com/ava-labs/avalanchego/vms/platformvm/fx Fx,Owner +// // Package fx is a generated GoMock package. package fx @@ -67,22 +69,22 @@ func (mr *MockFxMockRecorder) Bootstrapping() *gomock.Call { } // CreateOutput mocks base method. -func (m *MockFx) CreateOutput(arg0 uint64, arg1 interface{}) (interface{}, error) { +func (m *MockFx) CreateOutput(arg0 uint64, arg1 any) (any, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "CreateOutput", arg0, arg1) - ret0, _ := ret[0].(interface{}) + ret0, _ := ret[0].(any) ret1, _ := ret[1].(error) return ret0, ret1 } // CreateOutput indicates an expected call of CreateOutput. -func (mr *MockFxMockRecorder) CreateOutput(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockFxMockRecorder) CreateOutput(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOutput", reflect.TypeOf((*MockFx)(nil).CreateOutput), arg0, arg1) } // Initialize mocks base method. -func (m *MockFx) Initialize(arg0 interface{}) error { +func (m *MockFx) Initialize(arg0 any) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Initialize", arg0) ret0, _ := ret[0].(error) @@ -90,13 +92,13 @@ func (m *MockFx) Initialize(arg0 interface{}) error { } // Initialize indicates an expected call of Initialize. -func (mr *MockFxMockRecorder) Initialize(arg0 interface{}) *gomock.Call { +func (mr *MockFxMockRecorder) Initialize(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Initialize", reflect.TypeOf((*MockFx)(nil).Initialize), arg0) } // VerifyPermission mocks base method. -func (m *MockFx) VerifyPermission(arg0, arg1, arg2, arg3 interface{}) error { +func (m *MockFx) VerifyPermission(arg0, arg1, arg2, arg3 any) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "VerifyPermission", arg0, arg1, arg2, arg3) ret0, _ := ret[0].(error) @@ -104,13 +106,13 @@ func (m *MockFx) VerifyPermission(arg0, arg1, arg2, arg3 interface{}) error { } // VerifyPermission indicates an expected call of VerifyPermission. -func (mr *MockFxMockRecorder) VerifyPermission(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockFxMockRecorder) VerifyPermission(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VerifyPermission", reflect.TypeOf((*MockFx)(nil).VerifyPermission), arg0, arg1, arg2, arg3) } // VerifyTransfer mocks base method. -func (m *MockFx) VerifyTransfer(arg0, arg1, arg2, arg3 interface{}) error { +func (m *MockFx) VerifyTransfer(arg0, arg1, arg2, arg3 any) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "VerifyTransfer", arg0, arg1, arg2, arg3) ret0, _ := ret[0].(error) @@ -118,7 +120,7 @@ func (m *MockFx) VerifyTransfer(arg0, arg1, arg2, arg3 interface{}) error { } // VerifyTransfer indicates an expected call of VerifyTransfer. -func (mr *MockFxMockRecorder) VerifyTransfer(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockFxMockRecorder) VerifyTransfer(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VerifyTransfer", reflect.TypeOf((*MockFx)(nil).VerifyTransfer), arg0, arg1, arg2, arg3) } @@ -155,7 +157,7 @@ func (m *MockOwner) InitCtx(arg0 *snow.Context) { } // InitCtx indicates an expected call of InitCtx. -func (mr *MockOwnerMockRecorder) InitCtx(arg0 interface{}) *gomock.Call { +func (mr *MockOwnerMockRecorder) InitCtx(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitCtx", reflect.TypeOf((*MockOwner)(nil).InitCtx), arg0) } @@ -173,3 +175,17 @@ func (mr *MockOwnerMockRecorder) Verify() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Verify", reflect.TypeOf((*MockOwner)(nil).Verify)) } + +// isState mocks base method. +func (m *MockOwner) isState() error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "isState") + ret0, _ := ret[0].(error) + return ret0 +} + +// isState indicates an expected call of isState. +func (mr *MockOwnerMockRecorder) isState() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "isState", reflect.TypeOf((*MockOwner)(nil).isState)) +} From fee76e8539915e21d44c51dff336c30bf1f68a82 Mon Sep 17 00:00:00 2001 From: Stephen Buttolph Date: Wed, 17 Jan 2024 14:40:44 -0500 Subject: [PATCH 47/57] Move division by 0 check out of the bloom loops (#2622) --- utils/bloom/filter.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils/bloom/filter.go b/utils/bloom/filter.go index 761ebfad12e1..7a0e3026087e 100644 --- a/utils/bloom/filter.go +++ b/utils/bloom/filter.go @@ -63,6 +63,7 @@ func (f *Filter) Add(hash uint64) { f.lock.Lock() defer f.lock.Unlock() + _ = 1 % f.numBits // hint to the compiler that numBits is not 0 for _, seed := range f.hashSeeds { hash = bits.RotateLeft64(hash, hashRotation) ^ seed index := hash % f.numBits @@ -119,6 +120,7 @@ func newHashSeeds(count int) ([]uint64, error) { func contains(hashSeeds []uint64, entries []byte, hash uint64) bool { var ( numBits = bitsPerByte * uint64(len(entries)) + _ = 1 % numBits // hint to the compiler that numBits is not 0 accumulator byte = 1 ) for seedIndex := 0; seedIndex < len(hashSeeds) && accumulator != 0; seedIndex++ { From 4819bb90babb06a684279d2ba77c30f0cd5525e0 Mon Sep 17 00:00:00 2001 From: Alberto Benegiamo Date: Wed, 17 Jan 2024 13:33:20 -0700 Subject: [PATCH 48/57] P-chain Add UTs around stakers persistence in platformvm state (#2505) --- vms/platformvm/state/diff_test.go | 14 +- vms/platformvm/state/state_test.go | 776 ++++++++++++++++++++++++++++- 2 files changed, 771 insertions(+), 19 deletions(-) diff --git a/vms/platformvm/state/diff_test.go b/vms/platformvm/state/diff_test.go index c4698603855e..e8d51039bdba 100644 --- a/vms/platformvm/state/diff_test.go +++ b/vms/platformvm/state/diff_test.go @@ -38,7 +38,7 @@ func TestDiffCreation(t *testing.T) { ctrl := gomock.NewController(t) lastAcceptedID := ids.GenerateTestID() - state, _ := newInitializedState(require) + state := newInitializedState(require) versions := NewMockVersions(ctrl) versions.EXPECT().GetState(lastAcceptedID).AnyTimes().Return(state, true) @@ -52,7 +52,7 @@ func TestDiffCurrentSupply(t *testing.T) { ctrl := gomock.NewController(t) lastAcceptedID := ids.GenerateTestID() - state, _ := newInitializedState(require) + state := newInitializedState(require) versions := NewMockVersions(ctrl) versions.EXPECT().GetState(lastAcceptedID).AnyTimes().Return(state, true) @@ -250,7 +250,7 @@ func TestDiffSubnet(t *testing.T) { require := require.New(t) ctrl := gomock.NewController(t) - state, _ := newInitializedState(require) + state := newInitializedState(require) // Initialize parent with one subnet parentStateCreateSubnetTx := &txs.Tx{ @@ -298,7 +298,7 @@ func TestDiffChain(t *testing.T) { require := require.New(t) ctrl := gomock.NewController(t) - state, _ := newInitializedState(require) + state := newInitializedState(require) subnetID := ids.GenerateTestID() // Initialize parent with one chain @@ -397,7 +397,7 @@ func TestDiffRewardUTXO(t *testing.T) { require := require.New(t) ctrl := gomock.NewController(t) - state, _ := newInitializedState(require) + state := newInitializedState(require) txID := ids.GenerateTestID() @@ -523,7 +523,7 @@ func TestDiffSubnetOwner(t *testing.T) { require := require.New(t) ctrl := gomock.NewController(t) - state, _ := newInitializedState(require) + state := newInitializedState(require) states := NewMockVersions(ctrl) lastAcceptedID := ids.GenerateTestID() @@ -585,7 +585,7 @@ func TestDiffStacking(t *testing.T) { require := require.New(t) ctrl := gomock.NewController(t) - state, _ := newInitializedState(require) + state := newInitializedState(require) states := NewMockVersions(ctrl) lastAcceptedID := ids.GenerateTestID() diff --git a/vms/platformvm/state/state_test.go b/vms/platformvm/state/state_test.go index 6986f15a0aa0..c0fdb1e60269 100644 --- a/vms/platformvm/state/state_test.go +++ b/vms/platformvm/state/state_test.go @@ -5,6 +5,7 @@ package state import ( "context" + "fmt" "math" "testing" "time" @@ -32,8 +33,11 @@ import ( "github.com/ava-labs/avalanchego/vms/platformvm/genesis" "github.com/ava-labs/avalanchego/vms/platformvm/metrics" "github.com/ava-labs/avalanchego/vms/platformvm/reward" + "github.com/ava-labs/avalanchego/vms/platformvm/signer" + "github.com/ava-labs/avalanchego/vms/platformvm/status" "github.com/ava-labs/avalanchego/vms/platformvm/txs" "github.com/ava-labs/avalanchego/vms/secp256k1fx" + "github.com/ava-labs/avalanchego/vms/types" safemath "github.com/ava-labs/avalanchego/utils/math" ) @@ -49,23 +53,23 @@ func TestStateInitialization(t *testing.T) { require := require.New(t) s, db := newUninitializedState(require) - shouldInit, err := s.(*state).shouldInit() + shouldInit, err := s.shouldInit() require.NoError(err) require.True(shouldInit) - require.NoError(s.(*state).doneInit()) + require.NoError(s.doneInit()) require.NoError(s.Commit()) s = newStateFromDB(require, db) - shouldInit, err = s.(*state).shouldInit() + shouldInit, err = s.shouldInit() require.NoError(err) require.False(shouldInit) } func TestStateSyncGenesis(t *testing.T) { require := require.New(t) - state, _ := newInitializedState(require) + state := newInitializedState(require) staker, err := state.GetCurrentValidator(constants.PrimaryNetworkID, initialNodeID) require.NoError(err) @@ -88,8 +92,626 @@ func TestStateSyncGenesis(t *testing.T) { assertIteratorsEqual(t, EmptyIterator, delegatorIterator) } -func newInitializedState(require *require.Assertions) (State, database.Database) { - s, db := newUninitializedState(require) +// Whenever we store a staker, a whole bunch a data structures are updated +// This test is meant to capture which updates are carried out +func TestPersistStakers(t *testing.T) { + tests := map[string]struct { + // Insert or delete a staker to state and store it + storeStaker func(*require.Assertions, ids.ID /*=subnetID*/, *state) *Staker + + // Check that the staker is duly stored/removed in P-chain state + checkStakerInState func(*require.Assertions, *state, *Staker) + + // Check whether validators are duly reported in the validator set, + // with the right weight and showing the BLS key + checkValidatorsSet func(*require.Assertions, *state, *Staker) + + // Check that node duly track stakers uptimes + checkValidatorUptimes func(*require.Assertions, *state, *Staker) + + // Check whether weight/bls keys diffs are duly stored + checkDiffs func(*require.Assertions, *state, *Staker, uint64) + }{ + "add current validator": { + storeStaker: func(r *require.Assertions, subnetID ids.ID, s *state) *Staker { + var ( + startTime = time.Now().Unix() + endTime = time.Now().Add(14 * 24 * time.Hour).Unix() + + validatorsData = txs.Validator{ + NodeID: ids.GenerateTestNodeID(), + End: uint64(endTime), + Wght: 1234, + } + validatorReward uint64 = 5678 + ) + + utx := createPermissionlessValidatorTx(r, subnetID, validatorsData) + addPermValTx := &txs.Tx{Unsigned: utx} + r.NoError(addPermValTx.Initialize(txs.Codec)) + + staker, err := NewCurrentStaker( + addPermValTx.ID(), + utx, + time.Unix(startTime, 0), + validatorReward, + ) + r.NoError(err) + + s.PutCurrentValidator(staker) + s.AddTx(addPermValTx, status.Committed) // this is currently needed to reload the staker + r.NoError(s.Commit()) + return staker + }, + checkStakerInState: func(r *require.Assertions, s *state, staker *Staker) { + retrievedStaker, err := s.GetCurrentValidator(staker.SubnetID, staker.NodeID) + r.NoError(err) + r.Equal(staker, retrievedStaker) + }, + checkValidatorsSet: func(r *require.Assertions, s *state, staker *Staker) { + valsMap := s.cfg.Validators.GetMap(staker.SubnetID) + r.Len(valsMap, 1) + valOut, found := valsMap[staker.NodeID] + r.True(found) + r.Equal(valOut, &validators.GetValidatorOutput{ + NodeID: staker.NodeID, + PublicKey: staker.PublicKey, + Weight: staker.Weight, + }) + }, + checkValidatorUptimes: func(r *require.Assertions, s *state, staker *Staker) { + upDuration, lastUpdated, err := s.GetUptime(staker.NodeID, staker.SubnetID) + r.NoError(err) + r.Equal(upDuration, time.Duration(0)) + r.Equal(lastUpdated, staker.StartTime) + }, + checkDiffs: func(r *require.Assertions, s *state, staker *Staker, height uint64) { + weightDiffBytes, err := s.flatValidatorWeightDiffsDB.Get(marshalDiffKey(staker.SubnetID, height, staker.NodeID)) + r.NoError(err) + weightDiff, err := unmarshalWeightDiff(weightDiffBytes) + r.NoError(err) + r.Equal(weightDiff, &ValidatorWeightDiff{ + Decrease: false, + Amount: staker.Weight, + }) + + blsDiffBytes, err := s.flatValidatorPublicKeyDiffsDB.Get(marshalDiffKey(staker.SubnetID, height, staker.NodeID)) + if staker.SubnetID == constants.PrimaryNetworkID { + r.NoError(err) + r.Nil(blsDiffBytes) + } else { + r.ErrorIs(err, database.ErrNotFound) + } + }, + }, + "add current delegator": { + storeStaker: func(r *require.Assertions, subnetID ids.ID, s *state) *Staker { + // insert the delegator and its validator + var ( + valStartTime = time.Now().Truncate(time.Second).Unix() + delStartTime = time.Unix(valStartTime, 0).Add(time.Hour).Unix() + delEndTime = time.Unix(delStartTime, 0).Add(30 * 24 * time.Hour).Unix() + valEndTime = time.Unix(valStartTime, 0).Add(365 * 24 * time.Hour).Unix() + + validatorsData = txs.Validator{ + NodeID: ids.GenerateTestNodeID(), + End: uint64(valEndTime), + Wght: 1234, + } + validatorReward uint64 = 5678 + + delegatorData = txs.Validator{ + NodeID: validatorsData.NodeID, + End: uint64(delEndTime), + Wght: validatorsData.Wght / 2, + } + delegatorReward uint64 = 5432 + ) + + utxVal := createPermissionlessValidatorTx(r, subnetID, validatorsData) + addPermValTx := &txs.Tx{Unsigned: utxVal} + r.NoError(addPermValTx.Initialize(txs.Codec)) + + val, err := NewCurrentStaker( + addPermValTx.ID(), + utxVal, + time.Unix(valStartTime, 0), + validatorReward, + ) + r.NoError(err) + + utxDel := createPermissionlessDelegatorTx(subnetID, delegatorData) + addPermDelTx := &txs.Tx{Unsigned: utxDel} + r.NoError(addPermDelTx.Initialize(txs.Codec)) + + del, err := NewCurrentStaker( + addPermDelTx.ID(), + utxDel, + time.Unix(delStartTime, 0), + delegatorReward, + ) + r.NoError(err) + + s.PutCurrentValidator(val) + s.AddTx(addPermValTx, status.Committed) // this is currently needed to reload the staker + r.NoError(s.Commit()) + + s.PutCurrentDelegator(del) + s.AddTx(addPermDelTx, status.Committed) // this is currently needed to reload the staker + r.NoError(s.Commit()) + return del + }, + checkStakerInState: func(r *require.Assertions, s *state, staker *Staker) { + delIt, err := s.GetCurrentDelegatorIterator(staker.SubnetID, staker.NodeID) + r.NoError(err) + r.True(delIt.Next()) + retrievedDelegator := delIt.Value() + r.False(delIt.Next()) + delIt.Release() + r.Equal(staker, retrievedDelegator) + }, + checkValidatorsSet: func(r *require.Assertions, s *state, staker *Staker) { + val, err := s.GetCurrentValidator(staker.SubnetID, staker.NodeID) + r.NoError(err) + + valsMap := s.cfg.Validators.GetMap(staker.SubnetID) + r.Len(valsMap, 1) + valOut, found := valsMap[staker.NodeID] + r.True(found) + r.Equal(valOut.NodeID, staker.NodeID) + r.Equal(valOut.Weight, val.Weight+staker.Weight) + }, + checkValidatorUptimes: func(r *require.Assertions, s *state, staker *Staker) { + }, + checkDiffs: func(r *require.Assertions, s *state, staker *Staker, height uint64) { + // validator's weight must increase of delegator's weight amount + weightDiffBytes, err := s.flatValidatorWeightDiffsDB.Get(marshalDiffKey(staker.SubnetID, height, staker.NodeID)) + r.NoError(err) + weightDiff, err := unmarshalWeightDiff(weightDiffBytes) + r.NoError(err) + r.Equal(weightDiff, &ValidatorWeightDiff{ + Decrease: false, + Amount: staker.Weight, + }) + }, + }, + "add pending validator": { + storeStaker: func(r *require.Assertions, subnetID ids.ID, s *state) *Staker { + var ( + startTime = time.Now().Unix() + endTime = time.Now().Add(14 * 24 * time.Hour).Unix() + + validatorsData = txs.Validator{ + NodeID: ids.GenerateTestNodeID(), + Start: uint64(startTime), + End: uint64(endTime), + Wght: 1234, + } + ) + + utx := createPermissionlessValidatorTx(r, subnetID, validatorsData) + addPermValTx := &txs.Tx{Unsigned: utx} + r.NoError(addPermValTx.Initialize(txs.Codec)) + + staker, err := NewPendingStaker( + addPermValTx.ID(), + utx, + ) + r.NoError(err) + + s.PutPendingValidator(staker) + s.AddTx(addPermValTx, status.Committed) // this is currently needed to reload the staker + r.NoError(s.Commit()) + return staker + }, + checkStakerInState: func(r *require.Assertions, s *state, staker *Staker) { + retrievedStaker, err := s.GetPendingValidator(staker.SubnetID, staker.NodeID) + r.NoError(err) + r.Equal(staker, retrievedStaker) + }, + checkValidatorsSet: func(r *require.Assertions, s *state, staker *Staker) { + // pending validators are not showed in validators set + valsMap := s.cfg.Validators.GetMap(staker.SubnetID) + r.Len(valsMap, 0) + }, + checkValidatorUptimes: func(r *require.Assertions, s *state, staker *Staker) { + // pending validators uptime is not tracked + _, _, err := s.GetUptime(staker.NodeID, staker.SubnetID) + r.ErrorIs(err, database.ErrNotFound) + }, + checkDiffs: func(r *require.Assertions, s *state, staker *Staker, height uint64) { + // pending validators weight diff and bls diffs are not stored + _, err := s.flatValidatorWeightDiffsDB.Get(marshalDiffKey(staker.SubnetID, height, staker.NodeID)) + r.ErrorIs(err, database.ErrNotFound) + + _, err = s.flatValidatorPublicKeyDiffsDB.Get(marshalDiffKey(staker.SubnetID, height, staker.NodeID)) + r.ErrorIs(err, database.ErrNotFound) + }, + }, + "add pending delegator": { + storeStaker: func(r *require.Assertions, subnetID ids.ID, s *state) *Staker { + // insert the delegator and its validator + var ( + valStartTime = time.Now().Truncate(time.Second).Unix() + delStartTime = time.Unix(valStartTime, 0).Add(time.Hour).Unix() + delEndTime = time.Unix(delStartTime, 0).Add(30 * 24 * time.Hour).Unix() + valEndTime = time.Unix(valStartTime, 0).Add(365 * 24 * time.Hour).Unix() + + validatorsData = txs.Validator{ + NodeID: ids.GenerateTestNodeID(), + Start: uint64(valStartTime), + End: uint64(valEndTime), + Wght: 1234, + } + + delegatorData = txs.Validator{ + NodeID: validatorsData.NodeID, + Start: uint64(delStartTime), + End: uint64(delEndTime), + Wght: validatorsData.Wght / 2, + } + ) + + utxVal := createPermissionlessValidatorTx(r, subnetID, validatorsData) + addPermValTx := &txs.Tx{Unsigned: utxVal} + r.NoError(addPermValTx.Initialize(txs.Codec)) + + val, err := NewPendingStaker(addPermValTx.ID(), utxVal) + r.NoError(err) + + utxDel := createPermissionlessDelegatorTx(subnetID, delegatorData) + addPermDelTx := &txs.Tx{Unsigned: utxDel} + r.NoError(addPermDelTx.Initialize(txs.Codec)) + + del, err := NewPendingStaker(addPermDelTx.ID(), utxDel) + r.NoError(err) + + s.PutPendingValidator(val) + s.AddTx(addPermValTx, status.Committed) // this is currently needed to reload the staker + r.NoError(s.Commit()) + + s.PutPendingDelegator(del) + s.AddTx(addPermDelTx, status.Committed) // this is currently needed to reload the staker + r.NoError(s.Commit()) + + return del + }, + checkStakerInState: func(r *require.Assertions, s *state, staker *Staker) { + delIt, err := s.GetPendingDelegatorIterator(staker.SubnetID, staker.NodeID) + r.NoError(err) + r.True(delIt.Next()) + retrievedDelegator := delIt.Value() + r.False(delIt.Next()) + delIt.Release() + r.Equal(staker, retrievedDelegator) + }, + checkValidatorsSet: func(r *require.Assertions, s *state, staker *Staker) { + valsMap := s.cfg.Validators.GetMap(staker.SubnetID) + r.Len(valsMap, 0) + }, + checkValidatorUptimes: func(r *require.Assertions, s *state, staker *Staker) { + // nothing to do here + }, + checkDiffs: func(r *require.Assertions, s *state, staker *Staker, height uint64) { + // nothing to do here + }, + }, + "delete current validator": { + storeStaker: func(r *require.Assertions, subnetID ids.ID, s *state) *Staker { + // add them remove the validator + var ( + startTime = time.Now().Unix() + endTime = time.Now().Add(14 * 24 * time.Hour).Unix() + + validatorsData = txs.Validator{ + NodeID: ids.GenerateTestNodeID(), + End: uint64(endTime), + Wght: 1234, + } + validatorReward uint64 = 5678 + ) + + utx := createPermissionlessValidatorTx(r, subnetID, validatorsData) + addPermValTx := &txs.Tx{Unsigned: utx} + r.NoError(addPermValTx.Initialize(txs.Codec)) + + staker, err := NewCurrentStaker( + addPermValTx.ID(), + utx, + time.Unix(startTime, 0), + validatorReward, + ) + r.NoError(err) + + s.PutCurrentValidator(staker) + s.AddTx(addPermValTx, status.Committed) // this is currently needed to reload the staker + r.NoError(s.Commit()) + + s.DeleteCurrentValidator(staker) + r.NoError(s.Commit()) + return staker + }, + checkStakerInState: func(r *require.Assertions, s *state, staker *Staker) { + _, err := s.GetCurrentValidator(staker.SubnetID, staker.NodeID) + r.ErrorIs(err, database.ErrNotFound) + }, + checkValidatorsSet: func(r *require.Assertions, s *state, staker *Staker) { + // deleted validators are not showed in the validators set anymore + valsMap := s.cfg.Validators.GetMap(staker.SubnetID) + r.Len(valsMap, 0) + }, + checkValidatorUptimes: func(r *require.Assertions, s *state, staker *Staker) { + // uptimes of delete validators are dropped + _, _, err := s.GetUptime(staker.NodeID, staker.SubnetID) + r.ErrorIs(err, database.ErrNotFound) + }, + checkDiffs: func(r *require.Assertions, s *state, staker *Staker, height uint64) { + weightDiffBytes, err := s.flatValidatorWeightDiffsDB.Get(marshalDiffKey(staker.SubnetID, height, staker.NodeID)) + r.NoError(err) + weightDiff, err := unmarshalWeightDiff(weightDiffBytes) + r.NoError(err) + r.Equal(weightDiff, &ValidatorWeightDiff{ + Decrease: true, + Amount: staker.Weight, + }) + + blsDiffBytes, err := s.flatValidatorPublicKeyDiffsDB.Get(marshalDiffKey(staker.SubnetID, height, staker.NodeID)) + if staker.SubnetID == constants.PrimaryNetworkID { + r.NoError(err) + r.Equal(bls.DeserializePublicKey(blsDiffBytes), staker.PublicKey) + } else { + r.ErrorIs(err, database.ErrNotFound) + } + }, + }, + "delete current delegator": { + storeStaker: func(r *require.Assertions, subnetID ids.ID, s *state) *Staker { + // insert validator and delegator, then remove the delegator + var ( + valStartTime = time.Now().Truncate(time.Second).Unix() + delStartTime = time.Unix(valStartTime, 0).Add(time.Hour).Unix() + delEndTime = time.Unix(delStartTime, 0).Add(30 * 24 * time.Hour).Unix() + valEndTime = time.Unix(valStartTime, 0).Add(365 * 24 * time.Hour).Unix() + + validatorsData = txs.Validator{ + NodeID: ids.GenerateTestNodeID(), + End: uint64(valEndTime), + Wght: 1234, + } + validatorReward uint64 = 5678 + + delegatorData = txs.Validator{ + NodeID: validatorsData.NodeID, + End: uint64(delEndTime), + Wght: validatorsData.Wght / 2, + } + delegatorReward uint64 = 5432 + ) + + utxVal := createPermissionlessValidatorTx(r, subnetID, validatorsData) + addPermValTx := &txs.Tx{Unsigned: utxVal} + r.NoError(addPermValTx.Initialize(txs.Codec)) + + val, err := NewCurrentStaker( + addPermValTx.ID(), + utxVal, + time.Unix(valStartTime, 0), + validatorReward, + ) + r.NoError(err) + + utxDel := createPermissionlessDelegatorTx(subnetID, delegatorData) + addPermDelTx := &txs.Tx{Unsigned: utxDel} + r.NoError(addPermDelTx.Initialize(txs.Codec)) + + del, err := NewCurrentStaker( + addPermDelTx.ID(), + utxDel, + time.Unix(delStartTime, 0), + delegatorReward, + ) + r.NoError(err) + + s.PutCurrentValidator(val) + s.AddTx(addPermValTx, status.Committed) // this is currently needed to reload the staker + + s.PutCurrentDelegator(del) + s.AddTx(addPermDelTx, status.Committed) // this is currently needed to reload the staker + r.NoError(s.Commit()) + + s.DeleteCurrentDelegator(del) + r.NoError(s.Commit()) + + return del + }, + checkStakerInState: func(r *require.Assertions, s *state, staker *Staker) { + delIt, err := s.GetCurrentDelegatorIterator(staker.SubnetID, staker.NodeID) + r.NoError(err) + r.False(delIt.Next()) + delIt.Release() + }, + checkValidatorsSet: func(r *require.Assertions, s *state, staker *Staker) { + val, err := s.GetCurrentValidator(staker.SubnetID, staker.NodeID) + r.NoError(err) + + valsMap := s.cfg.Validators.GetMap(staker.SubnetID) + r.Len(valsMap, 1) + valOut, found := valsMap[staker.NodeID] + r.True(found) + r.Equal(valOut.NodeID, staker.NodeID) + r.Equal(valOut.Weight, val.Weight) + }, + checkValidatorUptimes: func(r *require.Assertions, s *state, staker *Staker) { + // nothing to do here + }, + checkDiffs: func(r *require.Assertions, s *state, staker *Staker, height uint64) { + // validator's weight must decrease of delegator's weight amount + weightDiffBytes, err := s.flatValidatorWeightDiffsDB.Get(marshalDiffKey(staker.SubnetID, height, staker.NodeID)) + r.NoError(err) + weightDiff, err := unmarshalWeightDiff(weightDiffBytes) + r.NoError(err) + r.Equal(weightDiff, &ValidatorWeightDiff{ + Decrease: true, + Amount: staker.Weight, + }) + }, + }, + "delete pending validator": { + storeStaker: func(r *require.Assertions, subnetID ids.ID, s *state) *Staker { + var ( + startTime = time.Now().Unix() + endTime = time.Now().Add(14 * 24 * time.Hour).Unix() + + validatorsData = txs.Validator{ + NodeID: ids.GenerateTestNodeID(), + Start: uint64(startTime), + End: uint64(endTime), + Wght: 1234, + } + ) + + utx := createPermissionlessValidatorTx(r, subnetID, validatorsData) + addPermValTx := &txs.Tx{Unsigned: utx} + r.NoError(addPermValTx.Initialize(txs.Codec)) + + staker, err := NewPendingStaker( + addPermValTx.ID(), + utx, + ) + r.NoError(err) + + s.PutPendingValidator(staker) + s.AddTx(addPermValTx, status.Committed) // this is currently needed to reload the staker + r.NoError(s.Commit()) + + s.DeletePendingValidator(staker) + r.NoError(s.Commit()) + + return staker + }, + checkStakerInState: func(r *require.Assertions, s *state, staker *Staker) { + _, err := s.GetPendingValidator(staker.SubnetID, staker.NodeID) + r.ErrorIs(err, database.ErrNotFound) + }, + checkValidatorsSet: func(r *require.Assertions, s *state, staker *Staker) { + valsMap := s.cfg.Validators.GetMap(staker.SubnetID) + r.Len(valsMap, 0) + }, + checkValidatorUptimes: func(r *require.Assertions, s *state, staker *Staker) { + _, _, err := s.GetUptime(staker.NodeID, staker.SubnetID) + r.ErrorIs(err, database.ErrNotFound) + }, + checkDiffs: func(r *require.Assertions, s *state, staker *Staker, height uint64) { + _, err := s.flatValidatorWeightDiffsDB.Get(marshalDiffKey(staker.SubnetID, height, staker.NodeID)) + r.ErrorIs(err, database.ErrNotFound) + + _, err = s.flatValidatorPublicKeyDiffsDB.Get(marshalDiffKey(staker.SubnetID, height, staker.NodeID)) + r.ErrorIs(err, database.ErrNotFound) + }, + }, + "delete pending delegator": { + storeStaker: func(r *require.Assertions, subnetID ids.ID, s *state) *Staker { + // insert validator and delegator the remove the validator + var ( + valStartTime = time.Now().Truncate(time.Second).Unix() + delStartTime = time.Unix(valStartTime, 0).Add(time.Hour).Unix() + delEndTime = time.Unix(delStartTime, 0).Add(30 * 24 * time.Hour).Unix() + valEndTime = time.Unix(valStartTime, 0).Add(365 * 24 * time.Hour).Unix() + + validatorsData = txs.Validator{ + NodeID: ids.GenerateTestNodeID(), + Start: uint64(valStartTime), + End: uint64(valEndTime), + Wght: 1234, + } + + delegatorData = txs.Validator{ + NodeID: validatorsData.NodeID, + Start: uint64(delStartTime), + End: uint64(delEndTime), + Wght: validatorsData.Wght / 2, + } + ) + + utxVal := createPermissionlessValidatorTx(r, subnetID, validatorsData) + addPermValTx := &txs.Tx{Unsigned: utxVal} + r.NoError(addPermValTx.Initialize(txs.Codec)) + + val, err := NewPendingStaker(addPermValTx.ID(), utxVal) + r.NoError(err) + + utxDel := createPermissionlessDelegatorTx(subnetID, delegatorData) + addPermDelTx := &txs.Tx{Unsigned: utxDel} + r.NoError(addPermDelTx.Initialize(txs.Codec)) + + del, err := NewPendingStaker(addPermDelTx.ID(), utxDel) + r.NoError(err) + + s.PutPendingValidator(val) + s.AddTx(addPermValTx, status.Committed) // this is currently needed to reload the staker + + s.PutPendingDelegator(del) + s.AddTx(addPermDelTx, status.Committed) // this is currently needed to reload the staker + r.NoError(s.Commit()) + + s.DeletePendingDelegator(del) + r.NoError(s.Commit()) + return del + }, + checkStakerInState: func(r *require.Assertions, s *state, staker *Staker) { + delIt, err := s.GetPendingDelegatorIterator(staker.SubnetID, staker.NodeID) + r.NoError(err) + r.False(delIt.Next()) + delIt.Release() + }, + checkValidatorsSet: func(r *require.Assertions, s *state, staker *Staker) { + valsMap := s.cfg.Validators.GetMap(staker.SubnetID) + r.Len(valsMap, 0) + }, + checkValidatorUptimes: func(r *require.Assertions, s *state, staker *Staker) { + }, + checkDiffs: func(r *require.Assertions, s *state, staker *Staker, height uint64) { + }, + }, + } + + subnetIDs := []ids.ID{constants.PrimaryNetworkID, ids.GenerateTestID()} + for _, subnetID := range subnetIDs { + for name, test := range tests { + t.Run(fmt.Sprintf("%s - subnetID %s", name, subnetID), func(t *testing.T) { + require := require.New(t) + + state, db := newUninitializedState(require) + + // create and store the staker + staker := test.storeStaker(require, subnetID, state) + + // check all relevant data are stored + test.checkStakerInState(require, state, staker) + test.checkValidatorsSet(require, state, staker) + test.checkValidatorUptimes(require, state, staker) + test.checkDiffs(require, state, staker, 0 /*height*/) + + // rebuild the state + rebuiltState := newStateFromDB(require, db) + + // load relevant quantities + require.NoError(rebuiltState.loadCurrentValidators()) + require.NoError(rebuiltState.loadPendingValidators()) + require.NoError(rebuiltState.initValidatorSets()) + + // check again that all relevant data are still available in rebuilt state + test.checkStakerInState(require, state, staker) + test.checkValidatorsSet(require, state, staker) + test.checkValidatorUptimes(require, state, staker) + test.checkDiffs(require, state, staker, 0 /*height*/) + }) + } + } +} + +func newInitializedState(require *require.Assertions) State { + s, _ := newUninitializedState(require) initialValidator := &txs.AddValidatorTx{ Validator: txs.Validator{ @@ -150,17 +772,17 @@ func newInitializedState(require *require.Assertions) (State, database.Database) genesisBlk, err := block.NewApricotCommitBlock(genesisBlkID, 0) require.NoError(err) - require.NoError(s.(*state).syncGenesis(genesisBlk, genesisState)) + require.NoError(s.syncGenesis(genesisBlk, genesisState)) - return s, db + return s } -func newUninitializedState(require *require.Assertions) (State, database.Database) { +func newUninitializedState(require *require.Assertions) (*state, database.Database) { db := memdb.New() return newStateFromDB(require, db), db } -func newStateFromDB(require *require.Assertions, db database.Database) State { +func newStateFromDB(require *require.Assertions, db database.Database) *state { execCfg, _ := config.GetExecutionConfig(nil) state, err := newState( db, @@ -183,6 +805,136 @@ func newStateFromDB(require *require.Assertions, db database.Database) State { return state } +func createPermissionlessValidatorTx(r *require.Assertions, subnetID ids.ID, validatorsData txs.Validator) *txs.AddPermissionlessValidatorTx { + var sig signer.Signer = &signer.Empty{} + if subnetID == constants.PrimaryNetworkID { + sk, err := bls.NewSecretKey() + r.NoError(err) + sig = signer.NewProofOfPossession(sk) + } + + return &txs.AddPermissionlessValidatorTx{ + BaseTx: txs.BaseTx{ + BaseTx: avax.BaseTx{ + NetworkID: constants.MainnetID, + BlockchainID: constants.PlatformChainID, + Outs: []*avax.TransferableOutput{}, + Ins: []*avax.TransferableInput{ + { + UTXOID: avax.UTXOID{ + TxID: ids.GenerateTestID(), + OutputIndex: 1, + }, + Asset: avax.Asset{ + ID: ids.GenerateTestID(), + }, + In: &secp256k1fx.TransferInput{ + Amt: 2 * units.KiloAvax, + Input: secp256k1fx.Input{ + SigIndices: []uint32{1}, + }, + }, + }, + }, + Memo: types.JSONByteSlice{}, + }, + }, + Validator: validatorsData, + Subnet: subnetID, + Signer: sig, + + StakeOuts: []*avax.TransferableOutput{ + { + Asset: avax.Asset{ + ID: ids.GenerateTestID(), + }, + Out: &secp256k1fx.TransferOutput{ + Amt: 2 * units.KiloAvax, + OutputOwners: secp256k1fx.OutputOwners{ + Locktime: 0, + Threshold: 1, + Addrs: []ids.ShortID{ + ids.GenerateTestShortID(), + }, + }, + }, + }, + }, + ValidatorRewardsOwner: &secp256k1fx.OutputOwners{ + Locktime: 0, + Threshold: 1, + Addrs: []ids.ShortID{ + ids.GenerateTestShortID(), + }, + }, + DelegatorRewardsOwner: &secp256k1fx.OutputOwners{ + Locktime: 0, + Threshold: 1, + Addrs: []ids.ShortID{ + ids.GenerateTestShortID(), + }, + }, + DelegationShares: reward.PercentDenominator, + } +} + +func createPermissionlessDelegatorTx(subnetID ids.ID, delegatorData txs.Validator) *txs.AddPermissionlessDelegatorTx { + return &txs.AddPermissionlessDelegatorTx{ + BaseTx: txs.BaseTx{ + BaseTx: avax.BaseTx{ + NetworkID: constants.MainnetID, + BlockchainID: constants.PlatformChainID, + Outs: []*avax.TransferableOutput{}, + Ins: []*avax.TransferableInput{ + { + UTXOID: avax.UTXOID{ + TxID: ids.GenerateTestID(), + OutputIndex: 1, + }, + Asset: avax.Asset{ + ID: ids.GenerateTestID(), + }, + In: &secp256k1fx.TransferInput{ + Amt: 2 * units.KiloAvax, + Input: secp256k1fx.Input{ + SigIndices: []uint32{1}, + }, + }, + }, + }, + Memo: types.JSONByteSlice{}, + }, + }, + Validator: delegatorData, + Subnet: subnetID, + + StakeOuts: []*avax.TransferableOutput{ + { + Asset: avax.Asset{ + ID: ids.GenerateTestID(), + }, + Out: &secp256k1fx.TransferOutput{ + Amt: 2 * units.KiloAvax, + OutputOwners: secp256k1fx.OutputOwners{ + Locktime: 0, + Threshold: 1, + Addrs: []ids.ShortID{ + ids.GenerateTestShortID(), + }, + }, + }, + }, + }, + DelegationRewardsOwner: &secp256k1fx.OutputOwners{ + Locktime: 0, + Threshold: 1, + Addrs: []ids.ShortID{ + ids.GenerateTestShortID(), + }, + }, + } +} + func TestValidatorWeightDiff(t *testing.T) { type test struct { name string @@ -328,7 +1080,7 @@ func TestValidatorWeightDiff(t *testing.T) { func TestStateAddRemoveValidator(t *testing.T) { require := require.New(t) - state, _ := newInitializedState(require) + state := newInitializedState(require) var ( numNodes = 3 @@ -667,7 +1419,7 @@ func TestParsedStateBlock(t *testing.T) { func TestStateSubnetOwner(t *testing.T) { require := require.New(t) - state, _ := newInitializedState(require) + state := newInitializedState(require) ctrl := gomock.NewController(t) var ( From fe2ded6a8237801c2c49597dc2099f9ec759f574 Mon Sep 17 00:00:00 2001 From: Dhruba Basu <7675102+dhrubabasu@users.noreply.github.com> Date: Wed, 17 Jan 2024 15:58:44 -0500 Subject: [PATCH 49/57] Revert "Set dependabot target branch to `dev` (#2553)" (#2623) --- .github/dependabot.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 39bc8b683ea0..b444581e62d0 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,4 +9,3 @@ updates: directory: "/" # Location of package manifests schedule: interval: "daily" - target-branch: "dev" From a120693004de47838a171121827f77af5467e385 Mon Sep 17 00:00:00 2001 From: Dhruba Basu <7675102+dhrubabasu@users.noreply.github.com> Date: Wed, 17 Jan 2024 16:09:54 -0500 Subject: [PATCH 50/57] Remove remaining 2023 remnants (#2624) --- LICENSE | 2 +- header.yml | 2 +- network/ip_tracker.go | 2 +- tests/fixture/tmpnet/network_config.go | 2 +- tests/fixture/tmpnet/subnet.go | 2 +- utils/filesystem/mock_file.go | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/LICENSE b/LICENSE index c9be72c59aa5..6178f77a85af 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ BSD 3-Clause License -Copyright (C) 2019-2023, Ava Labs, Inc. +Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/header.yml b/header.yml index 19229afa4a64..c15feba2713b 100644 --- a/header.yml +++ b/header.yml @@ -1,4 +1,4 @@ header: | - // Copyright (C) 2019-{{YEAR}}, Ava Labs, Inc. All rights reserved. + // Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. \ No newline at end of file diff --git a/network/ip_tracker.go b/network/ip_tracker.go index eb8dcddb6e76..60502dbbf4df 100644 --- a/network/ip_tracker.go +++ b/network/ip_tracker.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package network diff --git a/tests/fixture/tmpnet/network_config.go b/tests/fixture/tmpnet/network_config.go index 4c68af240e98..c5bb603ed3e5 100644 --- a/tests/fixture/tmpnet/network_config.go +++ b/tests/fixture/tmpnet/network_config.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tmpnet diff --git a/tests/fixture/tmpnet/subnet.go b/tests/fixture/tmpnet/subnet.go index 0eb1feab5f38..1cfa0dc12aa0 100644 --- a/tests/fixture/tmpnet/subnet.go +++ b/tests/fixture/tmpnet/subnet.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package tmpnet diff --git a/utils/filesystem/mock_file.go b/utils/filesystem/mock_file.go index 92b219393765..7b133025621b 100644 --- a/utils/filesystem/mock_file.go +++ b/utils/filesystem/mock_file.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package filesystem From 6647ef6bf7d3e5451e4131148d98d2c5a5ba0ace Mon Sep 17 00:00:00 2001 From: Stephen Buttolph Date: Wed, 17 Jan 2024 16:50:58 -0500 Subject: [PATCH 51/57] Deprecate push-based peerlist gossip flags (#2625) --- config/config.go | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/config/config.go b/config/config.go index 5de3e70777b4..eb27ac1021d2 100644 --- a/config/config.go +++ b/config/config.go @@ -58,16 +58,20 @@ const ( ipcDeprecationMsg = "IPC API is deprecated" keystoreDeprecationMsg = "keystore API is deprecated" acceptedFrontierGossipDeprecationMsg = "push-based accepted frontier gossip is deprecated" + peerListPushGossipDeprecationMsg = "push-based peer list gossip is deprecated" ) var ( // Deprecated key --> deprecation message (i.e. which key replaces it) // TODO: deprecate "BootstrapIDsKey" and "BootstrapIPsKey" - deprecatedKeys = map[string]string{ - IpcAPIEnabledKey: ipcDeprecationMsg, - IpcsChainIDsKey: ipcDeprecationMsg, - IpcsPathKey: ipcDeprecationMsg, + commitThresholdDeprecationMsg = fmt.Sprintf("use --%s instead", SnowCommitThresholdKey) + deprecatedKeys = map[string]string{ + IpcAPIEnabledKey: ipcDeprecationMsg, + IpcsChainIDsKey: ipcDeprecationMsg, + IpcsPathKey: ipcDeprecationMsg, + KeystoreAPIEnabledKey: keystoreDeprecationMsg, + ConsensusGossipAcceptedFrontierValidatorSizeKey: acceptedFrontierGossipDeprecationMsg, ConsensusGossipAcceptedFrontierNonValidatorSizeKey: acceptedFrontierGossipDeprecationMsg, ConsensusGossipAcceptedFrontierPeerSizeKey: acceptedFrontierGossipDeprecationMsg, @@ -75,8 +79,13 @@ var ( ConsensusGossipOnAcceptNonValidatorSizeKey: acceptedFrontierGossipDeprecationMsg, ConsensusGossipOnAcceptPeerSizeKey: acceptedFrontierGossipDeprecationMsg, - SnowRogueCommitThresholdKey: fmt.Sprintf("use --%s instead", SnowCommitThresholdKey), - SnowVirtuousCommitThresholdKey: fmt.Sprintf("use --%s instead", SnowCommitThresholdKey), + NetworkPeerListValidatorGossipSizeKey: peerListPushGossipDeprecationMsg, + NetworkPeerListNonValidatorGossipSizeKey: peerListPushGossipDeprecationMsg, + NetworkPeerListPeersGossipSizeKey: peerListPushGossipDeprecationMsg, + NetworkPeerListGossipFreqKey: peerListPushGossipDeprecationMsg, + + SnowRogueCommitThresholdKey: commitThresholdDeprecationMsg, + SnowVirtuousCommitThresholdKey: commitThresholdDeprecationMsg, } errConflictingACPOpinion = errors.New("supporting and objecting to the same ACP") From f3561f4f82028927296006e7dc4bee058fabb681 Mon Sep 17 00:00:00 2001 From: Dhruba Basu <7675102+dhrubabasu@users.noreply.github.com> Date: Wed, 17 Jan 2024 18:00:39 -0500 Subject: [PATCH 52/57] Remove support for compressing gzip messages (#2627) --- config/config.go | 4 + config/flags.go | 2 +- message/messages.go | 21 +-- message/messages_test.go | 187 --------------------------- message/outbound_msg_builder_test.go | 1 - utils/compression/gzip_compressor.go | 1 + utils/compression/type.go | 2 +- 7 files changed, 8 insertions(+), 210 deletions(-) diff --git a/config/config.go b/config/config.go index eb27ac1021d2..09cc32d286b5 100644 --- a/config/config.go +++ b/config/config.go @@ -109,6 +109,7 @@ var ( errCannotReadDirectory = errors.New("cannot read directory") errUnmarshalling = errors.New("unmarshalling failed") errFileDoesNotExist = errors.New("file does not exist") + errGzipDeprecatedMsg = errors.New("gzip compression is not supported, use zstd or no compression") ) func getConsensusConfig(v *viper.Viper) snowball.Parameters { @@ -346,6 +347,9 @@ func getNetworkConfig( if err != nil { return network.Config{}, err } + if compressionType == compression.TypeGzip { + return network.Config{}, errGzipDeprecatedMsg + } allowPrivateIPs := !constants.ProductionNetworkIDs.Contains(networkID) if v.IsSet(NetworkAllowPrivateIPsKey) { diff --git a/config/flags.go b/config/flags.go index 6f85fedfd33c..1cbd89dfcf8c 100644 --- a/config/flags.go +++ b/config/flags.go @@ -157,7 +157,7 @@ func addNodeFlags(fs *pflag.FlagSet) { fs.Duration(NetworkPingTimeoutKey, constants.DefaultPingPongTimeout, "Timeout value for Ping-Pong with a peer") fs.Duration(NetworkPingFrequencyKey, constants.DefaultPingFrequency, "Frequency of pinging other peers") - fs.String(NetworkCompressionTypeKey, constants.DefaultNetworkCompressionType.String(), fmt.Sprintf("Compression type for outbound messages. Must be one of [%s, %s, %s]", compression.TypeGzip, compression.TypeZstd, compression.TypeNone)) + fs.String(NetworkCompressionTypeKey, constants.DefaultNetworkCompressionType.String(), fmt.Sprintf("Compression type for outbound messages. Must be one of [%s, %s]", compression.TypeZstd, compression.TypeNone)) fs.Duration(NetworkMaxClockDifferenceKey, constants.DefaultNetworkMaxClockDifference, "Max allowed clock difference value between this node and peers") // Note: The default value is set to false here because the default diff --git a/message/messages.go b/message/messages.go index fbd3519de30d..b8b5db69e958 100644 --- a/message/messages.go +++ b/message/messages.go @@ -134,8 +134,8 @@ func (m *outboundMessage) BytesSavedCompression() int { type msgBuilder struct { log logging.Logger + // TODO: Remove gzip once v1.11.x is out. gzipCompressor compression.Compressor - gzipCompressTimeMetrics map[Op]metric.Averager gzipDecompressTimeMetrics map[Op]metric.Averager zstdCompressor compression.Compressor @@ -164,7 +164,6 @@ func newMsgBuilder( log: log, gzipCompressor: gzipCompressor, - gzipCompressTimeMetrics: make(map[Op]metric.Averager, len(ExternalOps)), gzipDecompressTimeMetrics: make(map[Op]metric.Averager, len(ExternalOps)), zstdCompressor: zstdCompressor, @@ -176,13 +175,6 @@ func newMsgBuilder( errs := wrappers.Errs{} for _, op := range ExternalOps { - mb.gzipCompressTimeMetrics[op] = metric.NewAveragerWithErrs( - namespace, - fmt.Sprintf("gzip_%s_compress_time", op), - fmt.Sprintf("time (in ns) to compress %s messages with gzip", op), - metrics, - &errs, - ) mb.gzipDecompressTimeMetrics[op] = metric.NewAveragerWithErrs( namespace, fmt.Sprintf("gzip_%s_decompress_time", op), @@ -236,17 +228,6 @@ func (mb *msgBuilder) marshal( switch compressionType { case compression.TypeNone: return uncompressedMsgBytes, 0, op, nil - case compression.TypeGzip: - compressedBytes, err := mb.gzipCompressor.Compress(uncompressedMsgBytes) - if err != nil { - return nil, 0, 0, err - } - compressedMsg = p2p.Message{ - Message: &p2p.Message_CompressedGzip{ - CompressedGzip: compressedBytes, - }, - } - opToCompressTimeMetrics = mb.gzipCompressTimeMetrics case compression.TypeZstd: compressedBytes, err := mb.zstdCompressor.Compress(uncompressedMsgBytes) if err != nil { diff --git a/message/messages_test.go b/message/messages_test.go index b259cefa341e..27c0fb5fb646 100644 --- a/message/messages_test.go +++ b/message/messages_test.go @@ -159,23 +159,6 @@ func TestMessage(t *testing.T) { bypassThrottling: false, bytesSaved: false, }, - { - desc: "get_peer_list message with gzip compression", - op: GetPeerListOp, - msg: &p2p.Message{ - Message: &p2p.Message_GetPeerList{ - GetPeerList: &p2p.GetPeerList{ - KnownPeers: &p2p.BloomFilter{ - Filter: make([]byte, 2048), - Salt: make([]byte, 32), - }, - }, - }, - }, - compressionType: compression.TypeGzip, - bypassThrottling: false, - bytesSaved: true, - }, { desc: "get_peer_list message with zstd compression", op: GetPeerListOp, @@ -215,28 +198,6 @@ func TestMessage(t *testing.T) { bypassThrottling: true, bytesSaved: false, }, - { - desc: "peer_list message with gzip compression", - op: PeerListOp, - msg: &p2p.Message{ - Message: &p2p.Message_PeerList_{ - PeerList_: &p2p.PeerList{ - ClaimedIpPorts: []*p2p.ClaimedIpPort{ - { - X509Certificate: testTLSCert.Certificate[0], - IpAddr: []byte(net.IPv6zero), - IpPort: 9651, - Timestamp: uint64(nowUnix), - Signature: compressibleContainers[0], - }, - }, - }, - }, - }, - compressionType: compression.TypeGzip, - bypassThrottling: true, - bytesSaved: true, - }, { desc: "peer_list message with zstd compression", op: PeerListOp, @@ -291,22 +252,6 @@ func TestMessage(t *testing.T) { bypassThrottling: true, bytesSaved: false, }, - { - desc: "state_summary_frontier message with gzip compression", - op: StateSummaryFrontierOp, - msg: &p2p.Message{ - Message: &p2p.Message_StateSummaryFrontier_{ - StateSummaryFrontier_: &p2p.StateSummaryFrontier{ - ChainId: testID[:], - RequestId: 1, - Summary: compressibleContainers[0], - }, - }, - }, - compressionType: compression.TypeGzip, - bypassThrottling: true, - bytesSaved: true, - }, { desc: "state_summary_frontier message with zstd compression", op: StateSummaryFrontierOp, @@ -340,23 +285,6 @@ func TestMessage(t *testing.T) { bypassThrottling: true, bytesSaved: false, }, - { - desc: "get_accepted_state_summary message with gzip compression", - op: GetAcceptedStateSummaryOp, - msg: &p2p.Message{ - Message: &p2p.Message_GetAcceptedStateSummary{ - GetAcceptedStateSummary: &p2p.GetAcceptedStateSummary{ - ChainId: testID[:], - RequestId: 1, - Deadline: 1, - Heights: []uint64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - }, - }, - }, - compressionType: compression.TypeGzip, - bypassThrottling: true, - bytesSaved: false, - }, { desc: "get_accepted_state_summary message with zstd compression", op: GetAcceptedStateSummaryOp, @@ -390,22 +318,6 @@ func TestMessage(t *testing.T) { bypassThrottling: true, bytesSaved: false, }, - { - desc: "accepted_state_summary message with gzip compression", - op: AcceptedStateSummaryOp, - msg: &p2p.Message{ - Message: &p2p.Message_AcceptedStateSummary_{ - AcceptedStateSummary_: &p2p.AcceptedStateSummary{ - ChainId: testID[:], - RequestId: 1, - SummaryIds: [][]byte{testID[:], testID[:], testID[:], testID[:], testID[:], testID[:], testID[:], testID[:], testID[:]}, - }, - }, - }, - compressionType: compression.TypeGzip, - bypassThrottling: true, - bytesSaved: true, - }, { desc: "accepted_state_summary message with zstd compression", op: AcceptedStateSummaryOp, @@ -523,22 +435,6 @@ func TestMessage(t *testing.T) { bypassThrottling: true, bytesSaved: false, }, - { - desc: "ancestors message with gzip compression", - op: AncestorsOp, - msg: &p2p.Message{ - Message: &p2p.Message_Ancestors_{ - Ancestors_: &p2p.Ancestors{ - ChainId: testID[:], - RequestId: 12345, - Containers: compressibleContainers, - }, - }, - }, - compressionType: compression.TypeGzip, - bypassThrottling: true, - bytesSaved: true, - }, { desc: "ancestors message with zstd compression", op: AncestorsOp, @@ -590,23 +486,6 @@ func TestMessage(t *testing.T) { bypassThrottling: true, bytesSaved: false, }, - { - desc: "put message with gzip compression", - op: PutOp, - msg: &p2p.Message{ - Message: &p2p.Message_Put{ - Put: &p2p.Put{ - ChainId: testID[:], - RequestId: 1, - Container: compressibleContainers[0], - EngineType: p2p.EngineType_ENGINE_TYPE_AVALANCHE, - }, - }, - }, - compressionType: compression.TypeGzip, - bypassThrottling: true, - bytesSaved: true, - }, { desc: "put message with zstd compression", op: PutOp, @@ -642,24 +521,6 @@ func TestMessage(t *testing.T) { bypassThrottling: true, bytesSaved: false, }, - { - desc: "push_query message with gzip compression", - op: PushQueryOp, - msg: &p2p.Message{ - Message: &p2p.Message_PushQuery{ - PushQuery: &p2p.PushQuery{ - ChainId: testID[:], - RequestId: 1, - Deadline: 1, - Container: compressibleContainers[0], - EngineType: p2p.EngineType_ENGINE_TYPE_AVALANCHE, - }, - }, - }, - compressionType: compression.TypeGzip, - bypassThrottling: true, - bytesSaved: true, - }, { desc: "push_query message with zstd compression", op: PushQueryOp, @@ -729,23 +590,6 @@ func TestMessage(t *testing.T) { bypassThrottling: true, bytesSaved: false, }, - { - desc: "app_request message with gzip compression", - op: AppRequestOp, - msg: &p2p.Message{ - Message: &p2p.Message_AppRequest{ - AppRequest: &p2p.AppRequest{ - ChainId: testID[:], - RequestId: 1, - Deadline: 1, - AppBytes: compressibleContainers[0], - }, - }, - }, - compressionType: compression.TypeGzip, - bypassThrottling: true, - bytesSaved: true, - }, { desc: "app_request message with zstd compression", op: AppRequestOp, @@ -779,22 +623,6 @@ func TestMessage(t *testing.T) { bypassThrottling: true, bytesSaved: false, }, - { - desc: "app_response message with gzip compression", - op: AppResponseOp, - msg: &p2p.Message{ - Message: &p2p.Message_AppResponse{ - AppResponse: &p2p.AppResponse{ - ChainId: testID[:], - RequestId: 1, - AppBytes: compressibleContainers[0], - }, - }, - }, - compressionType: compression.TypeGzip, - bypassThrottling: true, - bytesSaved: true, - }, { desc: "app_response message with zstd compression", op: AppResponseOp, @@ -826,21 +654,6 @@ func TestMessage(t *testing.T) { bypassThrottling: true, bytesSaved: false, }, - { - desc: "app_gossip message with gzip compression", - op: AppGossipOp, - msg: &p2p.Message{ - Message: &p2p.Message_AppGossip{ - AppGossip: &p2p.AppGossip{ - ChainId: testID[:], - AppBytes: compressibleContainers[0], - }, - }, - }, - compressionType: compression.TypeGzip, - bypassThrottling: true, - bytesSaved: true, - }, { desc: "app_gossip message with zstd compression", op: AppGossipOp, diff --git a/message/outbound_msg_builder_test.go b/message/outbound_msg_builder_test.go index 1b6895f3f52c..39d22442b0a4 100644 --- a/message/outbound_msg_builder_test.go +++ b/message/outbound_msg_builder_test.go @@ -29,7 +29,6 @@ func Test_newOutboundBuilder(t *testing.T) { for _, compressionType := range []compression.Type{ compression.TypeNone, - compression.TypeGzip, compression.TypeZstd, } { t.Run(compressionType.String(), func(t *testing.T) { diff --git a/utils/compression/gzip_compressor.go b/utils/compression/gzip_compressor.go index 90067512a771..da0b941a47a1 100644 --- a/utils/compression/gzip_compressor.go +++ b/utils/compression/gzip_compressor.go @@ -21,6 +21,7 @@ var ( ErrMsgTooLarge = errors.New("msg too large to be compressed") ) +// TODO: Remove once v1.11.x is out. type gzipCompressor struct { maxSize int64 gzipWriterPool sync.Pool diff --git a/utils/compression/type.go b/utils/compression/type.go index 6af0cf75407d..09b4d64c33ea 100644 --- a/utils/compression/type.go +++ b/utils/compression/type.go @@ -14,7 +14,7 @@ type Type byte const ( TypeNone Type = iota + 1 - TypeGzip + TypeGzip // Remove once v1.11.x is out. TypeZstd ) From d3d1b114cebd2d675adb81720431707b467fa40f Mon Sep 17 00:00:00 2001 From: Dhruba Basu <7675102+dhrubabasu@users.noreply.github.com> Date: Thu, 18 Jan 2024 12:17:13 -0500 Subject: [PATCH 53/57] Always attempt to install mockgen `v0.4.0` before execution (#2628) --- scripts/mock.gen.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/scripts/mock.gen.sh b/scripts/mock.gen.sh index 75997d18b86e..16b00a42a569 100755 --- a/scripts/mock.gen.sh +++ b/scripts/mock.gen.sh @@ -7,12 +7,8 @@ if ! [[ "$0" =~ scripts/mock.gen.sh ]]; then exit 255 fi -if ! command -v mockgen &> /dev/null -then - echo "mockgen not found, installing..." - # https://github.com/uber-go/mock - go install -v go.uber.org/mock/mockgen@v0.4.0 -fi +# https://github.com/uber-go/mock +go install -v go.uber.org/mock/mockgen@v0.4.0 source ./scripts/constants.sh From f5884bb413ffa19987302df44cfe34f738d93fdf Mon Sep 17 00:00:00 2001 From: Stephen Buttolph Date: Thu, 18 Jan 2024 13:34:21 -0500 Subject: [PATCH 54/57] Modify TLS parsing rules for Durango (#2458) Signed-off-by: Stephen Buttolph Co-authored-by: Filippo Valsorda --- indexer/examples/p-chain/main.go | 3 +- indexer/examples/x-chain-blocks/main.go | 3 +- network/network.go | 10 +- network/peer/peer.go | 18 ++- network/peer/test_peer.go | 1 + network/peer/upgrader.go | 36 ++--- staking/asn1.go | 28 +++- staking/certificate.go | 10 +- staking/large_rsa_key.sig | Bin 2048 -> 0 bytes staking/parse.go | 172 +++++++++++++++++++++++- staking/parse_test.go | 89 ++++++++++++ staking/verify.go | 39 ++---- staking/verify_test.go | 30 ----- vms/proposervm/batched_vm.go | 2 +- vms/proposervm/block/block.go | 15 ++- vms/proposervm/block/build.go | 9 +- vms/proposervm/block/option.go | 4 +- vms/proposervm/block/parse.go | 9 +- vms/proposervm/block/parse_test.go | 56 +++++--- vms/proposervm/state/block_state.go | 7 +- vms/proposervm/vm.go | 2 +- 21 files changed, 422 insertions(+), 121 deletions(-) delete mode 100644 staking/large_rsa_key.sig create mode 100644 staking/parse_test.go delete mode 100644 staking/verify_test.go diff --git a/indexer/examples/p-chain/main.go b/indexer/examples/p-chain/main.go index 9f8966d21546..80f0e1aeed8e 100644 --- a/indexer/examples/p-chain/main.go +++ b/indexer/examples/p-chain/main.go @@ -10,6 +10,7 @@ import ( "time" "github.com/ava-labs/avalanchego/indexer" + "github.com/ava-labs/avalanchego/version" "github.com/ava-labs/avalanchego/wallet/subnet/primary" platformvmblock "github.com/ava-labs/avalanchego/vms/platformvm/block" @@ -34,7 +35,7 @@ func main() { } platformvmBlockBytes := container.Bytes - proposerVMBlock, err := proposervmblock.Parse(container.Bytes) + proposerVMBlock, err := proposervmblock.Parse(container.Bytes, version.DefaultUpgradeTime) if err == nil { platformvmBlockBytes = proposerVMBlock.Block() } diff --git a/indexer/examples/x-chain-blocks/main.go b/indexer/examples/x-chain-blocks/main.go index 92c5f7ad34e7..e25693b62998 100644 --- a/indexer/examples/x-chain-blocks/main.go +++ b/indexer/examples/x-chain-blocks/main.go @@ -10,6 +10,7 @@ import ( "time" "github.com/ava-labs/avalanchego/indexer" + "github.com/ava-labs/avalanchego/version" "github.com/ava-labs/avalanchego/vms/proposervm/block" "github.com/ava-labs/avalanchego/wallet/chain/x" "github.com/ava-labs/avalanchego/wallet/subnet/primary" @@ -32,7 +33,7 @@ func main() { continue } - proposerVMBlock, err := block.Parse(container.Bytes) + proposerVMBlock, err := block.Parse(container.Bytes, version.DefaultUpgradeTime) if err != nil { log.Fatalf("failed to parse proposervm block: %s\n", err) } diff --git a/network/network.go b/network/network.go index 51c2d223829e..1e13ed45b9c2 100644 --- a/network/network.go +++ b/network/network.go @@ -273,6 +273,12 @@ func NewNetwork( IPSigner: peer.NewIPSigner(config.MyIPPort, config.TLSKey), } + // Invariant: We delay the activation of durango during the TLS handshake to + // avoid gossiping any TLS certs that anyone else in the network may + // consider invalid. Recall that if a peer gossips an invalid cert, the + // connection is terminated. + durangoTime := version.GetDurangoTime(config.NetworkID) + durangoTimeWithClockSkew := durangoTime.Add(config.MaxClockDifference) onCloseCtx, cancel := context.WithCancel(context.Background()) n := &network{ config: config, @@ -283,8 +289,8 @@ func NewNetwork( inboundConnUpgradeThrottler: throttling.NewInboundConnUpgradeThrottler(log, config.ThrottlerConfig.InboundConnUpgradeThrottlerConfig), listener: listener, dialer: dialer, - serverUpgrader: peer.NewTLSServerUpgrader(config.TLSConfig, metrics.tlsConnRejected), - clientUpgrader: peer.NewTLSClientUpgrader(config.TLSConfig, metrics.tlsConnRejected), + serverUpgrader: peer.NewTLSServerUpgrader(config.TLSConfig, metrics.tlsConnRejected, durangoTimeWithClockSkew), + clientUpgrader: peer.NewTLSClientUpgrader(config.TLSConfig, metrics.tlsConnRejected, durangoTimeWithClockSkew), onCloseCtx: onCloseCtx, onCloseCtxCancel: cancel, diff --git a/network/peer/peer.go b/network/peer/peer.go index db2cb5485b04..403bea5220ba 100644 --- a/network/peer/peer.go +++ b/network/peer/peer.go @@ -1194,10 +1194,22 @@ func (p *peer) handlePeerList(msg *p2p.PeerList) { close(p.onFinishHandshake) } - // the peers this peer told us about - discoveredIPs := make([]*ips.ClaimedIPPort, len(msg.ClaimedIpPorts)) + // Invariant: We do not account for clock skew here, as the sender of the + // certificate is expected to account for clock skew during the activation + // of Durango. + durangoTime := version.GetDurangoTime(p.NetworkID) + beforeDurango := time.Now().Before(durangoTime) + discoveredIPs := make([]*ips.ClaimedIPPort, len(msg.ClaimedIpPorts)) // the peers this peer told us about for i, claimedIPPort := range msg.ClaimedIpPorts { - tlsCert, err := staking.ParseCertificate(claimedIPPort.X509Certificate) + var ( + tlsCert *staking.Certificate + err error + ) + if beforeDurango { + tlsCert, err = staking.ParseCertificate(claimedIPPort.X509Certificate) + } else { + tlsCert, err = staking.ParseCertificatePermissive(claimedIPPort.X509Certificate) + } if err != nil { p.Log.Debug("message with invalid field", zap.Stringer("nodeID", p.id), diff --git a/network/peer/test_peer.go b/network/peer/test_peer.go index 7bd58344ab86..04cfd93aaa7a 100644 --- a/network/peer/test_peer.go +++ b/network/peer/test_peer.go @@ -65,6 +65,7 @@ func StartTestPeer( clientUpgrader := NewTLSClientUpgrader( tlsConfg, prometheus.NewCounter(prometheus.CounterOpts{}), + version.GetDurangoTime(networkID), ) peerID, conn, cert, err := clientUpgrader.Upgrade(conn) diff --git a/network/peer/upgrader.go b/network/peer/upgrader.go index dd973af1b825..9341922175cd 100644 --- a/network/peer/upgrader.go +++ b/network/peer/upgrader.go @@ -7,6 +7,7 @@ import ( "crypto/tls" "errors" "net" + "time" "github.com/prometheus/client_golang/prometheus" @@ -29,36 +30,40 @@ type Upgrader interface { type tlsServerUpgrader struct { config *tls.Config invalidCerts prometheus.Counter + durangoTime time.Time } -func NewTLSServerUpgrader(config *tls.Config, invalidCerts prometheus.Counter) Upgrader { +func NewTLSServerUpgrader(config *tls.Config, invalidCerts prometheus.Counter, durangoTime time.Time) Upgrader { return &tlsServerUpgrader{ config: config, invalidCerts: invalidCerts, + durangoTime: durangoTime, } } func (t *tlsServerUpgrader) Upgrade(conn net.Conn) (ids.NodeID, net.Conn, *staking.Certificate, error) { - return connToIDAndCert(tls.Server(conn, t.config), t.invalidCerts) + return connToIDAndCert(tls.Server(conn, t.config), t.invalidCerts, t.durangoTime) } type tlsClientUpgrader struct { config *tls.Config invalidCerts prometheus.Counter + durangoTime time.Time } -func NewTLSClientUpgrader(config *tls.Config, invalidCerts prometheus.Counter) Upgrader { +func NewTLSClientUpgrader(config *tls.Config, invalidCerts prometheus.Counter, durangoTime time.Time) Upgrader { return &tlsClientUpgrader{ config: config, invalidCerts: invalidCerts, + durangoTime: durangoTime, } } func (t *tlsClientUpgrader) Upgrade(conn net.Conn) (ids.NodeID, net.Conn, *staking.Certificate, error) { - return connToIDAndCert(tls.Client(conn, t.config), t.invalidCerts) + return connToIDAndCert(tls.Client(conn, t.config), t.invalidCerts, t.durangoTime) } -func connToIDAndCert(conn *tls.Conn, invalidCerts prometheus.Counter) (ids.NodeID, net.Conn, *staking.Certificate, error) { +func connToIDAndCert(conn *tls.Conn, invalidCerts prometheus.Counter, durangoTime time.Time) (ids.NodeID, net.Conn, *staking.Certificate, error) { if err := conn.Handshake(); err != nil { return ids.EmptyNodeID, nil, nil, err } @@ -72,17 +77,18 @@ func connToIDAndCert(conn *tls.Conn, invalidCerts prometheus.Counter) (ids.NodeI // Invariant: ParseCertificate is used rather than CertificateFromX509 to // ensure that signature verification can assume the certificate was // parseable according the staking package's parser. - peerCert, err := staking.ParseCertificate(tlsCert.Raw) - if err != nil { - invalidCerts.Inc() - return ids.EmptyNodeID, nil, nil, err + // + // TODO: Remove pre-Durango parsing after v1.11.x has activated. + var ( + peerCert *staking.Certificate + err error + ) + if time.Now().Before(durangoTime) { + peerCert, err = staking.ParseCertificate(tlsCert.Raw) + } else { + peerCert, err = staking.ParseCertificatePermissive(tlsCert.Raw) } - - // We validate the certificate here to attempt to make the validity of the - // peer certificate as clear as possible. Specifically, a node running a - // prior version using an invalid certificate should not be able to report - // healthy. - if err := staking.ValidateCertificate(peerCert); err != nil { + if err != nil { invalidCerts.Inc() return ids.EmptyNodeID, nil, nil, err } diff --git a/staking/asn1.go b/staking/asn1.go index a21ebc7ff88c..afd817a95cd6 100644 --- a/staking/asn1.go +++ b/staking/asn1.go @@ -6,6 +6,7 @@ package staking import ( "crypto" "crypto/x509" + "encoding/asn1" "fmt" // Explicitly import for the crypto.RegisterHash init side-effects. @@ -14,11 +15,28 @@ import ( _ "crypto/sha256" ) -// Ref: https://github.com/golang/go/blob/go1.19.12/src/crypto/x509/x509.go#L326-L350 -var signatureAlgorithmVerificationDetails = map[x509.SignatureAlgorithm]x509.PublicKeyAlgorithm{ - x509.SHA256WithRSA: x509.RSA, - x509.ECDSAWithSHA256: x509.ECDSA, -} +var ( + // Ref: https://github.com/golang/go/blob/go1.19.12/src/crypto/x509/x509.go#L433-L452 + // + // RFC 3279, 2.3 Public Key Algorithms + // + // pkcs-1 OBJECT IDENTIFIER ::== { iso(1) member-body(2) us(840) + // rsadsi(113549) pkcs(1) 1 } + // + // rsaEncryption OBJECT IDENTIFIER ::== { pkcs1-1 1 } + oidPublicKeyRSA = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 1} + // RFC 5480, 2.1.1 Unrestricted Algorithm Identifier and Parameters + // + // id-ecPublicKey OBJECT IDENTIFIER ::= { + // iso(1) member-body(2) us(840) ansi-X9-62(10045) keyType(2) 1 } + oidPublicKeyECDSA = asn1.ObjectIdentifier{1, 2, 840, 10045, 2, 1} + + // Ref: https://github.com/golang/go/blob/go1.19.12/src/crypto/x509/x509.go#L326-L350 + signatureAlgorithmVerificationDetails = map[x509.SignatureAlgorithm]x509.PublicKeyAlgorithm{ + x509.SHA256WithRSA: x509.RSA, + x509.ECDSAWithSHA256: x509.ECDSA, + } +) func init() { if !crypto.SHA256.Available() { diff --git a/staking/certificate.go b/staking/certificate.go index 53d86a748b97..b3e1a511f63f 100644 --- a/staking/certificate.go +++ b/staking/certificate.go @@ -3,11 +3,15 @@ package staking -import "crypto/x509" +import ( + "crypto" + "crypto/x509" +) type Certificate struct { - Raw []byte - PublicKey any + Raw []byte + PublicKey crypto.PublicKey + // TODO: Remove after v1.11.x activates. SignatureAlgorithm x509.SignatureAlgorithm } diff --git a/staking/large_rsa_key.sig b/staking/large_rsa_key.sig deleted file mode 100644 index 61000a9903cfd642fa3130da4f85881ebfb8f43e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2048 zcmV+b2>kPMVuz>0LLX_JB4Rxwmf~~%Xw^SRfM5v=gT;&2{tAvS z&O$y_2aS0G99O-y1k5Oec>Hu<7Hr$#jb;mzA1H*Tf4k27Ev;(6qmT-SH(^6Q_Rk6z za}FHoL|idFRi1%V;NVb3Pw&?fyV8L= zpJT}YinNNgD5NY-jR|!}ppH2C+koCkaRDk}84mQlqWbEedTv@Udl~=c3rtg3QBipd zO;?M=oD2#x+u!QAbN_SPi3ZyBmKVkuJHig+Sn$gL%tvK&GLu`LlK(Lsis@}aQotXM zJFI6KjfN~!1-w8xW~|rYd*Xw5 zOQ<6&uxML+s!3(bhh%zz5>21CjDNc#=Wo0?{2e|Hx=2&ukrrW1EinylkOg&Q(8N4W zNNgD9PRI+aEtCqBvS2>5B6=UOdEc7BQ!X50UN4N;V2XHg-$}Z;9CqrB~`69czr#EWp_Rr+)}^Z zOT-#SO|l<-5PA5xXnr0-7i*pWW_!l$I6W#`Q1u_)C-vh*Gq6?OnUW=6+4Sdg!0m1p zO0HNtA;#%ar=DojUB$IyFh zrAw;&iB=z>{af@Z91`)tR>MbeQ)y^00_l{y4|kga2`Bwb;5WcZfJ{BvU!J+zXIRrz znLfmeoQ+t+-$=t9v!hZlI2Q{{spvAv^Aq|oW7#omms1(2P$m^_RPkm+Mt1E=7DOk2 zEb$Yzw6k5Su6%piX!4bfEwdI3N zC9)q2)-y&+X#sA0FnmkNB0oJK^_0SeKmeDpq)^xJgx+t8=T*R+FY-jL$KJeme z3}71OA6zNg*&_`IMpZ&8-kZ25k-o$6q_n@J@spb~ndhKwAf$W)&vJUA&W_fENvMDE z29}#=&0WV z2Z|Uh0804pu1`6n?POSXz?11Wwmhe9XKl8^ZUZ@j^9@)fo5+x~L$+884XR#C_rwZ2Gt{fQaD%fjffSd=gCrrn^eOsJ5gyGUruECTQB^=-NC z6L_kjWzC=4Og%E!&qy6_tE5W3o)LQd^)8*xs#0|6Axrjgdr@`h53JLtete6HgXedgfeNn^pEmpQmj%aWDM-(9HVO-O!vX|nY;E-?GJ_z zjyI_@2>FR-Fq~+4?>jB0LWc#vBREpe`6lF|j@E`s1!KI!MO> zwJhKbDjyXke`W(QSn7fUYB1+nEzI${6V@!+>q%^+>0>cT{z+2}=XLmnG+IJc z)|QdFLS+EHJ6aPWVcHd#$O(tD_agBWyO@()+RA83UfBv`rR@=fk;tw@2fcGCq(PUb zAQE__HZY{qUY)-JR8i|~nmL6AU0r%sg5B8CSVTvH_djo`?-%2lOqzZdraAWkBCHJw~;aftx{U6XvSYt1J7r%)if*DY7KNOnzkHw4v*$<0>}NpL4k zE{hUQVd=u9V41E9g(IKQIoycing7Jwiv6^MbKFb3$o0$yMuKc_OWAIXUdgF>-KNo| zULv0~ufVqWpRYe?{OSG969^}SAxiSe1dEtakosm;HM8L+>DDqkxOf#zW0EV$5ErJQ za&IPh-{VBqh6@iKN%0}LFlfpsFswL|HjC)~irI)~A6XpCq^2rZz}EByGCir^JRWhL zp>IJoXw4`PZa$iEds?lDuEC@Zc0+lnhlFT>2q4(c?B%2F12a0)0FuNNSBcKcae5zjO%6nkiYI|L0=Y1j-^{G)NdIeBu|MWA+Rg)7Ef& zwWza$ZE`(uO{e4FmFvA652$jt~!iDqGxkW$v8C*27U$419&Ufyx=Fx?; z3)rUcLQpTw&9@if5fbkgc$Y1GI)h=3&b7hhTFv&fl0U-4IhZb#78{iDrA(U`kGhc5 eShhHiq3tib1FXJZIB*UCvmaBS&ZT&-Cn|XI>E;#y diff --git a/staking/parse.go b/staking/parse.go index 6de6b63dd4dd..fd21c3cbe38e 100644 --- a/staking/parse.go +++ b/staking/parse.go @@ -3,13 +3,179 @@ package staking -import "crypto/x509" +import ( + "crypto" + "crypto/ecdsa" + "crypto/elliptic" + "crypto/rsa" + "crypto/x509" + "encoding/asn1" + "errors" + "fmt" + "math/big" + + "golang.org/x/crypto/cryptobyte" + + cryptobyte_asn1 "golang.org/x/crypto/cryptobyte/asn1" + + "github.com/ava-labs/avalanchego/utils/units" +) + +const ( + MaxCertificateLen = 2 * units.KiB + + allowedRSASmallModulusLen = 2048 + allowedRSALargeModulusLen = 4096 + allowedRSAPublicExponentValue = 65537 +) + +var ( + ErrCertificateTooLarge = fmt.Errorf("staking: certificate length is greater than %d", MaxCertificateLen) + ErrMalformedCertificate = errors.New("staking: malformed certificate") + ErrMalformedTBSCertificate = errors.New("staking: malformed tbs certificate") + ErrMalformedVersion = errors.New("staking: malformed version") + ErrMalformedSerialNumber = errors.New("staking: malformed serial number") + ErrMalformedSignatureAlgorithmIdentifier = errors.New("staking: malformed signature algorithm identifier") + ErrMalformedIssuer = errors.New("staking: malformed issuer") + ErrMalformedValidity = errors.New("staking: malformed validity") + ErrMalformedSPKI = errors.New("staking: malformed spki") + ErrMalformedPublicKeyAlgorithmIdentifier = errors.New("staking: malformed public key algorithm identifier") + ErrMalformedSubjectPublicKey = errors.New("staking: malformed subject public key") + ErrMalformedOID = errors.New("staking: malformed oid") + ErrInvalidRSAPublicKey = errors.New("staking: invalid RSA public key") + ErrInvalidRSAModulus = errors.New("staking: invalid RSA modulus") + ErrInvalidRSAPublicExponent = errors.New("staking: invalid RSA public exponent") + ErrRSAModulusNotPositive = errors.New("staking: RSA modulus is not a positive number") + ErrUnsupportedRSAModulusBitLen = errors.New("staking: unsupported RSA modulus bitlen") + ErrRSAModulusIsEven = errors.New("staking: RSA modulus is an even number") + ErrUnsupportedRSAPublicExponent = errors.New("staking: unsupported RSA public exponent") + ErrFailedUnmarshallingEllipticCurvePoint = errors.New("staking: failed to unmarshal elliptic curve point") + ErrUnknownPublicKeyAlgorithm = errors.New("staking: unknown public key algorithm") +) // ParseCertificate parses a single certificate from the given ASN.1 DER data. +// +// TODO: Remove after v1.11.x activates. func ParseCertificate(der []byte) (*Certificate, error) { - cert, err := x509.ParseCertificate(der) + x509Cert, err := x509.ParseCertificate(der) if err != nil { return nil, err } - return CertificateFromX509(cert), nil + stakingCert := CertificateFromX509(x509Cert) + return stakingCert, ValidateCertificate(stakingCert) +} + +// ParseCertificatePermissive parses a single certificate from the given ASN.1. +// +// This function does not validate that the certificate is valid to be used +// against normal TLS implementations. +// +// Ref: https://github.com/golang/go/blob/go1.19.12/src/crypto/x509/parser.go#L789-L968 +func ParseCertificatePermissive(bytes []byte) (*Certificate, error) { + if len(bytes) > MaxCertificateLen { + return nil, ErrCertificateTooLarge + } + + input := cryptobyte.String(bytes) + // Consume the length and tag bytes. + if !input.ReadASN1(&input, cryptobyte_asn1.SEQUENCE) { + return nil, ErrMalformedCertificate + } + + // Read the "to be signed" certificate into input. + if !input.ReadASN1(&input, cryptobyte_asn1.SEQUENCE) { + return nil, ErrMalformedTBSCertificate + } + if !input.SkipOptionalASN1(cryptobyte_asn1.Tag(0).Constructed().ContextSpecific()) { + return nil, ErrMalformedVersion + } + if !input.SkipASN1(cryptobyte_asn1.INTEGER) { + return nil, ErrMalformedSerialNumber + } + if !input.SkipASN1(cryptobyte_asn1.SEQUENCE) { + return nil, ErrMalformedSignatureAlgorithmIdentifier + } + if !input.SkipASN1(cryptobyte_asn1.SEQUENCE) { + return nil, ErrMalformedIssuer + } + if !input.SkipASN1(cryptobyte_asn1.SEQUENCE) { + return nil, ErrMalformedValidity + } + if !input.SkipASN1(cryptobyte_asn1.SEQUENCE) { + return nil, ErrMalformedIssuer + } + + // Read the "subject public key info" into input. + if !input.ReadASN1(&input, cryptobyte_asn1.SEQUENCE) { + return nil, ErrMalformedSPKI + } + + // Read the public key algorithm identifier. + var pkAISeq cryptobyte.String + if !input.ReadASN1(&pkAISeq, cryptobyte_asn1.SEQUENCE) { + return nil, ErrMalformedPublicKeyAlgorithmIdentifier + } + var pkAI asn1.ObjectIdentifier + if !pkAISeq.ReadASN1ObjectIdentifier(&pkAI) { + return nil, ErrMalformedOID + } + + // Note: Unlike the x509 package, we require parsing the public key. + + var spk asn1.BitString + if !input.ReadASN1BitString(&spk) { + return nil, ErrMalformedSubjectPublicKey + } + publicKey, signatureAlgorithm, err := parsePublicKey(pkAI, spk) + return &Certificate{ + Raw: bytes, + SignatureAlgorithm: signatureAlgorithm, + PublicKey: publicKey, + }, err +} + +// Ref: https://github.com/golang/go/blob/go1.19.12/src/crypto/x509/parser.go#L215-L306 +func parsePublicKey(oid asn1.ObjectIdentifier, publicKey asn1.BitString) (crypto.PublicKey, x509.SignatureAlgorithm, error) { + der := cryptobyte.String(publicKey.RightAlign()) + switch { + case oid.Equal(oidPublicKeyRSA): + pub := &rsa.PublicKey{N: new(big.Int)} + if !der.ReadASN1(&der, cryptobyte_asn1.SEQUENCE) { + return nil, 0, ErrInvalidRSAPublicKey + } + if !der.ReadASN1Integer(pub.N) { + return nil, 0, ErrInvalidRSAModulus + } + if !der.ReadASN1Integer(&pub.E) { + return nil, 0, ErrInvalidRSAPublicExponent + } + + if pub.N.Sign() <= 0 { + return nil, 0, ErrRSAModulusNotPositive + } + + if bitLen := pub.N.BitLen(); bitLen != allowedRSALargeModulusLen && bitLen != allowedRSASmallModulusLen { + return nil, 0, fmt.Errorf("%w: %d", ErrUnsupportedRSAModulusBitLen, bitLen) + } + if pub.N.Bit(0) == 0 { + return nil, 0, ErrRSAModulusIsEven + } + if pub.E != allowedRSAPublicExponentValue { + return nil, 0, fmt.Errorf("%w: %d", ErrUnsupportedRSAPublicExponent, pub.E) + } + return pub, x509.SHA256WithRSA, nil + case oid.Equal(oidPublicKeyECDSA): + namedCurve := elliptic.P256() + x, y := elliptic.Unmarshal(namedCurve, der) + if x == nil { + return nil, 0, ErrFailedUnmarshallingEllipticCurvePoint + } + return &ecdsa.PublicKey{ + Curve: namedCurve, + X: x, + Y: y, + }, x509.ECDSAWithSHA256, nil + default: + return nil, 0, ErrUnknownPublicKeyAlgorithm + } } diff --git a/staking/parse_test.go b/staking/parse_test.go new file mode 100644 index 000000000000..e9006e4ddcc0 --- /dev/null +++ b/staking/parse_test.go @@ -0,0 +1,89 @@ +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +package staking + +import ( + "testing" + + _ "embed" + + "github.com/stretchr/testify/require" +) + +var ( + //go:embed large_rsa_key.cert + largeRSAKeyCert []byte + + parsers = []struct { + name string + parse func([]byte) (*Certificate, error) + }{ + { + name: "ParseCertificate", + parse: ParseCertificate, + }, + { + name: "ParseCertificatePermissive", + parse: ParseCertificatePermissive, + }, + } +) + +func TestParseCheckLargeCert(t *testing.T) { + for _, parser := range parsers { + t.Run(parser.name, func(t *testing.T) { + _, err := parser.parse(largeRSAKeyCert) + require.ErrorIs(t, err, ErrCertificateTooLarge) + }) + } +} + +func BenchmarkParse(b *testing.B) { + tlsCert, err := NewTLSCert() + require.NoError(b, err) + + bytes := tlsCert.Leaf.Raw + for _, parser := range parsers { + b.Run(parser.name, func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, err = parser.parse(bytes) + require.NoError(b, err) + } + }) + } +} + +func FuzzParseCertificate(f *testing.F) { + tlsCert, err := NewTLSCert() + require.NoError(f, err) + + f.Add(tlsCert.Leaf.Raw) + f.Add(largeRSAKeyCert) + f.Fuzz(func(t *testing.T, certBytes []byte) { + require := require.New(t) + + // Verify that any certificate that can be parsed by ParseCertificate + // can also be parsed by ParseCertificatePermissive. + { + strictCert, err := ParseCertificate(certBytes) + if err == nil { + permissiveCert, err := ParseCertificatePermissive(certBytes) + require.NoError(err) + require.Equal(strictCert, permissiveCert) + } + } + + // Verify that any certificate that can't be parsed by + // ParseCertificatePermissive also can't be parsed by ParseCertificate. + { + cert, err := ParseCertificatePermissive(certBytes) + if err == nil { + require.NoError(ValidateCertificate(cert)) + } else { + _, err = ParseCertificate(certBytes) + require.Error(err) //nolint:forbidigo + } + } + }) +} diff --git a/staking/verify.go b/staking/verify.go index 5fc8d77278e1..dd4255455ff0 100644 --- a/staking/verify.go +++ b/staking/verify.go @@ -11,28 +11,13 @@ import ( "crypto/x509" "errors" "fmt" - - "github.com/ava-labs/avalanchego/utils/units" -) - -// MaxRSAKeyBitLen is the maximum RSA key size in bits that we are willing to -// parse. -// -// https://github.com/golang/go/blob/go1.19.12/src/crypto/tls/handshake_client.go#L860-L862 -const ( - MaxCertificateLen = 16 * units.KiB - MaxRSAKeyByteLen = units.KiB - MaxRSAKeyBitLen = 8 * MaxRSAKeyByteLen ) var ( - ErrCertificateTooLarge = fmt.Errorf("staking: certificate length is greater than %d", MaxCertificateLen) - ErrUnsupportedAlgorithm = errors.New("staking: cannot verify signature: unsupported algorithm") - ErrPublicKeyAlgoMismatch = errors.New("staking: signature algorithm specified different public key type") - ErrInvalidRSAPublicKey = errors.New("staking: invalid RSA public key") - ErrInvalidECDSAPublicKey = errors.New("staking: invalid ECDSA public key") - ErrECDSAVerificationFailure = errors.New("staking: ECDSA verification failure") - ErrED25519VerificationFailure = errors.New("staking: Ed25519 verification failure") + ErrUnsupportedAlgorithm = errors.New("staking: cannot verify signature: unsupported algorithm") + ErrPublicKeyAlgoMismatch = errors.New("staking: signature algorithm specified different public key type") + ErrInvalidECDSAPublicKey = errors.New("staking: invalid ECDSA public key") + ErrECDSAVerificationFailure = errors.New("staking: ECDSA verification failure") ) // CheckSignature verifies that the signature is a valid signature over signed @@ -41,10 +26,6 @@ var ( // Ref: https://github.com/golang/go/blob/go1.19.12/src/crypto/x509/x509.go#L793-L797 // Ref: https://github.com/golang/go/blob/go1.19.12/src/crypto/x509/x509.go#L816-L879 func CheckSignature(cert *Certificate, msg []byte, signature []byte) error { - if err := ValidateCertificate(cert); err != nil { - return err - } - hasher := crypto.SHA256.New() _, err := hasher.Write(msg) if err != nil { @@ -67,6 +48,8 @@ func CheckSignature(cert *Certificate, msg []byte, signature []byte) error { // ValidateCertificate verifies that this certificate conforms to the required // staking format assuming that it was already able to be parsed. +// +// TODO: Remove after v1.11.x activates. func ValidateCertificate(cert *Certificate) error { if len(cert.Raw) > MaxCertificateLen { return ErrCertificateTooLarge @@ -82,8 +65,14 @@ func ValidateCertificate(cert *Certificate) error { if pubkeyAlgo != x509.RSA { return signaturePublicKeyAlgoMismatchError(pubkeyAlgo, pub) } - if bitLen := pub.N.BitLen(); bitLen > MaxRSAKeyBitLen { - return fmt.Errorf("%w: bitLen=%d > maxBitLen=%d", ErrInvalidRSAPublicKey, bitLen, MaxRSAKeyBitLen) + if bitLen := pub.N.BitLen(); bitLen != allowedRSALargeModulusLen && bitLen != allowedRSASmallModulusLen { + return fmt.Errorf("%w: %d", ErrUnsupportedRSAModulusBitLen, bitLen) + } + if pub.N.Bit(0) == 0 { + return ErrRSAModulusIsEven + } + if pub.E != allowedRSAPublicExponentValue { + return fmt.Errorf("%w: %d", ErrUnsupportedRSAPublicExponent, pub.E) } return nil case *ecdsa.PublicKey: diff --git a/staking/verify_test.go b/staking/verify_test.go deleted file mode 100644 index 7fcf0ba8d624..000000000000 --- a/staking/verify_test.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - -package staking - -import ( - "testing" - - _ "embed" - - "github.com/stretchr/testify/require" -) - -var ( - //go:embed large_rsa_key.cert - largeRSAKeyCert []byte - //go:embed large_rsa_key.sig - largeRSAKeySig []byte -) - -func TestCheckSignatureLargePublicKey(t *testing.T) { - require := require.New(t) - - cert, err := ParseCertificate(largeRSAKeyCert) - require.NoError(err) - - msg := []byte("TODO: put something clever") - err = CheckSignature(cert, msg, largeRSAKeySig) - require.ErrorIs(err, ErrInvalidRSAPublicKey) -} diff --git a/vms/proposervm/batched_vm.go b/vms/proposervm/batched_vm.go index ff1ce6a597a0..0bf514827193 100644 --- a/vms/proposervm/batched_vm.go +++ b/vms/proposervm/batched_vm.go @@ -101,7 +101,7 @@ func (vm *VM) BatchedParseBlock(ctx context.Context, blks [][]byte) ([]snowman.B ) for ; blocksIndex < len(blks); blocksIndex++ { blkBytes := blks[blocksIndex] - statelessBlock, err := statelessblock.Parse(blkBytes) + statelessBlock, err := statelessblock.Parse(blkBytes, vm.DurangoTime) if err != nil { break } diff --git a/vms/proposervm/block/block.go b/vms/proposervm/block/block.go index fccbbe2e3718..0f5b374391f7 100644 --- a/vms/proposervm/block/block.go +++ b/vms/proposervm/block/block.go @@ -28,7 +28,7 @@ type Block interface { Block() []byte Bytes() []byte - initialize(bytes []byte) error + initialize(bytes []byte, durangoTime time.Time) error } type SignedBlock interface { @@ -76,7 +76,7 @@ func (b *statelessBlock) Bytes() []byte { return b.bytes } -func (b *statelessBlock) initialize(bytes []byte) error { +func (b *statelessBlock) initialize(bytes []byte, durangoTime time.Time) error { b.bytes = bytes // The serialized form of the block is the unsignedBytes followed by the @@ -91,13 +91,18 @@ func (b *statelessBlock) initialize(bytes []byte) error { return nil } - cert, err := staking.ParseCertificate(b.StatelessBlock.Certificate) + // TODO: Remove durangoTime after v1.11.x has activated. + var err error + if b.timestamp.Before(durangoTime) { + b.cert, err = staking.ParseCertificate(b.StatelessBlock.Certificate) + } else { + b.cert, err = staking.ParseCertificatePermissive(b.StatelessBlock.Certificate) + } if err != nil { return fmt.Errorf("%w: %w", errInvalidCertificate, err) } - b.cert = cert - b.proposer = ids.NodeIDFromCert(cert) + b.proposer = ids.NodeIDFromCert(b.cert) return nil } diff --git a/vms/proposervm/block/build.go b/vms/proposervm/block/build.go index 7baa89205342..b13255c91dd1 100644 --- a/vms/proposervm/block/build.go +++ b/vms/proposervm/block/build.go @@ -35,7 +35,10 @@ func BuildUnsigned( if err != nil { return nil, err } - return block, block.initialize(bytes) + + // Invariant: The durango timestamp isn't used here because the certificate + // is empty. + return block, block.initialize(bytes, time.Time{}) } func Build( @@ -121,5 +124,7 @@ func BuildOption( if err != nil { return nil, err } - return block, block.initialize(bytes) + + // Invariant: The durango timestamp isn't used. + return block, block.initialize(bytes, time.Time{}) } diff --git a/vms/proposervm/block/option.go b/vms/proposervm/block/option.go index c80651b621fc..7edb39bd429f 100644 --- a/vms/proposervm/block/option.go +++ b/vms/proposervm/block/option.go @@ -4,6 +4,8 @@ package block import ( + "time" + "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/utils/hashing" ) @@ -32,7 +34,7 @@ func (b *option) Bytes() []byte { return b.bytes } -func (b *option) initialize(bytes []byte) error { +func (b *option) initialize(bytes []byte, _ time.Time) error { b.id = hashing.ComputeHash256Array(bytes) b.bytes = bytes return nil diff --git a/vms/proposervm/block/parse.go b/vms/proposervm/block/parse.go index cf275134d888..bf9b44adf1f4 100644 --- a/vms/proposervm/block/parse.go +++ b/vms/proposervm/block/parse.go @@ -3,9 +3,12 @@ package block -import "fmt" +import ( + "fmt" + "time" +) -func Parse(bytes []byte) (Block, error) { +func Parse(bytes []byte, durangoTime time.Time) (Block, error) { var block Block parsedVersion, err := Codec.Unmarshal(bytes, &block) if err != nil { @@ -14,7 +17,7 @@ func Parse(bytes []byte) (Block, error) { if parsedVersion != CodecVersion { return nil, fmt.Errorf("expected codec version %d but got %d", CodecVersion, parsedVersion) } - return block, block.initialize(bytes) + return block, block.initialize(bytes, durangoTime) } func ParseHeader(bytes []byte) (Header, error) { diff --git a/vms/proposervm/block/parse_test.go b/vms/proposervm/block/parse_test.go index 1d04271c9fec..148bac82c0a6 100644 --- a/vms/proposervm/block/parse_test.go +++ b/vms/proposervm/block/parse_test.go @@ -43,14 +43,19 @@ func TestParse(t *testing.T) { require.NoError(err) builtBlockBytes := builtBlock.Bytes() - - parsedBlockIntf, err := Parse(builtBlockBytes) - require.NoError(err) - - parsedBlock, ok := parsedBlockIntf.(SignedBlock) - require.True(ok) - - equal(require, chainID, builtBlock, parsedBlock) + durangoTimes := []time.Time{ + timestamp.Add(time.Second), // Durango not activated yet + timestamp.Add(-time.Second), // Durango activated + } + for _, durangoTime := range durangoTimes { + parsedBlockIntf, err := Parse(builtBlockBytes, durangoTime) + require.NoError(err) + + parsedBlock, ok := parsedBlockIntf.(SignedBlock) + require.True(ok) + + equal(require, chainID, builtBlock, parsedBlock) + } } func TestParseDuplicateExtension(t *testing.T) { @@ -60,8 +65,16 @@ func TestParseDuplicateExtension(t *testing.T) { blockBytes, err := hex.DecodeString(blockHex) require.NoError(err) - _, err = Parse(blockBytes) + // Note: The above blockHex specifies 123 as the block's timestamp. + timestamp := time.Unix(123, 0) + durangoNotYetActivatedTime := timestamp.Add(time.Second) + durangoAlreadyActivatedTime := timestamp.Add(-time.Second) + + _, err = Parse(blockBytes, durangoNotYetActivatedTime) require.ErrorIs(err, errInvalidCertificate) + + _, err = Parse(blockBytes, durangoAlreadyActivatedTime) + require.NoError(err) } func TestParseHeader(t *testing.T) { @@ -97,7 +110,7 @@ func TestParseOption(t *testing.T) { builtOptionBytes := builtOption.Bytes() - parsedOption, err := Parse(builtOptionBytes) + parsedOption, err := Parse(builtOptionBytes, time.Time{}) require.NoError(err) equalOption(require, builtOption, parsedOption) @@ -115,14 +128,19 @@ func TestParseUnsigned(t *testing.T) { require.NoError(err) builtBlockBytes := builtBlock.Bytes() - - parsedBlockIntf, err := Parse(builtBlockBytes) - require.NoError(err) - - parsedBlock, ok := parsedBlockIntf.(SignedBlock) - require.True(ok) - - equal(require, ids.Empty, builtBlock, parsedBlock) + durangoTimes := []time.Time{ + timestamp.Add(time.Second), // Durango not activated yet + timestamp.Add(-time.Second), // Durango activated + } + for _, durangoTime := range durangoTimes { + parsedBlockIntf, err := Parse(builtBlockBytes, durangoTime) + require.NoError(err) + + parsedBlock, ok := parsedBlockIntf.(SignedBlock) + require.True(ok) + + equal(require, ids.Empty, builtBlock, parsedBlock) + } } func TestParseGibberish(t *testing.T) { @@ -130,6 +148,6 @@ func TestParseGibberish(t *testing.T) { bytes := []byte{0, 1, 2, 3, 4, 5} - _, err := Parse(bytes) + _, err := Parse(bytes, time.Time{}) require.ErrorIs(err, codec.ErrUnknownVersion) } diff --git a/vms/proposervm/state/block_state.go b/vms/proposervm/state/block_state.go index 88382f0abc67..862d492b925b 100644 --- a/vms/proposervm/state/block_state.go +++ b/vms/proposervm/state/block_state.go @@ -17,6 +17,7 @@ import ( "github.com/ava-labs/avalanchego/utils/constants" "github.com/ava-labs/avalanchego/utils/units" "github.com/ava-labs/avalanchego/utils/wrappers" + "github.com/ava-labs/avalanchego/version" "github.com/ava-labs/avalanchego/vms/proposervm/block" ) @@ -109,7 +110,11 @@ func (s *blockState) GetBlock(blkID ids.ID) (block.Block, choices.Status, error) } // The key was in the database - blk, err := block.Parse(blkWrapper.Block) + // + // Invariant: Blocks stored on disk were previously accepted by this node. + // Because the durango activation relaxes TLS cert parsing rules, we assume + // it is always activated here. + blk, err := block.Parse(blkWrapper.Block, version.DefaultUpgradeTime) if err != nil { return nil, choices.Unknown, err } diff --git a/vms/proposervm/vm.go b/vms/proposervm/vm.go index 99dc045be66d..9f77a658b55d 100644 --- a/vms/proposervm/vm.go +++ b/vms/proposervm/vm.go @@ -708,7 +708,7 @@ func (vm *VM) setLastAcceptedMetadata(ctx context.Context) error { } func (vm *VM) parsePostForkBlock(ctx context.Context, b []byte) (PostForkBlock, error) { - statelessBlock, err := statelessblock.Parse(b) + statelessBlock, err := statelessblock.Parse(b, vm.DurangoTime) if err != nil { return nil, err } From 20452c35e86e56dbdb3bf80e8aa6889c9a585b5e Mon Sep 17 00:00:00 2001 From: Stephen Buttolph Date: Thu, 18 Jan 2024 14:32:32 -0500 Subject: [PATCH 55/57] Update versions for v1.10.18 (#2548) --- RELEASES.md | 254 ++++++++++++++++++++++ network/p2p/network_test.go | 1 + network/peer/peer.go | 4 +- network/peer/validator_id.go | 14 -- utils/sorting_test.go | 9 +- version/compatibility.json | 3 + version/constants.go | 9 +- vms/avm/network/network.go | 3 +- vms/platformvm/block/executor/verifier.go | 6 +- vms/platformvm/vm.go | 3 + 10 files changed, 273 insertions(+), 33 deletions(-) delete mode 100644 network/peer/validator_id.go diff --git a/RELEASES.md b/RELEASES.md index 743df32d471d..24d42b4d6027 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,5 +1,259 @@ # Release Notes +## [v1.10.18](https://github.com/ava-labs/avalanchego/releases/tag/v1.10.18) + +This version is backwards compatible to [v1.10.0](https://github.com/ava-labs/avalanchego/releases/tag/v1.10.0). It is optional, but encouraged. + +The plugin version is updated to `31` all plugins must update to be compatible. + +### APIs + +- Added `info.acps` API +- Added `supportedACPs` and `objectedACPs` for each peer returned by `info.peers` +- Added `txs` field to `BanffProposalBlock`'s json format +- Added metrics: + - `avalanche_network_validator_ips` + - `avalanche_network_gossipable_ips` + - `avalanche_network_ip_bloom_count` + - `avalanche_network_ip_bloom_entries` + - `avalanche_network_ip_bloom_hashes` + - `avalanche_network_ip_bloom_max_count` + - `avalanche_network_ip_bloom_reset_count` +- Added metrics related to `get_peer_list` message handling +- Added p2p SDK metrics to the P-chain and X-chain +- Renamed metrics related to message handling: + - `version` -> `handshake` + - `appRequestFailed` -> `appError` + - `crossChainAppRequestFailed` -> `crossChainAppError` +- Removed `gzip` compression time metrics +- Converted p2p SDK metrics to use vectors rather than independent metrics +- Converted client name reported over the p2p network from `avalanche` to `avalanchego` + + +### Configs + +- Added: + - `--acp-support` + - `--acp-object` + - `snow-commit-threshold` + - `network-peer-list-pull-gossip-frequency` + - `network-peer-list-bloom-reset-frequency` + - `network` to the X-chain and P-chain configs including: + - `max-validator-set-staleness` + - `target-gossip-size` + - `pull-gossip-poll-size` + - `pull-gossip-frequency` + - `pull-gossip-throttling-period` + - `pull-gossip-throttling-limit` + - `expected-bloom-filter-elements` + - `expected-bloom-filter-false-positive-probability` + - `max-bloom-filter-false-positive-probability` + - `legacy-push-gossip-cache-size` +- Deprecated: + - `snow-virtuous-commit-threshold` + - `snow-rogue-commit-threshold` + - `network-peer-list-validator-gossip-size` + - `network-peer-list-non-validator-gossip-size` + - `network-peer-list-peers-gossip-size` + - `network-peer-list-gossip-frequency` +- Removed: + - `gzip` as an option for `network-compression-type` + +### Fixes + +- Fixed `platformvm.SetPreference` to correctly reset the block building timer +- Fixed early bootstrapping termination +- Fixed duplicated transaction initialization in the X-chain and P-chain +- Fixed IP gossip when using dynamically allocated staking ports +- Updated `golang.org/x/exp` dependency to fix downstream compilation errors +- Updated `golang.org/x/crypto` dependency to address `CVE-2023-48795` +- Updated minimum golang version to address `CVE-2023-39326` +- Restricted `GOPROXY` during compilation to avoid `direct` version control fallbacks +- Fixed `merkledb` deletion of the empty key +- Fixed `merkledb` race condition when interacting with invalidated or closed trie views +- Fixed `json.Marshal` for `wallet` transactions +- Fixed duplicate outbound dialer for manually tracked nodes in the p2p network + +### What's Changed + +- testing: Update to latest version of ginkgo by @marun in https://github.com/ava-labs/avalanchego/pull/2390 +- `vms/platformvm`: Cleanup block builder tests by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2406 +- Drop Pending Stakers 0 - De-duplicate staking tx verification by @abi87 in https://github.com/ava-labs/avalanchego/pull/2335 +- `vms/platformvm`: Initialize txs in `Transactions` field for `BanffProposalBlock` by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2419 +- `vms/platformvm`: Move `VerifyUniqueInputs` from `verifier` to `backend` by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2410 +- Fix duplicated bootstrapper engine termination by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2334 +- allow user of `build_fuzz.sh` to specify a directory to fuzz in by @danlaine in https://github.com/ava-labs/avalanchego/pull/2414 +- Update slices dependency to use Compare by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2424 +- `vms/platformvm`: Cleanup some block tests by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2422 +- ProposerVM Extend windows 0 - Cleanup by @abi87 in https://github.com/ava-labs/avalanchego/pull/2404 +- `vms/platformvm`: Add `decisionTxs` parameter to `NewBanffProposalBlock` by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2411 +- Update minimum golang version to v1.20.12 by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2427 +- Fix platformvm.SetPreference by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2429 +- Restrict GOPROXY by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2434 +- Drop Pending Stakers 1 - introduced ScheduledStaker txs by @abi87 in https://github.com/ava-labs/avalanchego/pull/2323 +- Run merkledb fuzz tests every 6 hours by @danlaine in https://github.com/ava-labs/avalanchego/pull/2415 +- Remove unused error by @joshua-kim in https://github.com/ava-labs/avalanchego/pull/2426 +- Make `messageQueue.msgAndCtxs` a circular buffer by @danlaine in https://github.com/ava-labs/avalanchego/pull/2433 +- ProposerVM Extend windows 1 - UTs Cleanup by @abi87 in https://github.com/ava-labs/avalanchego/pull/2412 +- Change seed from int64 to uint64 by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2438 +- Remove usage of timer.Timer in node by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2441 +- Remove staged timer again by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2440 +- `merkledb` / `sync` -- Disambiguate no end root from no start root by @danlaine in https://github.com/ava-labs/avalanchego/pull/2437 +- Drop Pending Stakers 2 - Replace txs.ScheduledStaker with txs.Staker by @abi87 in https://github.com/ava-labs/avalanchego/pull/2305 +- `vms/platformvm`: Remove double block building logic by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2380 +- Remove usage of timer.Timer in benchlist by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2446 +- `vms/avm`: Simplify `Peek` function in mempool by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2449 +- `vms/platformvm`: Remove `standardBlockState` struct by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2450 +- Refactor sampler seeding by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2456 +- Update tmpnet fixture to include Proof-of-Possession for initial stakers by @marun in https://github.com/ava-labs/avalanchego/pull/2391 +- `vms/platformvm`: Remove `EnableAdding` and `DisableAdding` from `Mempool` interface by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2463 +- `vms/avm`: Add `exists` bool to mempool `Peek` by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2465 +- `vms/platformvm`: Remove `PeekTxs` from `Mempool` interface by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2378 +- `vms/platformvm`: Add `processStandardTxs` helper by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2461 +- `vms/platformvm`: Process `atomicRequests` and `onAcceptFunc` in option blocks by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2459 +- `e2e`: Rename 'funded key' to 'pre-funded key' for consistency by @marun in https://github.com/ava-labs/avalanchego/pull/2455 +- `vms/platformvm`: Surface `VerifyUniqueInputs` in the `Manager` by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2467 +- `vms/platformvm`: Add `TestBuildBlockShouldReward` test by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2466 +- Switch client version to a proto type from a string by @joshua-kim in https://github.com/ava-labs/avalanchego/pull/2188 +- Remove stale TODO by @danlaine in https://github.com/ava-labs/avalanchego/pull/2468 +- `vms/platformvm`: Add `TestBuildBlockDoesNotBuildWithEmptyMempool` test by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2469 +- `vms/platformvm`: Add `TestBuildBlockShouldAdvanceTime` test by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2471 +- `vms/platformvm`: Permit usage of the `Transactions` field in `BanffProposalBlock` by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2451 +- `vms/platformvm`: Add `TestBuildBlockForceAdvanceTime` test by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2472 +- P2P AppError handling by @joshua-kim in https://github.com/ava-labs/avalanchego/pull/2248 +- `vms/platformvm`: Verify txs before building a block by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2359 +- Refactor p2p unit tests by @joshua-kim in https://github.com/ava-labs/avalanchego/pull/2475 +- Add ACP signaling by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2476 +- Refactor SDK by @joshua-kim in https://github.com/ava-labs/avalanchego/pull/2452 +- Cleanup CI by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2480 +- Ensure upgrade test uses the correct binary on restart by @marun in https://github.com/ava-labs/avalanchego/pull/2478 +- Prefetch Improvement by @dboehm-avalabs in https://github.com/ava-labs/avalanchego/pull/2435 +- ci: run each fuzz test for 10 seconds by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2483 +- Remove nullable options by @nytzuga in https://github.com/ava-labs/avalanchego/pull/2481 +- `merkledb` -- dynamic root by @danlaine in https://github.com/ava-labs/avalanchego/pull/2177 +- fix onEvictCache by @danlaine in https://github.com/ava-labs/avalanchego/pull/2484 +- Remove cached node bytes from merkle nodes by @dboehm-avalabs in https://github.com/ava-labs/avalanchego/pull/2393 +- Fix race in view iteration by @dboehm-avalabs in https://github.com/ava-labs/avalanchego/pull/2486 +- MerkleDB -- update readme by @danlaine in https://github.com/ava-labs/avalanchego/pull/2423 +- Drop Pending Stakers 3 - persist stakers' StartTime by @abi87 in https://github.com/ava-labs/avalanchego/pull/2306 +- SDK Push Gossiper implementation by @joshua-kim in https://github.com/ava-labs/avalanchego/pull/2428 +- `tmpnet`: Move tmpnet/local to tmpnet package by @marun in https://github.com/ava-labs/avalanchego/pull/2457 +- `merkledb` -- make tests use time as randomness seed by @danlaine in https://github.com/ava-labs/avalanchego/pull/2470 +- `tmpnet`: Break config.go up into coherent parts by @marun in https://github.com/ava-labs/avalanchego/pull/2462 +- Drop Pending Stakers 4 - minimal UT infra cleanup by @abi87 in https://github.com/ava-labs/avalanchego/pull/2332 +- ProposerVM Extend windows 2- extend windowing by @abi87 in https://github.com/ava-labs/avalanchego/pull/2401 +- Support json marshalling txs returned from the wallet by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2494 +- Avoid escaping to improve readability by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2496 +- Allow OutputOwners to be json marshalled without InitCtx by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2495 +- Drop Pending Stakers 5 - validated PostDurango StakerTxs by @abi87 in https://github.com/ava-labs/avalanchego/pull/2314 +- Bump golang.org/x/crypto from 0.14.0 to 0.17.0 by @dependabot in https://github.com/ava-labs/avalanchego/pull/2502 +- Remove unused `BuildGenesisTest` function by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2503 +- Remove unused `AcceptorTracker` struct by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2508 +- Dedupe secp256k1 key usage in tests by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2511 +- Merkledb readme updates by @danlaine in https://github.com/ava-labs/avalanchego/pull/2510 +- Gossip Test structs by @joshua-kim in https://github.com/ava-labs/avalanchego/pull/2514 +- `tmpnet`: Separate node into orchestration, config and process by @marun in https://github.com/ava-labs/avalanchego/pull/2460 +- Move `snow.DefaultConsensusContextTest` to `snowtest.ConsensusContext` by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2507 +- Add gossip Marshaller interface by @joshua-kim in https://github.com/ava-labs/avalanchego/pull/2509 +- Include chain creation error in health check by @marun in https://github.com/ava-labs/avalanchego/pull/2519 +- Make X-chain mempool safe for concurrent use by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2520 +- Initialize transactions once by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2521 +- `vms/avm`: Remove usage of `require.Contains` from service tests by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2517 +- Move context lock into issueTx by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2524 +- Rework X-chain locking in tests by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2526 +- `vms/avm`: Simplify `mempool.Remove` signature by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2527 +- Remove unused mocks by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2528 +- Move `avm.newContext` to `snowtest.Context` by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2513 +- Do not fail-fast Tests / Unit by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2530 +- Make P-Chain Mempool thread-safe by @joshua-kim in https://github.com/ava-labs/avalanchego/pull/2523 +- `vms/platformvm`: Use `snowtest.Context` helper by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2515 +- Export mempool errors by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2531 +- Move locking into issueTx by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2532 +- Fix merge in wallet service by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2534 +- Introduce TxVerifier interface to network by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2533 +- Export P-Chain Mempool Errors by @joshua-kim in https://github.com/ava-labs/avalanchego/pull/2535 +- Rename `Version` message to `Handshake` by @danlaine in https://github.com/ava-labs/avalanchego/pull/2479 +- Rename myVersionTime to ipSigningTime by @danlaine in https://github.com/ava-labs/avalanchego/pull/2537 +- Remove resolved TODO by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2540 +- Only initialize Txs once by @joshua-kim in https://github.com/ava-labs/avalanchego/pull/2538 +- JSON marshal the `Transactions` field in `BanffProposalBlocks` by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2541 +- Enable `predeclared` linter by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2539 +- Move context lock into `network.issueTx` by @joshua-kim in https://github.com/ava-labs/avalanchego/pull/2525 +- Remove comment on treating failed sends as FATAL by @joshua-kim in https://github.com/ava-labs/avalanchego/pull/2544 +- Add TxVerifier interface to network by @joshua-kim in https://github.com/ava-labs/avalanchego/pull/2542 +- X-chain SDK gossip by @joshua-kim in https://github.com/ava-labs/avalanchego/pull/2490 +- Remove network context by @joshua-kim in https://github.com/ava-labs/avalanchego/pull/2543 +- Remove `snow.DefaultContextTest` by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2518 +- Fix windowing when no validator is available by @abi87 in https://github.com/ava-labs/avalanchego/pull/2529 +- Unexport fields from gossip.BloomFilter by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2547 +- P-Chain SDK Gossip by @joshua-kim in https://github.com/ava-labs/avalanchego/pull/2487 +- Documentation Fixes: Grammatical Corrections and Typo Fixes Across Multiple Files by @joaolago1113 in https://github.com/ava-labs/avalanchego/pull/2550 +- Notify block builder of txs after reject by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2549 +- Set dependabot target branch to `dev` by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2553 +- Remove `MockLogger` by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2554 +- Clean up merkleDB interface and duplicate code by @dboehm-avalabs in https://github.com/ava-labs/avalanchego/pull/2445 +- Do not mark txs as dropped when mempool is full by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2557 +- Update bug bounty program to immunefi by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2558 +- Fix p2p sdk metric labels by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2561 +- Suppress gossip warnings due to no sampled peers by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2562 +- Remove dead code and unnecessary lock from reflect codec by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2560 +- Remove unused index interface by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2564 +- Implement SetMap and use it in XP-chain mempools by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2555 +- `vms/platformvm`: Add `TestIterate` by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2565 +- Cleanup codec usage by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2563 +- Remove `len` tag parsing from the reflect codec by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2559 +- Use more specific type by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2567 +- Standardize `onShutdownCtx` by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2568 +- Verify avm mempool txs against the last accepted state by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2569 +- Update `CODEOWNERS` by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2570 +- Remove license from mocks by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2574 +- Add missing import by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2573 +- `vms/platformvm`: Prune mempool periodically by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2566 +- Update license header to 2024 by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2572 +- [MerkleDB] Make intermediate node cache two layered by @dboehm-avalabs in https://github.com/ava-labs/avalanchego/pull/2576 +- Fix merkledb rebuild iterator by @dboehm-avalabs in https://github.com/ava-labs/avalanchego/pull/2581 +- Fix intermediate node caching by @dboehm-avalabs in https://github.com/ava-labs/avalanchego/pull/2585 +- Remove codec length check after Durango by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2586 +- `tmpnet`: Use AvalancheLocalChainConfig for cchain genesis by @marun in https://github.com/ava-labs/avalanchego/pull/2583 +- `testing`: Ensure CheckBootstrapIsPossible is safe for teardown by @marun in https://github.com/ava-labs/avalanchego/pull/2582 +- `tmpnet`: Separate network into orchestration and configuration by @marun in https://github.com/ava-labs/avalanchego/pull/2464 +- Update uintsize implementation by @danlaine in https://github.com/ava-labs/avalanchego/pull/2590 +- Optimize bloom filter by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2588 +- Remove TLS key gen from networking tests by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2596 +- [utils/bloom] Optionally Update Bloom Filter Size on Reset by @patrick-ogrady in https://github.com/ava-labs/avalanchego/pull/2591 +- [ci] Increase Fuzz Time in Periodic Runs by @patrick-ogrady in https://github.com/ava-labs/avalanchego/pull/2599 +- `tmpnet`: Save metrics snapshot to disk before node shutdown by @marun in https://github.com/ava-labs/avalanchego/pull/2601 +- chore: Fix typo s/useage/usage by @hugo-syn in https://github.com/ava-labs/avalanchego/pull/2602 +- Deprecate `SnowRogueCommitThresholdKey` and `SnowVirtuousCommitThresholdKey` by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2600 +- Fix networking invalid field log by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2604 +- chore: Fix typo s/seperate/separate/ by @hugo-syn in https://github.com/ava-labs/avalanchego/pull/2605 +- Support dynamic port peerlist gossip by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2603 +- Replace `PeerListAck` with `GetPeerList` by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2580 +- Log critical consensus values during health checks by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2609 +- Update contributions branch to master by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2610 +- Add ip bloom metrics by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2614 +- `x/sync`: Auto-generate `MockNetworkClient` by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2617 +- Remove CreateStaticHandlers from VM interface by @joshua-kim in https://github.com/ava-labs/avalanchego/pull/2589 +- `tmpnet`: Add support for subnets by @marun in https://github.com/ava-labs/avalanchego/pull/2492 +- Update `go.uber.org/mock/gomock` to `v0.4.0` by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2618 +- Add `mockgen` source mode for generics + bls imports by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2615 +- Verify all MockGen generated files are re-generated in CI by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2616 +- Move division by 0 check out of the bloom loops by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2622 +- P-chain Add UTs around stakers persistence in platformvm state by @abi87 in https://github.com/ava-labs/avalanchego/pull/2505 +- Revert "Set dependabot target branch to `dev` (#2553)" by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2623 +- Remove remaining 2023 remnants by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2624 +- Deprecate push-based peerlist gossip flags by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2625 +- Remove support for compressing gzip messages by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2627 +- Always attempt to install mockgen `v0.4.0` before execution by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/2628 +- Modify TLS parsing rules for Durango by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/2458 + +### New Contributors + +- @joaolago1113 made their first contribution in https://github.com/ava-labs/avalanchego/pull/2550 +- @hugo-syn made their first contribution in https://github.com/ava-labs/avalanchego/pull/2602 + +**Full Changelog**: https://github.com/ava-labs/avalanchego/compare/v1.10.17...v1.10.18 + ## [v1.10.17](https://github.com/ava-labs/avalanchego/releases/tag/v1.10.17) This version is backwards compatible to [v1.10.0](https://github.com/ava-labs/avalanchego/releases/tag/v1.10.0). It is optional, but encouraged. diff --git a/network/p2p/network_test.go b/network/p2p/network_test.go index 6aea3bc554d0..3bf902c38035 100644 --- a/network/p2p/network_test.go +++ b/network/p2p/network_test.go @@ -9,6 +9,7 @@ import ( "time" "github.com/prometheus/client_golang/prometheus" + "github.com/stretchr/testify/require" "github.com/ava-labs/avalanchego/ids" diff --git a/network/peer/peer.go b/network/peer/peer.go index 403bea5220ba..255f13821f23 100644 --- a/network/peer/peer.go +++ b/network/peer/peer.go @@ -1102,8 +1102,8 @@ func (p *peer) handleHandshake(msg *p2p.Handshake) { peerIPs := p.Network.Peers(p.id, knownPeers, salt) - // We bypass throttling here to ensure that the peerlist message is - // acknowledged timely. + // We bypass throttling here to ensure that the handshake message is + // acknowledged correctly. peerListMsg, err := p.Config.MessageCreator.PeerList(peerIPs, true /*=bypassThrottling*/) if err != nil { p.Log.Error("failed to create peer list handshake message", diff --git a/network/peer/validator_id.go b/network/peer/validator_id.go deleted file mode 100644 index 078929d0f90a..000000000000 --- a/network/peer/validator_id.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - -package peer - -import "github.com/ava-labs/avalanchego/ids" - -// ValidatorID represents a validator that we gossip to other peers -type ValidatorID struct { - // The validator's ID - NodeID ids.NodeID - // The Tx that added this into the validator set - TxID ids.ID -} diff --git a/utils/sorting_test.go b/utils/sorting_test.go index 632629368518..acab335034ed 100644 --- a/utils/sorting_test.go +++ b/utils/sorting_test.go @@ -14,14 +14,7 @@ var _ Sortable[sortable] = sortable(0) type sortable int func (s sortable) Compare(other sortable) int { - switch { - case s < other: - return -1 - case s > other: - return 1 - default: - return 0 - } + return Compare(s, other) } func TestSortSliceSortable(t *testing.T) { diff --git a/version/compatibility.json b/version/compatibility.json index d34dfb1a5a28..e975f92c3698 100644 --- a/version/compatibility.json +++ b/version/compatibility.json @@ -1,4 +1,7 @@ { + "31": [ + "v1.10.18" + ], "30": [ "v1.10.15", "v1.10.16", diff --git a/version/constants.go b/version/constants.go index 053a57a4585b..55af70a4d89f 100644 --- a/version/constants.go +++ b/version/constants.go @@ -15,9 +15,10 @@ import ( const ( Client = "avalanchego" - // RPCChainVMProtocol should be bumped anytime changes are made which require - // the plugin vm to upgrade to latest avalanchego release to be compatible. - RPCChainVMProtocol uint = 30 + // RPCChainVMProtocol should be bumped anytime changes are made which + // require the plugin vm to upgrade to latest avalanchego release to be + // compatible. + RPCChainVMProtocol uint = 31 ) // These are globals that describe network upgrades and node versions @@ -25,7 +26,7 @@ var ( Current = &Semantic{ Major: 1, Minor: 10, - Patch: 17, + Patch: 18, } CurrentApp = &Application{ Name: Client, diff --git a/vms/avm/network/network.go b/vms/avm/network/network.go index d2920bc51af4..fbeed92a95a1 100644 --- a/vms/avm/network/network.go +++ b/vms/avm/network/network.go @@ -204,8 +204,7 @@ func (n *Network) AppGossip(ctx context.Context, nodeID ids.NodeID, msgBytes []b return nil } - err = n.mempool.Add(tx) - if err == nil { + if err := n.mempool.Add(tx); err == nil { txID := tx.ID() n.txPushGossiper.Add(tx) if err := n.txPushGossiper.Gossip(ctx); err != nil { diff --git a/vms/platformvm/block/executor/verifier.go b/vms/platformvm/block/executor/verifier.go index 2af7cb20912a..1f46ce132c47 100644 --- a/vms/platformvm/block/executor/verifier.go +++ b/vms/platformvm/block/executor/verifier.go @@ -51,7 +51,8 @@ func (v *verifier) BanffCommitBlock(b *block.BanffCommitBlock) error { } func (v *verifier) BanffProposalBlock(b *block.BanffProposalBlock) error { - if !v.txExecutorBackend.Config.IsDurangoActivated(b.Timestamp()) && len(b.Transactions) != 0 { + nextChainTime := b.Timestamp() + if !v.txExecutorBackend.Config.IsDurangoActivated(nextChainTime) && len(b.Transactions) != 0 { return errBanffProposalBlockWithMultipleTransactions } @@ -66,7 +67,6 @@ func (v *verifier) BanffProposalBlock(b *block.BanffProposalBlock) error { } // Apply the changes, if any, from advancing the chain time. - nextChainTime := b.Timestamp() changes, err := executor.AdvanceTimeTo( v.txExecutorBackend, onDecisionState, @@ -219,7 +219,7 @@ func (v *verifier) ApricotAtomicBlock(b *block.ApricotAtomicBlock) error { atomicExecutor.OnAccept.AddTx(b.Tx, status.Committed) - if err := v.verifyUniqueInputs(b.Parent(), atomicExecutor.Inputs); err != nil { + if err := v.verifyUniqueInputs(parentID, atomicExecutor.Inputs); err != nil { return err } diff --git a/vms/platformvm/vm.go b/vms/platformvm/vm.go index 746826666c6d..8c4b527e4539 100644 --- a/vms/platformvm/vm.go +++ b/vms/platformvm/vm.go @@ -302,6 +302,9 @@ func (vm *VM) pruneMempool() error { vm.ctx.Lock.Lock() defer vm.ctx.Lock.Unlock() + // Packing all of the transactions in order performs additional checks that + // the MempoolTxVerifier doesn't include. So, evicting transactions from + // here is expected to happen occasionally. blockTxs, err := vm.Builder.PackBlockTxs(math.MaxInt) if err != nil { return err From eb18036095fbdfbfff2c2cc2d7e0522f94f1ed0e Mon Sep 17 00:00:00 2001 From: Dhruba Basu <7675102+dhrubabasu@users.noreply.github.com> Date: Thu, 18 Jan 2024 16:35:38 -0500 Subject: [PATCH 56/57] `vms/platformvm`: Change `AdvanceTimeTo` to modify passed-in `parentState` (#2489) Co-authored-by: Stephen Buttolph --- vms/platformvm/block/builder/builder.go | 5 +- vms/platformvm/block/executor/verifier.go | 24 +--- .../txs/executor/proposal_tx_executor.go | 7 +- vms/platformvm/txs/executor/state_changes.go | 127 +++++++----------- .../txs/executor/tx_mempool_verifier.go | 10 +- 5 files changed, 56 insertions(+), 117 deletions(-) diff --git a/vms/platformvm/block/builder/builder.go b/vms/platformvm/block/builder/builder.go index 09e99ba9ac3e..d19f5d902e12 100644 --- a/vms/platformvm/block/builder/builder.go +++ b/vms/platformvm/block/builder/builder.go @@ -347,12 +347,9 @@ func packBlockTxs( return nil, err } - changes, err := txexecutor.AdvanceTimeTo(backend, stateDiff, timestamp) - if err != nil { + if _, err := txexecutor.AdvanceTimeTo(backend, stateDiff, timestamp); err != nil { return nil, err } - changes.Apply(stateDiff) - stateDiff.SetTimestamp(timestamp) var ( blockTxs []*txs.Tx diff --git a/vms/platformvm/block/executor/verifier.go b/vms/platformvm/block/executor/verifier.go index 1f46ce132c47..3b43e435c781 100644 --- a/vms/platformvm/block/executor/verifier.go +++ b/vms/platformvm/block/executor/verifier.go @@ -66,19 +66,11 @@ func (v *verifier) BanffProposalBlock(b *block.BanffProposalBlock) error { return err } - // Apply the changes, if any, from advancing the chain time. - changes, err := executor.AdvanceTimeTo( - v.txExecutorBackend, - onDecisionState, - nextChainTime, - ) - if err != nil { + // Advance the time to [nextChainTime]. + if _, err := executor.AdvanceTimeTo(v.txExecutorBackend, onDecisionState, nextChainTime); err != nil { return err } - onDecisionState.SetTimestamp(nextChainTime) - changes.Apply(onDecisionState) - inputs, atomicRequests, onAcceptFunc, err := v.processStandardTxs(b.Transactions, onDecisionState, b.Parent()) if err != nil { return err @@ -116,12 +108,11 @@ func (v *verifier) BanffStandardBlock(b *block.BanffStandardBlock) error { return err } - // Apply the changes, if any, from advancing the chain time. - nextChainTime := b.Timestamp() - changes, err := executor.AdvanceTimeTo( + // Advance the time to [b.Timestamp()]. + changed, err := executor.AdvanceTimeTo( v.txExecutorBackend, onAcceptState, - nextChainTime, + b.Timestamp(), ) if err != nil { return err @@ -129,13 +120,10 @@ func (v *verifier) BanffStandardBlock(b *block.BanffStandardBlock) error { // If this block doesn't perform any changes, then it should never have been // issued. - if changes.Len() == 0 && len(b.Transactions) == 0 { + if !changed && len(b.Transactions) == 0 { return errBanffStandardBlockWithoutChanges } - onAcceptState.SetTimestamp(nextChainTime) - changes.Apply(onAcceptState) - return v.standardBlock(&b.ApricotStandardBlock, onAcceptState) } diff --git a/vms/platformvm/txs/executor/proposal_tx_executor.go b/vms/platformvm/txs/executor/proposal_tx_executor.go index c3893be429d3..773eeabad901 100644 --- a/vms/platformvm/txs/executor/proposal_tx_executor.go +++ b/vms/platformvm/txs/executor/proposal_tx_executor.go @@ -296,15 +296,10 @@ func (e *ProposalTxExecutor) AdvanceTimeTx(tx *txs.AdvanceTimeTx) error { return err } - changes, err := AdvanceTimeTo(e.Backend, e.OnCommitState, newChainTime) - if err != nil { + if _, err := AdvanceTimeTo(e.Backend, e.OnCommitState, newChainTime); err != nil { return err } - // Update the state if this tx is committed - e.OnCommitState.SetTimestamp(newChainTime) - changes.Apply(e.OnCommitState) - e.PrefersCommit = !newChainTime.After(now.Add(SyncBound)) // Note that state doesn't change if this proposal is aborted diff --git a/vms/platformvm/txs/executor/state_changes.go b/vms/platformvm/txs/executor/state_changes.go index 2b327c4f8b96..3086358304a3 100644 --- a/vms/platformvm/txs/executor/state_changes.go +++ b/vms/platformvm/txs/executor/state_changes.go @@ -57,78 +57,35 @@ func VerifyNewChainTime( return nil } -type StateChanges interface { - Apply(onAccept state.Diff) - Len() int -} - -type stateChanges struct { - updatedSupplies map[ids.ID]uint64 - currentValidatorsToAdd []*state.Staker - currentDelegatorsToAdd []*state.Staker - pendingValidatorsToRemove []*state.Staker - pendingDelegatorsToRemove []*state.Staker - currentValidatorsToRemove []*state.Staker -} - -func (s *stateChanges) Apply(stateDiff state.Diff) { - for subnetID, supply := range s.updatedSupplies { - stateDiff.SetCurrentSupply(subnetID, supply) - } - - for _, currentValidatorToAdd := range s.currentValidatorsToAdd { - stateDiff.PutCurrentValidator(currentValidatorToAdd) - } - for _, pendingValidatorToRemove := range s.pendingValidatorsToRemove { - stateDiff.DeletePendingValidator(pendingValidatorToRemove) - } - for _, currentDelegatorToAdd := range s.currentDelegatorsToAdd { - stateDiff.PutCurrentDelegator(currentDelegatorToAdd) - } - for _, pendingDelegatorToRemove := range s.pendingDelegatorsToRemove { - stateDiff.DeletePendingDelegator(pendingDelegatorToRemove) - } - for _, currentValidatorToRemove := range s.currentValidatorsToRemove { - stateDiff.DeleteCurrentValidator(currentValidatorToRemove) - } -} - -func (s *stateChanges) Len() int { - return len(s.currentValidatorsToAdd) + len(s.currentDelegatorsToAdd) + - len(s.pendingValidatorsToRemove) + len(s.pendingDelegatorsToRemove) + - len(s.currentValidatorsToRemove) -} - -// AdvanceTimeTo does not modify [parentState]. -// Instead it returns all the StateChanges caused by advancing the chain time to -// the [newChainTime]. +// AdvanceTimeTo applies all state changes to [parentState] resulting from +// advancing the chain time to [newChainTime]. +// Returns true iff the validator set changed. func AdvanceTimeTo( backend *Backend, parentState state.Chain, newChainTime time.Time, -) (StateChanges, error) { - pendingStakerIterator, err := parentState.GetPendingStakerIterator() +) (bool, error) { + // We promote pending stakers to current stakers first and remove + // completed stakers from the current staker set. We assume that any + // promoted staker will not immediately be removed from the current staker + // set. This is guaranteed by the following invariants. + // + // Invariant: MinStakeDuration > 0 => guarantees [StartTime] != [EndTime] + // Invariant: [newChainTime] <= nextStakerChangeTime. + + changes, err := state.NewDiffOn(parentState) if err != nil { - return nil, err + return false, err } - defer pendingStakerIterator.Release() - changes := &stateChanges{ - updatedSupplies: make(map[ids.ID]uint64), + pendingStakerIterator, err := parentState.GetPendingStakerIterator() + if err != nil { + return false, err } + defer pendingStakerIterator.Release() - // Add to the staker set any pending stakers whose start time is at or - // before the new timestamp - - // Note: we process pending stakers ready to be promoted to current ones and - // then we process current stakers to be demoted out of stakers set. It is - // guaranteed that no promoted stakers would be demoted immediately. A - // failure of this invariant would cause a staker to be added to - // StateChanges and be persisted among current stakers even if it already - // expired. The following invariants ensure this does not happens: - // Invariant: minimum stake duration is > 0, so staker.StartTime != staker.EndTime. - // Invariant: [newChainTime] does not skip stakers set change times. - + var changed bool + // Promote any pending stakers to current if [StartTime] <= [newChainTime]. for pendingStakerIterator.Next() { stakerToRemove := pendingStakerIterator.Value() if stakerToRemove.StartTime.After(newChainTime) { @@ -140,22 +97,20 @@ func AdvanceTimeTo( stakerToAdd.Priority = txs.PendingToCurrentPriorities[stakerToRemove.Priority] if stakerToRemove.Priority == txs.SubnetPermissionedValidatorPendingPriority { - changes.currentValidatorsToAdd = append(changes.currentValidatorsToAdd, &stakerToAdd) - changes.pendingValidatorsToRemove = append(changes.pendingValidatorsToRemove, stakerToRemove) + changes.PutCurrentValidator(&stakerToAdd) + changes.DeletePendingValidator(stakerToRemove) + changed = true continue } - supply, ok := changes.updatedSupplies[stakerToRemove.SubnetID] - if !ok { - supply, err = parentState.GetCurrentSupply(stakerToRemove.SubnetID) - if err != nil { - return nil, err - } + supply, err := changes.GetCurrentSupply(stakerToRemove.SubnetID) + if err != nil { + return false, err } rewards, err := GetRewardsCalculator(backend, parentState, stakerToRemove.SubnetID) if err != nil { - return nil, err + return false, err } potentialReward := rewards.Calculate( @@ -167,25 +122,28 @@ func AdvanceTimeTo( // Invariant: [rewards.Calculate] can never return a [potentialReward] // such that [supply + potentialReward > maximumSupply]. - changes.updatedSupplies[stakerToRemove.SubnetID] = supply + potentialReward + changes.SetCurrentSupply(stakerToRemove.SubnetID, supply+potentialReward) switch stakerToRemove.Priority { case txs.PrimaryNetworkValidatorPendingPriority, txs.SubnetPermissionlessValidatorPendingPriority: - changes.currentValidatorsToAdd = append(changes.currentValidatorsToAdd, &stakerToAdd) - changes.pendingValidatorsToRemove = append(changes.pendingValidatorsToRemove, stakerToRemove) + changes.PutCurrentValidator(&stakerToAdd) + changes.DeletePendingValidator(stakerToRemove) case txs.PrimaryNetworkDelegatorApricotPendingPriority, txs.PrimaryNetworkDelegatorBanffPendingPriority, txs.SubnetPermissionlessDelegatorPendingPriority: - changes.currentDelegatorsToAdd = append(changes.currentDelegatorsToAdd, &stakerToAdd) - changes.pendingDelegatorsToRemove = append(changes.pendingDelegatorsToRemove, stakerToRemove) + changes.PutCurrentDelegator(&stakerToAdd) + changes.DeletePendingDelegator(stakerToRemove) default: - return nil, fmt.Errorf("expected staker priority got %d", stakerToRemove.Priority) + return false, fmt.Errorf("expected staker priority got %d", stakerToRemove.Priority) } + + changed = true } + // Remove any current stakers whose [EndTime] <= [newChainTime]. currentStakerIterator, err := parentState.GetCurrentStakerIterator() if err != nil { - return nil, err + return false, err } defer currentStakerIterator.Release() @@ -203,9 +161,16 @@ func AdvanceTimeTo( break } - changes.currentValidatorsToRemove = append(changes.currentValidatorsToRemove, stakerToRemove) + changes.DeleteCurrentValidator(stakerToRemove) + changed = true } - return changes, nil + + if err := changes.Apply(parentState); err != nil { + return false, err + } + + parentState.SetTimestamp(newChainTime) + return changed, nil } func GetRewardsCalculator( diff --git a/vms/platformvm/txs/executor/tx_mempool_verifier.go b/vms/platformvm/txs/executor/tx_mempool_verifier.go index f2e7d09673e6..348e457c1c78 100644 --- a/vms/platformvm/txs/executor/tx_mempool_verifier.go +++ b/vms/platformvm/txs/executor/tx_mempool_verifier.go @@ -114,14 +114,8 @@ func (v *MempoolTxVerifier) standardBaseState() (state.Diff, error) { return nil, err } - changes, err := AdvanceTimeTo(v.Backend, state, nextBlkTime) - if err != nil { - return nil, err - } - changes.Apply(state) - state.SetTimestamp(nextBlkTime) - - return state, nil + _, err = AdvanceTimeTo(v.Backend, state, nextBlkTime) + return state, err } func NextBlockTime(state state.Chain, clk *mockable.Clock) (time.Time, bool, error) { From 4d16cc3c70bfd215dfeb3bd781a2e0f48c64d017 Mon Sep 17 00:00:00 2001 From: Dhruba Basu <7675102+dhrubabasu@users.noreply.github.com> Date: Thu, 18 Jan 2024 17:27:41 -0500 Subject: [PATCH 57/57] `vms/platformvm`: Remove `MempoolTxVerifier` (#2362) Co-authored-by: Stephen Buttolph --- vms/platformvm/block/executor/manager.go | 32 +++- vms/platformvm/txs/executor/export_test.go | 16 +- vms/platformvm/txs/executor/import_test.go | 16 +- .../txs/executor/standard_tx_executor_test.go | 20 --- vms/platformvm/txs/executor/state_changes.go | 25 +++ .../txs/executor/tx_mempool_verifier.go | 143 ------------------ 6 files changed, 64 insertions(+), 188 deletions(-) delete mode 100644 vms/platformvm/txs/executor/tx_mempool_verifier.go diff --git a/vms/platformvm/block/executor/manager.go b/vms/platformvm/block/executor/manager.go index ed82197a3568..27d35a7641ad 100644 --- a/vms/platformvm/block/executor/manager.go +++ b/vms/platformvm/block/executor/manager.go @@ -127,12 +127,34 @@ func (m *manager) VerifyTx(tx *txs.Tx) error { return ErrChainNotSynced } - return tx.Unsigned.Visit(&executor.MempoolTxVerifier{ - Backend: m.txExecutorBackend, - ParentID: m.preferred, - StateVersions: m, - Tx: tx, + stateDiff, err := state.NewDiff(m.preferred, m) + if err != nil { + return err + } + + nextBlkTime, _, err := executor.NextBlockTime(stateDiff, m.txExecutorBackend.Clk) + if err != nil { + return err + } + + _, err = executor.AdvanceTimeTo(m.txExecutorBackend, stateDiff, nextBlkTime) + if err != nil { + return err + } + + err = tx.Unsigned.Visit(&executor.StandardTxExecutor{ + Backend: m.txExecutorBackend, + State: stateDiff, + Tx: tx, }) + // We ignore [errFutureStakeTime] here because the time will be advanced + // when this transaction is issued. + // + // TODO: Remove this check post-Durango. + if errors.Is(err, executor.ErrFutureStakeTime) { + return nil + } + return err } func (m *manager) VerifyUniqueInputs(blkID ids.ID, inputs set.Set[ids.ID]) error { diff --git a/vms/platformvm/txs/executor/export_test.go b/vms/platformvm/txs/executor/export_test.go index 1272d2815142..10085f08436f 100644 --- a/vms/platformvm/txs/executor/export_test.go +++ b/vms/platformvm/txs/executor/export_test.go @@ -59,19 +59,15 @@ func TestNewExportTx(t *testing.T) { ) require.NoError(err) - fakedState, err := state.NewDiff(lastAcceptedID, env) + stateDiff, err := state.NewDiff(lastAcceptedID, env) require.NoError(err) - fakedState.SetTimestamp(tt.timestamp) + stateDiff.SetTimestamp(tt.timestamp) - fakedParent := ids.GenerateTestID() - env.SetState(fakedParent, fakedState) - - verifier := MempoolTxVerifier{ - Backend: &env.backend, - ParentID: fakedParent, - StateVersions: env, - Tx: tx, + verifier := StandardTxExecutor{ + Backend: &env.backend, + State: stateDiff, + Tx: tx, } require.NoError(tx.Unsigned.Visit(&verifier)) }) diff --git a/vms/platformvm/txs/executor/import_test.go b/vms/platformvm/txs/executor/import_test.go index 5d281da57185..f9f270801b2b 100644 --- a/vms/platformvm/txs/executor/import_test.go +++ b/vms/platformvm/txs/executor/import_test.go @@ -182,19 +182,15 @@ func TestNewImportTx(t *testing.T) { require.Equal(env.config.TxFee, totalIn-totalOut) - fakedState, err := state.NewDiff(lastAcceptedID, env) + stateDiff, err := state.NewDiff(lastAcceptedID, env) require.NoError(err) - fakedState.SetTimestamp(tt.timestamp) + stateDiff.SetTimestamp(tt.timestamp) - fakedParent := ids.GenerateTestID() - env.SetState(fakedParent, fakedState) - - verifier := MempoolTxVerifier{ - Backend: &env.backend, - ParentID: fakedParent, - StateVersions: env, - Tx: tx, + verifier := StandardTxExecutor{ + Backend: &env.backend, + State: stateDiff, + Tx: tx, } require.NoError(tx.Unsigned.Visit(&verifier)) }) diff --git a/vms/platformvm/txs/executor/standard_tx_executor_test.go b/vms/platformvm/txs/executor/standard_tx_executor_test.go index a86c579fee79..2e99150e5a54 100644 --- a/vms/platformvm/txs/executor/standard_tx_executor_test.go +++ b/vms/platformvm/txs/executor/standard_tx_executor_test.go @@ -179,7 +179,6 @@ func TestStandardTxExecutorAddDelegator(t *testing.T) { setup func(*environment) AP3Time time.Time expectedExecutionErr error - expectedMempoolErr error } tests := []test{ @@ -194,7 +193,6 @@ func TestStandardTxExecutorAddDelegator(t *testing.T) { setup: nil, AP3Time: defaultGenesisTime, expectedExecutionErr: ErrPeriodMismatch, - expectedMempoolErr: ErrPeriodMismatch, }, { description: fmt.Sprintf("delegator should not be added more than (%s) in the future", MaxFutureStartTime), @@ -207,7 +205,6 @@ func TestStandardTxExecutorAddDelegator(t *testing.T) { setup: nil, AP3Time: defaultGenesisTime, expectedExecutionErr: ErrFutureStakeTime, - expectedMempoolErr: nil, }, { description: "validator not in the current or pending validator sets", @@ -220,7 +217,6 @@ func TestStandardTxExecutorAddDelegator(t *testing.T) { setup: nil, AP3Time: defaultGenesisTime, expectedExecutionErr: database.ErrNotFound, - expectedMempoolErr: database.ErrNotFound, }, { description: "delegator starts before validator", @@ -233,7 +229,6 @@ func TestStandardTxExecutorAddDelegator(t *testing.T) { setup: addMinStakeValidator, AP3Time: defaultGenesisTime, expectedExecutionErr: ErrPeriodMismatch, - expectedMempoolErr: ErrPeriodMismatch, }, { description: "delegator stops before validator", @@ -246,7 +241,6 @@ func TestStandardTxExecutorAddDelegator(t *testing.T) { setup: addMinStakeValidator, AP3Time: defaultGenesisTime, expectedExecutionErr: ErrPeriodMismatch, - expectedMempoolErr: ErrPeriodMismatch, }, { description: "valid", @@ -259,7 +253,6 @@ func TestStandardTxExecutorAddDelegator(t *testing.T) { setup: addMinStakeValidator, AP3Time: defaultGenesisTime, expectedExecutionErr: nil, - expectedMempoolErr: nil, }, { description: "starts delegating at current timestamp", @@ -272,7 +265,6 @@ func TestStandardTxExecutorAddDelegator(t *testing.T) { setup: nil, AP3Time: defaultGenesisTime, expectedExecutionErr: ErrTimestampNotBeforeStartTime, - expectedMempoolErr: ErrTimestampNotBeforeStartTime, }, { description: "tx fee paying key has no funds", @@ -297,7 +289,6 @@ func TestStandardTxExecutorAddDelegator(t *testing.T) { }, AP3Time: defaultGenesisTime, expectedExecutionErr: ErrFlowCheckFailed, - expectedMempoolErr: ErrFlowCheckFailed, }, { description: "over delegation before AP3", @@ -310,7 +301,6 @@ func TestStandardTxExecutorAddDelegator(t *testing.T) { setup: addMaxStakeValidator, AP3Time: defaultValidateEndTime, expectedExecutionErr: nil, - expectedMempoolErr: nil, }, { description: "over delegation after AP3", @@ -323,7 +313,6 @@ func TestStandardTxExecutorAddDelegator(t *testing.T) { setup: addMaxStakeValidator, AP3Time: defaultGenesisTime, expectedExecutionErr: ErrOverDelegated, - expectedMempoolErr: ErrOverDelegated, }, } @@ -363,15 +352,6 @@ func TestStandardTxExecutorAddDelegator(t *testing.T) { } err = tx.Unsigned.Visit(&executor) require.ErrorIs(err, tt.expectedExecutionErr) - - mempoolExecutor := MempoolTxVerifier{ - Backend: &freshTH.backend, - ParentID: lastAcceptedID, - StateVersions: freshTH, - Tx: tx, - } - err = tx.Unsigned.Visit(&mempoolExecutor) - require.ErrorIs(err, tt.expectedMempoolErr) }) } } diff --git a/vms/platformvm/txs/executor/state_changes.go b/vms/platformvm/txs/executor/state_changes.go index 3086358304a3..36981b095e8c 100644 --- a/vms/platformvm/txs/executor/state_changes.go +++ b/vms/platformvm/txs/executor/state_changes.go @@ -10,6 +10,7 @@ import ( "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/utils/constants" + "github.com/ava-labs/avalanchego/utils/timer/mockable" "github.com/ava-labs/avalanchego/vms/platformvm/reward" "github.com/ava-labs/avalanchego/vms/platformvm/state" "github.com/ava-labs/avalanchego/vms/platformvm/txs" @@ -57,6 +58,30 @@ func VerifyNewChainTime( return nil } +func NextBlockTime(state state.Chain, clk *mockable.Clock) (time.Time, bool, error) { + var ( + timestamp = clk.Time() + parentTime = state.GetTimestamp() + ) + if parentTime.After(timestamp) { + timestamp = parentTime + } + // [timestamp] = max(now, parentTime) + + nextStakerChangeTime, err := GetNextStakerChangeTime(state) + if err != nil { + return time.Time{}, false, fmt.Errorf("failed getting next staker change time: %w", err) + } + + // timeWasCapped means that [timestamp] was reduced to [nextStakerChangeTime] + timeWasCapped := !timestamp.Before(nextStakerChangeTime) + if timeWasCapped { + timestamp = nextStakerChangeTime + } + // [timestamp] = min(max(now, parentTime), nextStakerChangeTime) + return timestamp, timeWasCapped, nil +} + // AdvanceTimeTo applies all state changes to [parentState] resulting from // advancing the chain time to [newChainTime]. // Returns true iff the validator set changed. diff --git a/vms/platformvm/txs/executor/tx_mempool_verifier.go b/vms/platformvm/txs/executor/tx_mempool_verifier.go deleted file mode 100644 index 348e457c1c78..000000000000 --- a/vms/platformvm/txs/executor/tx_mempool_verifier.go +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - -package executor - -import ( - "errors" - "fmt" - "time" - - "github.com/ava-labs/avalanchego/ids" - "github.com/ava-labs/avalanchego/utils/timer/mockable" - "github.com/ava-labs/avalanchego/vms/platformvm/state" - "github.com/ava-labs/avalanchego/vms/platformvm/txs" -) - -var _ txs.Visitor = (*MempoolTxVerifier)(nil) - -type MempoolTxVerifier struct { - *Backend - ParentID ids.ID - StateVersions state.Versions - Tx *txs.Tx -} - -func (*MempoolTxVerifier) AdvanceTimeTx(*txs.AdvanceTimeTx) error { - return ErrWrongTxType -} - -func (*MempoolTxVerifier) RewardValidatorTx(*txs.RewardValidatorTx) error { - return ErrWrongTxType -} - -func (v *MempoolTxVerifier) AddValidatorTx(tx *txs.AddValidatorTx) error { - return v.standardTx(tx) -} - -func (v *MempoolTxVerifier) AddSubnetValidatorTx(tx *txs.AddSubnetValidatorTx) error { - return v.standardTx(tx) -} - -func (v *MempoolTxVerifier) AddDelegatorTx(tx *txs.AddDelegatorTx) error { - return v.standardTx(tx) -} - -func (v *MempoolTxVerifier) CreateChainTx(tx *txs.CreateChainTx) error { - return v.standardTx(tx) -} - -func (v *MempoolTxVerifier) CreateSubnetTx(tx *txs.CreateSubnetTx) error { - return v.standardTx(tx) -} - -func (v *MempoolTxVerifier) ImportTx(tx *txs.ImportTx) error { - return v.standardTx(tx) -} - -func (v *MempoolTxVerifier) ExportTx(tx *txs.ExportTx) error { - return v.standardTx(tx) -} - -func (v *MempoolTxVerifier) RemoveSubnetValidatorTx(tx *txs.RemoveSubnetValidatorTx) error { - return v.standardTx(tx) -} - -func (v *MempoolTxVerifier) TransformSubnetTx(tx *txs.TransformSubnetTx) error { - return v.standardTx(tx) -} - -func (v *MempoolTxVerifier) AddPermissionlessValidatorTx(tx *txs.AddPermissionlessValidatorTx) error { - return v.standardTx(tx) -} - -func (v *MempoolTxVerifier) AddPermissionlessDelegatorTx(tx *txs.AddPermissionlessDelegatorTx) error { - return v.standardTx(tx) -} - -func (v *MempoolTxVerifier) TransferSubnetOwnershipTx(tx *txs.TransferSubnetOwnershipTx) error { - return v.standardTx(tx) -} - -func (v *MempoolTxVerifier) BaseTx(tx *txs.BaseTx) error { - return v.standardTx(tx) -} - -func (v *MempoolTxVerifier) standardTx(tx txs.UnsignedTx) error { - baseState, err := v.standardBaseState() - if err != nil { - return err - } - - executor := StandardTxExecutor{ - Backend: v.Backend, - State: baseState, - Tx: v.Tx, - } - err = tx.Visit(&executor) - // We ignore [errFutureStakeTime] here because the time will be advanced - // when this transaction is issued. - if errors.Is(err, ErrFutureStakeTime) { - return nil - } - return err -} - -func (v *MempoolTxVerifier) standardBaseState() (state.Diff, error) { - state, err := state.NewDiff(v.ParentID, v.StateVersions) - if err != nil { - return nil, err - } - - nextBlkTime, _, err := NextBlockTime(state, v.Clk) - if err != nil { - return nil, err - } - - _, err = AdvanceTimeTo(v.Backend, state, nextBlkTime) - return state, err -} - -func NextBlockTime(state state.Chain, clk *mockable.Clock) (time.Time, bool, error) { - var ( - timestamp = clk.Time() - parentTime = state.GetTimestamp() - ) - if parentTime.After(timestamp) { - timestamp = parentTime - } - // [timestamp] = max(now, parentTime) - - nextStakerChangeTime, err := GetNextStakerChangeTime(state) - if err != nil { - return time.Time{}, false, fmt.Errorf("failed getting next staker change time: %w", err) - } - - // timeWasCapped means that [timestamp] was reduced to [nextStakerChangeTime] - timeWasCapped := !timestamp.Before(nextStakerChangeTime) - if timeWasCapped { - timestamp = nextStakerChangeTime - } - // [timestamp] = min(max(now, parentTime), nextStakerChangeTime) - return timestamp, timeWasCapped, nil -}