From 933d522b827b5f4643f6e195fd4391a99900a315 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Thu, 14 Nov 2024 22:44:08 +0300 Subject: [PATCH] block: explain protocol extensions better Signed-off-by: Roman Khimov --- pkg/core/block/header.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkg/core/block/header.go b/pkg/core/block/header.go index efc6c5efe..9ca72f1b6 100644 --- a/pkg/core/block/header.go +++ b/pkg/core/block/header.go @@ -16,7 +16,8 @@ import ( // VersionInitial is the default Neo block version. const VersionInitial uint32 = 0 -// Header holds the base info of a block. +// Header holds the base info of a block. Fields follow the P2P format of the +// N3 block header unless noted specifically. type Header struct { // Version of the block. Version uint32 @@ -46,8 +47,13 @@ type Header struct { Script transaction.Witness // StateRootEnabled specifies if the header contains state root. + // It's NeoGo-specific, and is not a part of a standard Neo N3 header, + // it's also never serialized into P2P payload. When it's false + // PrevStateRoot is always zero, when true it works as intended. StateRootEnabled bool - // PrevStateRoot is the state root of the previous block. + // PrevStateRoot is the state root of the previous block. This field + // is relevant only if StateRootEnabled is true which is a + // NeoGo-specific extension of the protocol. PrevStateRoot util.Uint256 // PrimaryIndex is the index of the primary consensus node for this block. PrimaryIndex byte