Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove contains from validator manager interface #2198

Merged
merged 85 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
b4185cc
move set interface to manager
ceyonur Aug 15, 2023
bb93180
stringer, getmap, preserve callbacks
ceyonur Aug 19, 2023
440a6e0
use big int internally for total weight
ceyonur Aug 24, 2023
45194b7
change set with manager in the code
ceyonur Sep 1, 2023
0222be0
remove error from validatorIDs
ceyonur Sep 1, 2023
a597db0
add comments
ceyonur Sep 1, 2023
628448b
rename validator set func
ceyonur Sep 1, 2023
9228ffb
add subnetID context to errors
ceyonur Sep 1, 2023
8041ed5
fix tests
ceyonur Sep 4, 2023
d8b9d12
remove unused errs
ceyonur Sep 4, 2023
4b649e4
fix manager mock
ceyonur Sep 4, 2023
bc96bf1
take subnetID as params
ceyonur Sep 4, 2023
2ca9976
mockgen
ceyonur Sep 4, 2023
f41a240
format
ceyonur Sep 4, 2023
821a285
lint
ceyonur Sep 4, 2023
bb4f426
use validatorIDs instead of map
ceyonur Sep 5, 2023
7c59181
relax locks
ceyonur Sep 5, 2023
a1e2773
restore comments
ceyonur Sep 5, 2023
3567001
Merge branch 'dev' into validator-manager-set-refactor
ceyonur Sep 6, 2023
ab67bb2
review fixes
ceyonur Sep 13, 2023
57639e0
Merge branch 'dev' into validator-manager-set-refactor
abi87 Sep 22, 2023
dc066c7
fix string
ceyonur Sep 27, 2023
bae23af
rename len to count
ceyonur Sep 27, 2023
a95ea7e
Merge branch 'dev' into validator-manager-set-refactor
ceyonur Sep 27, 2023
af562d1
Merge branch 'validator-manager-set-refactor' of github.com:ava-labs/…
ceyonur Sep 27, 2023
1407d8b
Merge branch 'dev' of github.com:ava-labs/avalanchego into validator-…
ceyonur Sep 29, 2023
1af595e
fix linter
ceyonur Sep 29, 2023
5216837
Update snow/networking/tracker/targeter.go
ceyonur Oct 6, 2023
814cb77
Update network/network.go
ceyonur Oct 6, 2023
4fcc744
Update chains/manager.go
ceyonur Oct 6, 2023
f08de0b
Update chains/manager.go
ceyonur Oct 6, 2023
db71f1e
Update snow/validators/overridden_manager.go
ceyonur Oct 6, 2023
bbd9e9c
Update snow/validators/overridden_manager.go
ceyonur Oct 6, 2023
56596c4
Update snow/validators/overridden_manager.go
ceyonur Oct 6, 2023
c35d555
Update snow/validators/overridden_manager.go
ceyonur Oct 6, 2023
c4a7292
revert subnetIDs as params
ceyonur Oct 6, 2023
d981e5c
Merge branch 'dev' into validator-manager-set-refactor
ceyonur Oct 6, 2023
32f8f53
skip allocating for vdrs if total weight has err
ceyonur Oct 6, 2023
aba1dec
rename validatorIDs to nodeIDs
ceyonur Oct 6, 2023
c7faf27
use full locks
ceyonur Oct 6, 2023
34c457c
Merge branch 'dev' into validator-manager-set-refactor
ceyonur Oct 6, 2023
edaa4e6
remove append
ceyonur Oct 6, 2023
a43f16f
Merge branch 'validator-manager-set-refactor' of github.com:ava-labs/…
ceyonur Oct 6, 2023
fab56fd
merged
StephenButtolph Oct 17, 2023
6bb2d8a
nit rename
StephenButtolph Oct 17, 2023
c791275
nit avoid calling Total Weight
StephenButtolph Oct 17, 2023
93655a3
import nit
StephenButtolph Oct 17, 2023
ee3c0d8
nit make vdrs manager slightly more clear in node
StephenButtolph Oct 17, 2023
ecb9e86
comment nit
StephenButtolph Oct 17, 2023
6db9313
nit standardize
StephenButtolph Oct 17, 2023
33aabad
remove stale comment
StephenButtolph Oct 17, 2023
4abe723
Try to keep processing messages
StephenButtolph Oct 17, 2023
f1bf35a
nit avoid re-assigning ctx
StephenButtolph Oct 17, 2023
586646b
nit use constant
StephenButtolph Oct 17, 2023
bd78885
Minimize locking + document edge cases
StephenButtolph Oct 17, 2023
7cb284f
Avoid tracking empty set
StephenButtolph Oct 17, 2023
fb64481
Simplify and remove racy behavior of overridden validator set manager…
StephenButtolph Oct 17, 2023
98f7a58
nit cleanup
StephenButtolph Oct 17, 2023
820be4c
nit
StephenButtolph Oct 17, 2023
6034e1e
nit format
StephenButtolph Oct 17, 2023
8048d47
nit
StephenButtolph Oct 17, 2023
86a679f
nit
StephenButtolph Oct 17, 2023
c16b5bf
remove confusing comment
StephenButtolph Oct 17, 2023
c041818
nit
StephenButtolph Oct 17, 2023
ca02473
nit
StephenButtolph Oct 17, 2023
bd900bc
nit
StephenButtolph Oct 17, 2023
0e119e6
minor cleanup
StephenButtolph Oct 17, 2023
2f98f4b
nit
StephenButtolph Oct 17, 2023
33266a2
nit
StephenButtolph Oct 17, 2023
8af5604
merged
StephenButtolph Oct 17, 2023
3d2a723
keep locking capitalization pattern
StephenButtolph Oct 17, 2023
950d20c
Rename import alias
StephenButtolph Oct 17, 2023
582dcda
remove contains from the interface
ceyonur Oct 20, 2023
c316c56
fix tests
ceyonur Oct 20, 2023
c7999cc
merged
StephenButtolph Oct 23, 2023
c440908
Merge branch 'dev' into validator-manager-set-refactor
StephenButtolph Oct 23, 2023
0a12728
Merge branch 'validator-manager-set-refactor' into remove-contains-ma…
StephenButtolph Oct 23, 2023
688c4fb
Merge branch 'dev' into remove-contains-manager
ceyonur Oct 23, 2023
2dc6018
Merge branch 'remove-contains-manager' of github.com:ava-labs/avalanc…
ceyonur Oct 23, 2023
ca44c1f
Merge branch 'dev' into remove-contains-manager
StephenButtolph Oct 23, 2023
5a449c3
merged
StephenButtolph Oct 24, 2023
6f7cffc
Remove accidental commit
StephenButtolph Oct 24, 2023
747446c
nit
StephenButtolph Oct 24, 2023
a83d652
nit
StephenButtolph Oct 24, 2023
0903d38
Merge branch 'dev' into remove-contains-manager
StephenButtolph Oct 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion chains/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -1359,7 +1359,7 @@ func (m *manager) registerBootstrappedHealthChecks() error {
if !m.IsBootstrapped(constants.PlatformChainID) {
return "node is currently bootstrapping", nil
}
if !m.Validators.Contains(constants.PrimaryNetworkID, m.NodeID) {
if _, ok := m.Validators.GetValidator(constants.PrimaryNetworkID, m.NodeID); !ok {
return "node is not a primary network validator", nil
}

Expand Down
6 changes: 3 additions & 3 deletions network/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ func (n *network) Dispatch() error {
}

func (n *network) WantsConnection(nodeID ids.NodeID) bool {
if n.config.Validators.Contains(constants.PrimaryNetworkID, nodeID) {
if _, ok := n.config.Validators.GetValidator(constants.PrimaryNetworkID, nodeID); ok {
return true
}

Expand Down Expand Up @@ -864,7 +864,7 @@ func (n *network) getPeers(
continue
}

isValidator := n.config.Validators.Contains(subnetID, nodeID)
_, isValidator := n.config.Validators.GetValidator(subnetID, nodeID)
// check if the peer is allowed to connect to the subnet
if !allower.IsAllowed(nodeID, isValidator) {
continue
Expand Down Expand Up @@ -903,7 +903,7 @@ func (n *network) samplePeers(
}

peerID := p.ID()
isValidator := n.config.Validators.Contains(subnetID, peerID)
_, isValidator := n.config.Validators.GetValidator(subnetID, peerID)
// check if the peer is allowed to connect to the subnet
if !allower.IsAllowed(peerID, isValidator) {
return false
Expand Down
4 changes: 2 additions & 2 deletions network/peer/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ func (p *peer) handleVersion(msg *p2p.Version) {
p.Metrics.ClockSkew.Observe(clockDifference)

if clockDifference > p.MaxClockDifference.Seconds() {
if p.Beacons.Contains(constants.PrimaryNetworkID, p.id) {
if _, ok := p.Beacons.GetValidator(constants.PrimaryNetworkID, p.id); ok {
p.Log.Warn("beacon reports out of sync time",
zap.Stringer("nodeID", p.id),
zap.Uint64("peerTime", msg.MyTime),
Expand Down Expand Up @@ -882,7 +882,7 @@ func (p *peer) handleVersion(msg *p2p.Version) {
p.version = peerVersion

if p.VersionCompatibility.Version().Before(peerVersion) {
if p.Beacons.Contains(constants.PrimaryNetworkID, p.id) {
if _, ok := p.Beacons.GetValidator(constants.PrimaryNetworkID, p.id); ok {
p.Log.Info("beacon attempting to connect with newer version. You may want to update your client",
zap.Stringer("nodeID", p.id),
zap.Stringer("beaconVersion", peerVersion),
Expand Down
7 changes: 4 additions & 3 deletions node/beacon_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,17 @@ type beaconManager struct {
}

func (b *beaconManager) Connected(nodeID ids.NodeID, nodeVersion *version.Application, subnetID ids.ID) {
if constants.PrimaryNetworkID == subnetID &&
b.beacons.Contains(constants.PrimaryNetworkID, nodeID) &&
_, isBeacon := b.beacons.GetValidator(constants.PrimaryNetworkID, nodeID)
if isBeacon &&
constants.PrimaryNetworkID == subnetID &&
atomic.AddInt64(&b.numConns, 1) >= b.requiredConns {
b.timer.Cancel()
}
b.Router.Connected(nodeID, nodeVersion, subnetID)
}

func (b *beaconManager) Disconnected(nodeID ids.NodeID) {
if b.beacons.Contains(constants.PrimaryNetworkID, nodeID) {
if _, isBeacon := b.beacons.GetValidator(constants.PrimaryNetworkID, nodeID); isBeacon {
atomic.AddInt64(&b.numConns, -1)
}
b.Router.Disconnected(nodeID)
Expand Down
2 changes: 1 addition & 1 deletion snow/engine/common/bootstrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ func (b *bootstrapper) Startup(ctx context.Context) error {
b.sampledBeacons = validators.NewManager()
b.pendingSendAcceptedFrontier.Clear()
for _, nodeID := range beaconIDs {
if !b.sampledBeacons.Contains(b.Ctx.SubnetID, nodeID) {
if _, ok := b.sampledBeacons.GetValidator(b.Ctx.SubnetID, nodeID); !ok {
// Invariant: We never use the TxID or BLS keys populated here.
err = b.sampledBeacons.AddStaker(b.Ctx.SubnetID, nodeID, nil, ids.Empty, 1)
} else {
Expand Down
2 changes: 1 addition & 1 deletion snow/engine/snowman/bootstrap/bootstrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ func (b *bootstrapper) Connected(ctx context.Context, nodeID ids.NodeID, nodeVer
return err
}
// Ensure fetchFrom reflects proper validator list
if b.Beacons.Contains(b.Ctx.SubnetID, nodeID) {
if _, ok := b.Beacons.GetValidator(b.Ctx.SubnetID, nodeID); ok {
b.fetchFrom.Add(nodeID)
}

Expand Down
2 changes: 1 addition & 1 deletion snow/engine/snowman/syncer/state_syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ func (ss *stateSyncer) startup(ctx context.Context) error {

ss.frontierSeeders = validators.NewManager()
for _, nodeID := range beaconIDs {
if !ss.frontierSeeders.Contains(ss.Ctx.SubnetID, nodeID) {
if _, ok := ss.frontierSeeders.GetValidator(ss.Ctx.SubnetID, nodeID); !ok {
// Invariant: We never use the TxID or BLS keys populated here.
err = ss.frontierSeeders.AddStaker(ss.Ctx.SubnetID, nodeID, nil, ids.Empty, 1)
} else {
Expand Down
3 changes: 2 additions & 1 deletion snow/networking/handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ func (h *handler) Context() *snow.ConsensusContext {
}

func (h *handler) ShouldHandle(nodeID ids.NodeID) bool {
return h.subnet.IsAllowed(nodeID, h.validators.Contains(h.ctx.SubnetID, nodeID))
_, ok := h.validators.GetValidator(h.ctx.SubnetID, nodeID)
return h.subnet.IsAllowed(nodeID, ok)
}

func (h *handler) SetEngineManager(engineManager *EngineManager) {
Expand Down
15 changes: 0 additions & 15 deletions snow/validators/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ type Manager interface {
// If an error is returned, the set will be unmodified.
RemoveWeight(subnetID ids.ID, nodeID ids.NodeID, weight uint64) error

// Contains returns true if there is a validator with the specified ID
// currently in the subnet.
Contains(subnetID ids.ID, nodeID ids.NodeID) bool

// Count returns the number of validators currently in the subnet.
Count(subnetID ids.ID) int

Expand Down Expand Up @@ -220,17 +216,6 @@ func (m *manager) RemoveWeight(subnetID ids.ID, nodeID ids.NodeID, weight uint64
return nil
}

func (m *manager) Contains(subnetID ids.ID, nodeID ids.NodeID) bool {
m.lock.RLock()
set, exists := m.subnetToVdrs[subnetID]
m.lock.RUnlock()
if !exists {
return false
}

return set.Contains(nodeID)
}

func (m *manager) Count(subnetID ids.ID) int {
m.lock.RLock()
set, exists := m.subnetToVdrs[subnetID]
Expand Down
18 changes: 3 additions & 15 deletions snow/validators/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,22 +204,10 @@ func TestGet(t *testing.T) {
require.Equal(nodeID, vdr1.NodeID)
require.Equal(pk, vdr1.PublicKey)
require.Equal(uint64(2), vdr1.Weight)
}

func TestContains(t *testing.T) {
require := require.New(t)

m := NewManager()
subnetID := ids.GenerateTestID()

nodeID := ids.GenerateTestNodeID()
require.False(m.Contains(subnetID, nodeID))

require.NoError(m.AddStaker(subnetID, nodeID, nil, ids.Empty, 1))

require.True(m.Contains(subnetID, nodeID))
require.NoError(m.RemoveWeight(subnetID, nodeID, 1))
require.False(m.Contains(subnetID, nodeID))
require.NoError(m.RemoveWeight(subnetID, nodeID, 2))
_, ok = m.GetValidator(subnetID, nodeID)
require.False(ok)
}

func TestLen(t *testing.T) {
Expand Down
4 changes: 0 additions & 4 deletions snow/validators/overridden_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@ func (o *overriddenManager) RemoveWeight(_ ids.ID, nodeID ids.NodeID, weight uin
return o.manager.RemoveWeight(o.subnetID, nodeID, weight)
}

func (o *overriddenManager) Contains(_ ids.ID, nodeID ids.NodeID) bool {
return o.manager.Contains(o.subnetID, nodeID)
}

func (o *overriddenManager) Count(ids.ID) int {
return o.manager.Count(o.subnetID)
}
Expand Down
12 changes: 0 additions & 12 deletions snow/validators/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,18 +203,6 @@ func (s *vdrSet) get(nodeID ids.NodeID) (*Validator, bool) {
return &copiedVdr, true
}

func (s *vdrSet) Contains(nodeID ids.NodeID) bool {
s.lock.RLock()
defer s.lock.RUnlock()

return s.contains(nodeID)
}

func (s *vdrSet) contains(nodeID ids.NodeID) bool {
_, contains := s.vdrs[nodeID]
return contains
}

func (s *vdrSet) Len() int {
s.lock.RLock()
defer s.lock.RUnlock()
Expand Down
17 changes: 3 additions & 14 deletions snow/validators/set_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,21 +155,10 @@ func TestSetGet(t *testing.T) {
require.Equal(nodeID, vdr1.NodeID)
require.Equal(pk, vdr1.PublicKey)
require.Equal(uint64(2), vdr1.Weight)
}

func TestSetContains(t *testing.T) {
require := require.New(t)

s := newSet()

nodeID := ids.GenerateTestNodeID()
require.False(s.Contains(nodeID))

require.NoError(s.Add(nodeID, nil, ids.Empty, 1))

require.True(s.Contains(nodeID))
require.NoError(s.RemoveWeight(nodeID, 1))
require.False(s.Contains(nodeID))
require.NoError(s.RemoveWeight(nodeID, 2))
_, ok = s.Get(nodeID)
require.False(ok)
}

func TestSetLen(t *testing.T) {
Expand Down
21 changes: 14 additions & 7 deletions vms/platformvm/block/executor/proposal_block_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -685,20 +685,24 @@ func TestBanffProposalBlockUpdateStakers(t *testing.T) {
case pending:
_, err := env.state.GetPendingValidator(constants.PrimaryNetworkID, stakerNodeID)
require.NoError(err)
require.False(env.config.Validators.Contains(constants.PrimaryNetworkID, stakerNodeID))
_, ok := env.config.Validators.GetValidator(constants.PrimaryNetworkID, stakerNodeID)
require.False(ok)
case current:
_, err := env.state.GetCurrentValidator(constants.PrimaryNetworkID, stakerNodeID)
require.NoError(err)
require.True(env.config.Validators.Contains(constants.PrimaryNetworkID, stakerNodeID))
_, ok := env.config.Validators.GetValidator(constants.PrimaryNetworkID, stakerNodeID)
require.True(ok)
}
}

for stakerNodeID, status := range test.expectedSubnetStakers {
switch status {
case pending:
require.False(env.config.Validators.Contains(subnetID, stakerNodeID))
_, ok := env.config.Validators.GetValidator(subnetID, stakerNodeID)
require.False(ok)
case current:
require.True(env.config.Validators.Contains(subnetID, stakerNodeID))
_, ok := env.config.Validators.GetValidator(subnetID, stakerNodeID)
require.True(ok)
}
}
})
Expand Down Expand Up @@ -836,8 +840,10 @@ func TestBanffProposalBlockRemoveSubnetValidator(t *testing.T) {
// Check VM Validators are removed successfully
require.NoError(propBlk.Accept(context.Background()))
require.NoError(commitBlk.Accept(context.Background()))
require.False(env.config.Validators.Contains(subnetID, subnetVdr2NodeID))
require.False(env.config.Validators.Contains(subnetID, subnetValidatorNodeID))
_, ok := env.config.Validators.GetValidator(subnetID, subnetVdr2NodeID)
require.False(ok)
_, ok = env.config.Validators.GetValidator(subnetID, subnetValidatorNodeID)
require.False(ok)
}

func TestBanffProposalBlockTrackedSubnet(t *testing.T) {
Expand Down Expand Up @@ -940,7 +946,8 @@ func TestBanffProposalBlockTrackedSubnet(t *testing.T) {

require.NoError(propBlk.Accept(context.Background()))
require.NoError(commitBlk.Accept(context.Background()))
require.Equal(tracked, env.config.Validators.Contains(subnetID, subnetValidatorNodeID))
_, ok := env.config.Validators.GetValidator(subnetID, subnetValidatorNodeID)
require.Equal(tracked, ok)
})
}
}
Expand Down
24 changes: 16 additions & 8 deletions vms/platformvm/block/executor/standard_block_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,8 @@ func TestBanffStandardBlockUpdatePrimaryNetworkStakers(t *testing.T) {

// Test VM validators
require.NoError(block.Accept(context.Background()))
require.True(env.config.Validators.Contains(constants.PrimaryNetworkID, nodeID))
_, ok := env.config.Validators.GetValidator(constants.PrimaryNetworkID, nodeID)
require.True(ok)
}

// Ensure semantic verification updates the current and pending staker sets correctly.
Expand Down Expand Up @@ -561,20 +562,24 @@ func TestBanffStandardBlockUpdateStakers(t *testing.T) {
case pending:
_, err := env.state.GetPendingValidator(constants.PrimaryNetworkID, stakerNodeID)
require.NoError(err)
require.False(env.config.Validators.Contains(constants.PrimaryNetworkID, stakerNodeID))
_, ok := env.config.Validators.GetValidator(constants.PrimaryNetworkID, stakerNodeID)
require.False(ok)
case current:
_, err := env.state.GetCurrentValidator(constants.PrimaryNetworkID, stakerNodeID)
require.NoError(err)
require.True(env.config.Validators.Contains(constants.PrimaryNetworkID, stakerNodeID))
_, ok := env.config.Validators.GetValidator(constants.PrimaryNetworkID, stakerNodeID)
require.True(ok)
}
}

for stakerNodeID, status := range test.expectedSubnetStakers {
switch status {
case pending:
require.False(env.config.Validators.Contains(subnetID, stakerNodeID))
_, ok := env.config.Validators.GetValidator(subnetID, stakerNodeID)
require.False(ok)
case current:
require.True(env.config.Validators.Contains(subnetID, stakerNodeID))
_, ok := env.config.Validators.GetValidator(subnetID, stakerNodeID)
require.True(ok)
}
}
})
Expand Down Expand Up @@ -675,8 +680,10 @@ func TestBanffStandardBlockRemoveSubnetValidator(t *testing.T) {

// Check VM Validators are removed successfully
require.NoError(block.Accept(context.Background()))
require.False(env.config.Validators.Contains(subnetID, subnetVdr2NodeID))
require.False(env.config.Validators.Contains(subnetID, subnetValidatorNodeID))
_, ok := env.config.Validators.GetValidator(subnetID, subnetVdr2NodeID)
require.False(ok)
_, ok = env.config.Validators.GetValidator(subnetID, subnetValidatorNodeID)
require.False(ok)
}

func TestBanffStandardBlockTrackedSubnet(t *testing.T) {
Expand Down Expand Up @@ -739,7 +746,8 @@ func TestBanffStandardBlockTrackedSubnet(t *testing.T) {
// update staker set
require.NoError(block.Verify(context.Background()))
require.NoError(block.Accept(context.Background()))
require.Equal(tracked, env.config.Validators.Contains(subnetID, subnetValidatorNodeID))
_, ok := env.config.Validators.GetValidator(subnetID, subnetValidatorNodeID)
require.Equal(tracked, ok)
})
}
}
Expand Down
3 changes: 2 additions & 1 deletion vms/platformvm/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -1985,7 +1985,8 @@ func (s *Service) nodeValidates(blockchainID ids.ID) bool {
return false
}

return s.vm.Validators.Contains(chain.SubnetID, s.vm.ctx.NodeID)
_, isValidator := s.vm.Validators.GetValidator(chain.SubnetID, s.vm.ctx.NodeID)
return isValidator
}

func (s *Service) chainExists(ctx context.Context, blockID ids.ID, chainID ids.ID) (bool, error) {
Expand Down
Loading