Skip to content

ir: Do not create new notary requests for SN netmap entrances #2717

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

Merged
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Changelog for NeoFS Node

### Changed
- Created files are not group writable (#2589)
- IR does not create new notary requests for the SN's bootstraps but signs the received ones instead (#2717)

### Removed
- Deprecated `neofs-adm [...] inspect` commands (#2603)
Expand Down
22 changes: 2 additions & 20 deletions pkg/innerring/processors/netmap/process_peers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package netmap
import (
"encoding/hex"

netmapclient "github.com/nspcc-dev/neofs-node/pkg/morph/client/netmap"
netmapEvent "github.com/nspcc-dev/neofs-node/pkg/morph/event/netmap"
"github.com/nspcc-dev/neofs-sdk-go/netmap"
"go.uber.org/zap"
Expand Down Expand Up @@ -62,26 +61,9 @@ func (np *Processor) processAddPeer(ev netmapEvent.AddPeer) {
np.log.Info("approving network map candidate",
zap.String("key", keyString))

prm := netmapclient.AddPeerPrm{}
prm.SetNodeInfo(nodeInfo)

// In notary environments we call AddPeerIR method instead of AddPeer.
// It differs from AddPeer only by name, so we can do this in the same form.
// See https://github.com/nspcc-dev/neofs-contract/issues/154.
const methodAddPeerNotary = "addPeerIR"

// create new notary request with the original nonce
err = np.netmapClient.Morph().NotaryInvoke(
np.netmapClient.ContractAddress(),
0,
originalRequest.MainTransaction.Nonce,
nil,
methodAddPeerNotary,
nodeInfoBinary,
)

err = np.netmapClient.Morph().NotarySignAndInvokeTX(tx)
if err != nil {
np.log.Error("can't invoke netmap.AddPeer", zap.Error(err))
np.log.Error("can't sign and send notary request calling netmap.AddPeer", zap.Error(err))
}
}
}
Expand Down