-
Notifications
You must be signed in to change notification settings - Fork 118
proposal: NeoFS block storage format #194
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
base: master
Are you sure you want to change the base?
proposal: NeoFS block storage format #194
Conversation
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.
Index files? Synchronization algorithm?
neofs-blocks.mediawiki
Outdated
Its structure is described further below. | ||
|
||
<pre> | ||
block_binary |
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.
I think you can just refer to "standard Neo block serialization", that's what it is in its essence.
neofs-blocks.mediawiki
Outdated
|
||
==Abstract== | ||
|
||
This proposal outlines the methodology and specifications for storing Neo blockchain blocks within |
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.
methodology
is too strong word for this.
neofs-blocks.mediawiki
Outdated
|
||
==Motivation== | ||
|
||
Neo node synchronization via P2P requires all block headers (~700 bytes each, over 1 GB per year with |
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.
headers and blocks
neofs-blocks.mediawiki
Outdated
Neo node synchronization via P2P requires all block headers (~700 bytes each, over 1 GB per year with | ||
15-second blocks) to remain available, limiting scalability as chains grow. Storing blocks in NeoFS | ||
provides a distributed alternative, reducing local storage, enabling on-demand fetches, and speeding | ||
up sync with snapshots or checkpoints. This proposal defines a NeoFS storage schema, building on |
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.
snapshots and checkpoints are for a different proposal.
neofs-blocks.mediawiki
Outdated
15-second blocks) to remain available, limiting scalability as chains grow. Storing blocks in NeoFS | ||
provides a distributed alternative, reducing local storage, enabling on-demand fetches, and speeding | ||
up sync with snapshots or checkpoints. This proposal defines a NeoFS storage schema, building on | ||
experiments (e.g., nspcc-dev/neo-go#3496) and future enhancements (#1526). |
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.
Experiments are for a different proposal section (rationale).
neofs-blocks.mediawiki
Outdated
has network magic attribute (`Magic:56753`). Each block is stored in a binary | ||
form as a separate object with a unique OID and a set of attributes: | ||
- block object identifier with block index value (`Block:1`) | ||
- primary node index (`Primary:0`) |
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.
We have it now, but I'm still thinking if its useful. I can imagine searches for block hashes/timestamps, but primary index is not so obvious (especially without a verification script hash).
neofs-blocks.mediawiki
Outdated
A single NeoFS container is used to store blocks. Each container | ||
has network magic attribute (`Magic:56753`). Each block is stored in a binary | ||
form as a separate object with a unique OID and a set of attributes: | ||
- block object identifier with block index value (`Block:1`) |
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.
Define field names first, then describe them. Examples are for a different section.
neofs-blocks.mediawiki
Outdated
form as a separate object with a unique OID and a set of attributes: | ||
- block object identifier with block index value (`Block:1`) | ||
- primary node index (`Primary:0`) | ||
- block hash in the LE form (`Hash:5412a781caf278c0736556c0e544c7cfdbb6e3c62ae221ef53646be89364566b`) |
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.
LE/BE are a bit different in C#, we can say "in hex hash representation"
neofs-blocks.mediawiki
Outdated
|
||
These attributes are stored as NeoFS object metadata alongside the binary block data. | ||
Multibyte data items are always stored in little-endian order, where the low bytes come first. | ||
Its structure is described further below. |
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.
Add a not that the object MAY have additional data after the block, it can be useful for future extensions.
neofs-blocks.mediawiki
Outdated
var-byte transactions[]; // Array of serialized transactions | ||
} | ||
</pre> | ||
|
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.
We need an example of object.
@AliceInHunterland please update accordingly, this is not likely can be reviewed with any useful suggestions from other coredevs since we know little about neofs, please just follow roman's suggestion |
1c6106c
to
674a1c2
Compare
1231891
to
6c12fbe
Compare
neofs-blocks.mediawiki
Outdated
|
||
===Block Storage Schema=== | ||
A single NeoFS container is used to store blocks and index files per network. Each container | ||
has network magic attribute (`Magic:56753`). Each block is stored in a binary |
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.
Replace direct example of Magic:56753
with description of attribute name and the form of attribute value, because this section is a specification description, examples shouldn't be placed here.
neofs-blocks.mediawiki
Outdated
===Block Storage Schema=== | ||
A single NeoFS container is used to store blocks and index files per network. Each container | ||
has network magic attribute (`Magic:56753`). Each block is stored in a binary | ||
form as a separate object with a unique OID and a set of attributes: |
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.
in a binary form
in a binary form following standard Neo block serialization rules
neofs-blocks.mediawiki
Outdated
form as a separate object with a unique OID and a set of attributes: | ||
* Block: block object identifier with block index value. | ||
* Hash: block hash in the in hex hash representation. | ||
* PrevHash: previous block hash in the in hex hash representation. | ||
* BlockTime: millisecond-precision block creation timestamp. | ||
* Timestamp: second-precision block uploading timestamp. |
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.
Ref. #194 (comment), from this description it's not quite clear that Block
, Hash
, etc. are attribute names and they are strictly fixed. I'd say that we either need additional note about it or may be even a table, something like that:
Attribute name | Attribute value |
---|---|
Block | String representation of block index in the base of 10. |
... |
The same stile can be applied to container attributes.
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 same stile can be applied to container attributes.
We have, for now, only one. Would you like a separate table for it?
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 nice to have things unified, so table also suits even for one attribute. If we won't use table, then we need at least to adjust description wrt #194 (comment).
neofs-blocks.mediawiki
Outdated
An [https://rest.fs.neo.org/v1/objects/3RCdP3ZubyKyo8qFeo7EJPryidTZaGCMdUjqFJaaEKBV/by_id/Fu7yQzspvLJwSGJNK64xeeyMdWXtU5B5b1es6KSxUag1 example] | ||
of a block object is as follows: | ||
<pre> | ||
ID: Fu7yQzspvLJwSGJNK64xeeyMdWXtU5B5b1es6KSxUag1 | ||
CID: 3RCdP3ZubyKyo8qFeo7EJPryidTZaGCMdUjqFJaaEKBV | ||
Owner: NVvY1FF67XJ2GTVhy9FqiZGC4jEQtvjmHt |
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.
Is it correct to attach object link as an example? This object/container may be removed in future whereas we expect NEP to be consistent. @roman-khimov?
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.
removed
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.
Example can be a proper example with this data if needed. It doesn't imply any of the IDs are relevant for mainnet or whatever else.
neofs-blocks.mediawiki
Outdated
* BlockTime: millisecond-precision block creation timestamp. | ||
* Timestamp: second-precision block uploading timestamp. | ||
|
||
These attributes are stored as NeoFS object metadata alongside the binary block data and can be extended. |
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.
These attributes are stored as NeoFS object metadata alongside the binary block data and can be extended. | |
These attributes are stored as NeoFS object metadata; the list of attributes MAY be extended. |
neofs-blocks.mediawiki
Outdated
==Rationale== | ||
This proposal defines a NeoFS storage schema, building on experiments (e.g., nspcc-dev/neo-go#3496) | ||
and future enhancements (#1526). |
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 the proper section for the rationale. Also, the text itself may be improved, see as an example https://github.com/neo-project/proposals/blob/master/nep-25.mediawiki#user-content-Rationale.
|
||
|
||
== Implementation == | ||
* Go: https://github.com/nspcc-dev/neo-go/blob/61992405983ddfb5547ae3afab75c22186dc966f/cli/util/uploader.go |
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.
Do we need to attach an example of NeoFSBlockFetcher as far? I think it will be useful since synchronisation algorythm is also a part of this proposal. @roman-khimov?
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.
added
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.
Can be referenced.
neofs-blocks.mediawiki
Outdated
* [https://github.com/neo-project/neo/issues/2373 Neo Issue#2373] | ||
* [https://github.com/neo-project/neo/issues/1526 Neo Issue#1526] | ||
* [https://github.com/nspcc-dev/neo-go/issues/3496 NeoGo Issue#3496] | ||
* [https://github.com/nspcc-dev/neofs-api/issues/285 NeoFS API Issue#285] |
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.
I don't think that this issue is directly related to the proposal. @roman-khimov?
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.
removed
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.
Yeah, a different story. Even quite old one.
neofs-blocks.mediawiki
Outdated
* [https://github.com/neo-project/neo/issues/3463 Neo Issue#3463] | ||
* [https://github.com/neo-project/neo/issues/2373 Neo Issue#2373] | ||
* [https://github.com/neo-project/neo/issues/1526 Neo Issue#1526] | ||
* [https://github.com/nspcc-dev/neo-go/issues/3496 NeoGo Issue#3496] |
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.
These issues should have readable description instead of just Issue#...
. See https://github.com/neo-project/proposals/blob/master/nep-23.mediawiki#references as an example.
neofs-blocks.mediawiki
Outdated
NEP: TBD | ||
Title: NeoFS block storage format | ||
Author: Ekaterina Pavlova <[email protected]> | ||
Type: Informational |
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.
To me the type of this standard looks more like Standard
rather than Informational
because we directly standardize NeoFS storage schema and building node synchronization mechanism over it. Or may be even Meta
standard, since it's not directly related to the Neo protocol, ref https://github.com/neo-project/proposals/blob/master/nep-1.mediawiki#nep-types. @roman-khimov?
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.
To me it's Informational
since there is no obligation for N3 protocol to store blocks in NeoFS and be able to synchronize from it. It's for interoperability if anyone wants to fetch blocks this way, but it's far from P2P getblocks
for example.
Signed-off-by: Ekaterina Pavlova <[email protected]>
6c12fbe
to
bf44b35
Compare
No description provided.