-
Notifications
You must be signed in to change notification settings - Fork 17
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
netmap: Document memory model #276
netmap: Document memory model #276
Conversation
724bd7e
to
2886587
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The config of netmap contract must be updated wrt the same comments, notifications specified in the config must exactly match the ones used in the contract, because we have neo-project/neo#2810.
netmap/doc.go
Outdated
type: Integer | ||
- name: publicKey | ||
type: PublicKey | ||
UpdateState |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not UpdateState
, it's UpdateStateSuccess
:
neofs-contract/netmap/netmap_contract.go
Line 309 in f276e24
runtime.Notify("UpdateStateSuccess", publicKey, state) |
netmap/doc.go
Outdated
- name: publicKey | ||
type: PublicKey | ||
UpdateState | ||
- name: state |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First parameter is public key:
neofs-contract/netmap/netmap_contract.go
Line 309 in f276e24
runtime.Notify("UpdateStateSuccess", publicKey, state) |
netmap/doc.go
Outdated
AddPeer | ||
- name: nodeInfo | ||
type: ByteArray | ||
AddPeer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto, AddPeerSuccess
:
neofs-contract/netmap/netmap_contract.go
Line 710 in f276e24
runtime.Notify("AddPeerSuccess", interop.PublicKey(publicKey)) |
netmap/doc.go
Outdated
type: ByteArray | ||
AddPeer | ||
- name: nodeInfo | ||
type: ByteArray |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type is PublicKey:
neofs-contract/netmap/netmap_contract.go
Line 710 in f276e24
runtime.Notify("AddPeerSuccess", interop.PublicKey(publicKey)) |
netmap/doc.go
Outdated
type: ByteArray | ||
AddPeer | ||
- name: nodeInfo | ||
type: ByteArray | ||
|
||
UpdateState notification. This notification is produced when a Storage node wants | ||
to change its state (go offline) by invoking UpdateState method. Supported | ||
states: (2) -- offline. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are three states now, we need to fix the doc.
@AnnaShaleva thanks for your comments, they are relevant but outside the scope of this PR. I've created a bug #279. |
netmap/doc.go
Outdated
Contract records set of network parties representing the network map. Current | ||
network map is updated on each epoch tick. Contract also holds limited number | ||
of previous network maps (SNAPSHOT_LIMIT). Timestamped network maps are | ||
called snapshots. Snapshots are identified by the numerical ring [0:SNAPSHOT_LIMIT). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does "ring" mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Circular list.
netmap/doc.go
Outdated
called snapshots. Snapshots are identified by the numerical ring [0:SNAPSHOT_LIMIT). | ||
|
||
# Network map candidates | ||
Contract stores information about the network parties which were requested |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Contract stores information about the network parties which were requested | |
Contract stores information about the network parties which were accepted |
sounds more accurate IMO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are not accepted to the network map since they are candidates.
2712f11
to
8da09e2
Compare
Start package docs with commonly used format `Package netmap ...`. Signed-off-by: Leonard Lyubich <[email protected]>
Add comments (outside the docs) with key-value storage structure and some explanations. The memory mode will allow to more precisely understand and migrate the contract storage. Signed-off-by: Leonard Lyubich <[email protected]>
8da09e2
to
20c01b9
Compare
Actualize storage node's structure type and clarify this is a type not to cause misunderstanding. Signed-off-by: Leonard Lyubich <[email protected]>
I hope this will help us to carefully migrate contract data on update in future. Format suggestions are welcome. I thought about
.md
.