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

Temporarily disable p2p id checks (for public testnet upgrade) #2468

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 8 additions & 4 deletions go/registry/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -501,10 +501,12 @@ func VerifyRegisterNodeArgs( // nolint: gocyclo

// Validate P2PInfo.
if !n.P2P.ID.IsValid() {
logger.Error("RegisterNode: invalid P2P id",
// XXX: Validate P2P.ID after existing deployments have cleared up registry.
// https://github.com/oasislabs/oasis-core/issues/2428
logger.Warn("RegisterNode: invalid P2P id",
"node", n,
)
return nil, ErrInvalidArgument
//return nil, ErrInvalidArgument
}
p2pAddressRequired := n.HasRoles(P2PAddressRequiredRoles)
if err := verifyAddresses(params, p2pAddressRequired, n.P2P.Addresses); err != nil {
Expand Down Expand Up @@ -554,11 +556,13 @@ func VerifyRegisterNodeArgs( // nolint: gocyclo
return nil, ErrInvalidArgument
}
if existingNode != nil && existingNode.ID != n.ID {
logger.Error("RegisterNode: duplicate node p2p ID",
// XXX: Validate P2P.ID after existing deployments have cleared up registry.
// https://github.com/oasislabs/oasis-core/issues/2428
logger.Warn("RegisterNode: duplicate node p2p ID",
"node_id", n.ID,
"existing_node_id", existingNode.ID,
)
return nil, ErrInvalidArgument
//return nil, ErrInvalidArgument
}

existingNode, err = nodeLookup.NodeByCertificate(n.Committee.Certificate)
Expand Down
20 changes: 12 additions & 8 deletions go/registry/tests/tester.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,13 @@ func testRegistryEntityNodes( // nolint: gocyclo
require.Error(err, "register node with reserved roles")
require.Equal(err, api.ErrInvalidArgument)

if v.Node.Roles&node.RoleComputeWorker != 0 {
err = v.Register(consensus, v.SignedInvalidRegistration6)
require.Error(err, "register node without a valid p2p id")
require.Equal(err, api.ErrInvalidArgument)
}
// XXX: Validate P2P.ID after existing deployments have cleared up registry.
// https://github.com/oasislabs/oasis-core/issues/2428
// if v.Node.Roles&node.RoleComputeWorker != 0 {
// err = v.Register(consensus, v.SignedInvalidRegistration6)
// require.Error(err, "register node without a valid p2p id")
// require.Equal(err, api.ErrInvalidArgument)
//}

err = v.Register(consensus, v.SignedInvalidRegistration7)
require.Error(err, "register node without runtimes")
Expand Down Expand Up @@ -197,9 +199,11 @@ func testRegistryEntityNodes( // nolint: gocyclo
require.NoError(err, "GetNode")
require.EqualValues(v.Node, nod, "retrieved node")

err = v.Register(consensus, v.SignedInvalidRegistration11)
require.Error(err, "register node with duplicate p2p id")
require.Equal(err, api.ErrInvalidArgument)
// XXX: Validate P2P.ID after existing deployments have cleared up registry.
// https://github.com/oasislabs/oasis-core/issues/2428
// err = v.Register(consensus, v.SignedInvalidRegistration11)
// require.Error(err, "register node with duplicate p2p id")
// require.Equal(err, api.ErrInvalidArgument)

err = v.Register(consensus, v.SignedInvalidRegistration12)
require.Error(err, "register node with duplicate consensus id")
Expand Down