From d2137ef6d9a0b4de0d9badb9cf2e352fd75e54b9 Mon Sep 17 00:00:00 2001 From: Stephen Buttolph Date: Sat, 26 Oct 2024 18:16:45 -0400 Subject: [PATCH] fix merge --- vms/platformvm/state/subnet_only_validator.go | 27 ------------------- 1 file changed, 27 deletions(-) diff --git a/vms/platformvm/state/subnet_only_validator.go b/vms/platformvm/state/subnet_only_validator.go index 9c58a60bf2e..6d2a0f6afb9 100644 --- a/vms/platformvm/state/subnet_only_validator.go +++ b/vms/platformvm/state/subnet_only_validator.go @@ -19,9 +19,6 @@ import ( safemath "github.com/ava-labs/avalanchego/utils/math" ) -// subnetIDNodeID = [subnetID] + [nodeID] -const subnetIDNodeIDEntryLength = ids.IDLen + ids.NodeIDLen - var ( _ btree.LessFunc[SubnetOnlyValidator] = SubnetOnlyValidator.Less _ utils.Sortable[SubnetOnlyValidator] = SubnetOnlyValidator{} @@ -29,8 +26,6 @@ var ( ErrMutatedSubnetOnlyValidator = errors.New("subnet only validator contains mutated constant fields") ErrConflictingSubnetOnlyValidator = errors.New("subnet only validator contains conflicting subnetID + nodeID pair") ErrDuplicateSubnetOnlyValidator = errors.New("subnet only validator contains duplicate subnetID + nodeID pair") - - errUnexpectedSubnetIDNodeIDLength = fmt.Errorf("expected subnetID+nodeID entry length %d", subnetIDNodeIDEntryLength) ) type SubnetOnlyValidators interface { @@ -175,28 +170,6 @@ func deleteSubnetOnlyValidator(db database.KeyValueDeleter, validationID ids.ID) return db.Delete(validationID[:]) } -type subnetIDNodeID struct { - subnetID ids.ID - nodeID ids.NodeID -} - -func (s *subnetIDNodeID) Marshal() []byte { - data := make([]byte, subnetIDNodeIDEntryLength) - copy(data, s.subnetID[:]) - copy(data[ids.IDLen:], s.nodeID[:]) - return data -} - -func (s *subnetIDNodeID) Unmarshal(data []byte) error { - if len(data) != subnetIDNodeIDEntryLength { - return errUnexpectedSubnetIDNodeIDLength - } - - copy(s.subnetID[:], data) - copy(s.nodeID[:], data[ids.IDLen:]) - return nil -} - type subnetOnlyValidatorsDiff struct { numAddedActive int // May be negative modifiedTotalWeight map[ids.ID]uint64 // subnetID -> totalWeight