Skip to content

Commit

Permalink
netmap: add a temporary usev2 flag
Browse files Browse the repository at this point in the history
Use it for any new installations, but hold back old ones till they're migrated.

Signed-off-by: Roman Khimov <roman@nspcc.ru>
  • Loading branch information
roman-khimov committed Jan 22, 2025
1 parent 9e4da3d commit 7397069
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions contracts/netmap/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ func _deploy(data any, isUpdate bool) {

if version < 21_000 {
storage.Put(ctx, []byte(cleanupThresholdKey), defaultCleanupThreshold)
setConfig(ctx, "UseNodeV2", []byte{0})
}

return
Expand Down Expand Up @@ -214,6 +215,7 @@ func _deploy(data any, isUpdate bool) {
storage.Put(ctx, snapshotEpoch, 0)
storage.Put(ctx, snapshotBlockKey, 0)
storage.Put(ctx, []byte(cleanupThresholdKey), defaultCleanupThreshold)
setConfig(ctx, "UseNodeV2", []byte{1})

prefix := []byte(snapshotKeyPrefix)
for i := 0; i < DefaultSnapshotCount; i++ { //nolint:intrange // Not supported by NeoGo
Expand Down
Binary file modified contracts/netmap/contract.nef
Binary file not shown.
2 changes: 1 addition & 1 deletion contracts/netmap/manifest.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"NeoFS Netmap","abi":{"methods":[{"name":"_initialize","offset":0,"parameters":[],"returntype":"Void","safe":false},{"name":"_deploy","offset":93,"parameters":[{"name":"data","type":"Any"},{"name":"isUpdate","type":"Boolean"}],"returntype":"Void","safe":false},{"name":"addNode","offset":1871,"parameters":[{"name":"n","type":"Array"}],"returntype":"Void","safe":false},{"name":"addPeer","offset":1825,"parameters":[{"name":"nodeInfo","type":"ByteArray"}],"returntype":"Void","safe":false},{"name":"addPeerIR","offset":1785,"parameters":[{"name":"nodeInfo","type":"ByteArray"}],"returntype":"Void","safe":false},{"name":"cleanupThreshold","offset":4213,"parameters":[],"returntype":"Integer","safe":true},{"name":"config","offset":3637,"parameters":[{"name":"key","type":"ByteArray"}],"returntype":"Any","safe":true},{"name":"deleteNode","offset":2052,"parameters":[{"name":"pkey","type":"PublicKey"}],"returntype":"Void","safe":false},{"name":"epoch","offset":2697,"parameters":[],"returntype":"Integer","safe":true},{"name":"innerRingList","offset":1740,"parameters":[],"returntype":"Array","safe":true},{"name":"lastEpochBlock","offset":2736,"parameters":[],"returntype":"Integer","safe":false},{"name":"listCandidates","offset":2925,"parameters":[],"returntype":"InteropInterface","safe":true},{"name":"listConfig","offset":3716,"parameters":[],"returntype":"Array","safe":true},{"name":"listNodes","offset":2873,"parameters":[],"returntype":"InteropInterface","safe":true},{"name":"listNodes","offset":2881,"parameters":[{"name":"epoch","type":"Integer"}],"returntype":"InteropInterface","safe":true},{"name":"netmap","offset":2775,"parameters":[],"returntype":"Array","safe":true},{"name":"netmapCandidates","offset":2857,"parameters":[],"returntype":"Array","safe":true},{"name":"newEpoch","offset":2389,"parameters":[{"name":"epochNum","type":"Integer"}],"returntype":"Void","safe":false},{"name":"setCleanupThreshold","offset":4157,"parameters":[{"name":"val","type":"Integer"}],"returntype":"Void","safe":false},{"name":"setConfig","offset":3655,"parameters":[{"name":"id","type":"ByteArray"},{"name":"key","type":"ByteArray"},{"name":"val","type":"ByteArray"}],"returntype":"Void","safe":false},{"name":"snapshot","offset":2955,"parameters":[{"name":"diff","type":"Integer"}],"returntype":"Array","safe":true},{"name":"snapshotByEpoch","offset":3589,"parameters":[{"name":"epoch","type":"Integer"}],"returntype":"Array","safe":true},{"name":"subscribeForNewEpoch","offset":3772,"parameters":[{"name":"contract","type":"Hash160"}],"returntype":"Void","safe":false},{"name":"update","offset":1610,"parameters":[{"name":"script","type":"ByteArray"},{"name":"manifest","type":"ByteArray"},{"name":"data","type":"Any"}],"returntype":"Void","safe":false},{"name":"updateSnapshotCount","offset":3109,"parameters":[{"name":"count","type":"Integer"}],"returntype":"Void","safe":false},{"name":"updateState","offset":2298,"parameters":[{"name":"state","type":"Integer"},{"name":"publicKey","type":"PublicKey"}],"returntype":"Void","safe":false},{"name":"updateStateIR","offset":2365,"parameters":[{"name":"state","type":"Integer"},{"name":"publicKey","type":"PublicKey"}],"returntype":"Void","safe":false},{"name":"version","offset":4153,"parameters":[],"returntype":"Integer","safe":true}],"events":[{"name":"AddNode","parameters":[{"name":"publicKey","type":"PublicKey"},{"name":"addresses","type":"Array"},{"name":"attributes","type":"Map"}]},{"name":"AddPeerSuccess","parameters":[{"name":"publicKey","type":"PublicKey"}]},{"name":"UpdateStateSuccess","parameters":[{"name":"publicKey","type":"PublicKey"},{"name":"state","type":"Integer"}]},{"name":"NewEpoch","parameters":[{"name":"epoch","type":"Integer"}]},{"name":"NewEpochSubscription","parameters":[{"name":"contract","type":"Hash160"}]}]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":["update","newEpoch"]}],"supportedstandards":[],"trusts":[],"extra":null}
{"name":"NeoFS Netmap","abi":{"methods":[{"name":"_initialize","offset":0,"parameters":[],"returntype":"Void","safe":false},{"name":"_deploy","offset":93,"parameters":[{"name":"data","type":"Any"},{"name":"isUpdate","type":"Boolean"}],"returntype":"Void","safe":false},{"name":"addNode","offset":1927,"parameters":[{"name":"n","type":"Array"}],"returntype":"Void","safe":false},{"name":"addPeer","offset":1881,"parameters":[{"name":"nodeInfo","type":"ByteArray"}],"returntype":"Void","safe":false},{"name":"addPeerIR","offset":1841,"parameters":[{"name":"nodeInfo","type":"ByteArray"}],"returntype":"Void","safe":false},{"name":"cleanupThreshold","offset":4269,"parameters":[],"returntype":"Integer","safe":true},{"name":"config","offset":3693,"parameters":[{"name":"key","type":"ByteArray"}],"returntype":"Any","safe":true},{"name":"deleteNode","offset":2108,"parameters":[{"name":"pkey","type":"PublicKey"}],"returntype":"Void","safe":false},{"name":"epoch","offset":2753,"parameters":[],"returntype":"Integer","safe":true},{"name":"innerRingList","offset":1796,"parameters":[],"returntype":"Array","safe":true},{"name":"lastEpochBlock","offset":2792,"parameters":[],"returntype":"Integer","safe":false},{"name":"listCandidates","offset":2981,"parameters":[],"returntype":"InteropInterface","safe":true},{"name":"listConfig","offset":3772,"parameters":[],"returntype":"Array","safe":true},{"name":"listNodes","offset":2929,"parameters":[],"returntype":"InteropInterface","safe":true},{"name":"listNodes","offset":2937,"parameters":[{"name":"epoch","type":"Integer"}],"returntype":"InteropInterface","safe":true},{"name":"netmap","offset":2831,"parameters":[],"returntype":"Array","safe":true},{"name":"netmapCandidates","offset":2913,"parameters":[],"returntype":"Array","safe":true},{"name":"newEpoch","offset":2445,"parameters":[{"name":"epochNum","type":"Integer"}],"returntype":"Void","safe":false},{"name":"setCleanupThreshold","offset":4213,"parameters":[{"name":"val","type":"Integer"}],"returntype":"Void","safe":false},{"name":"setConfig","offset":3711,"parameters":[{"name":"id","type":"ByteArray"},{"name":"key","type":"ByteArray"},{"name":"val","type":"ByteArray"}],"returntype":"Void","safe":false},{"name":"snapshot","offset":3011,"parameters":[{"name":"diff","type":"Integer"}],"returntype":"Array","safe":true},{"name":"snapshotByEpoch","offset":3645,"parameters":[{"name":"epoch","type":"Integer"}],"returntype":"Array","safe":true},{"name":"subscribeForNewEpoch","offset":3828,"parameters":[{"name":"contract","type":"Hash160"}],"returntype":"Void","safe":false},{"name":"update","offset":1666,"parameters":[{"name":"script","type":"ByteArray"},{"name":"manifest","type":"ByteArray"},{"name":"data","type":"Any"}],"returntype":"Void","safe":false},{"name":"updateSnapshotCount","offset":3165,"parameters":[{"name":"count","type":"Integer"}],"returntype":"Void","safe":false},{"name":"updateState","offset":2354,"parameters":[{"name":"state","type":"Integer"},{"name":"publicKey","type":"PublicKey"}],"returntype":"Void","safe":false},{"name":"updateStateIR","offset":2421,"parameters":[{"name":"state","type":"Integer"},{"name":"publicKey","type":"PublicKey"}],"returntype":"Void","safe":false},{"name":"version","offset":4209,"parameters":[],"returntype":"Integer","safe":true}],"events":[{"name":"AddNode","parameters":[{"name":"publicKey","type":"PublicKey"},{"name":"addresses","type":"Array"},{"name":"attributes","type":"Map"}]},{"name":"AddPeerSuccess","parameters":[{"name":"publicKey","type":"PublicKey"}]},{"name":"UpdateStateSuccess","parameters":[{"name":"publicKey","type":"PublicKey"},{"name":"state","type":"Integer"}]},{"name":"NewEpoch","parameters":[{"name":"epoch","type":"Integer"}]},{"name":"NewEpochSubscription","parameters":[{"name":"contract","type":"Hash160"}]}]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":["update","newEpoch"]}],"supportedstandards":[],"trusts":[],"extra":null}

0 comments on commit 7397069

Please sign in to comment.