From 571a8f5a9a0cd718807b270c844d0b5bdaf1c4ea Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Wed, 5 Jun 2024 18:26:14 +0300 Subject: [PATCH] *: move Notary contract out of P2PSigExtensions A part of #3464. Signed-off-by: Anna Shaleva --- docs/node-configuration.md | 2 +- pkg/core/blockchain.go | 3 --- pkg/core/native/contract.go | 16 +++++++--------- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/docs/node-configuration.md b/docs/node-configuration.md index 2e635ecef6..9120be64d2 100644 --- a/docs/node-configuration.md +++ b/docs/node-configuration.md @@ -341,7 +341,7 @@ protocol-related settings described in the table below. | MaxValidUntilBlockIncrement | `uint32` | `5760` | Upper height increment limit for transaction's ValidUntilBlock field value relative to the current blockchain height, exceeding which a transaction will fail validation. It is set to estimated daily number of blocks with 15s interval by default. | | MemPoolSize | `int` | `50000` | Size of the node's memory pool where transactions are stored before they are added to block. | | P2PNotaryRequestPayloadPoolSize | `int` | `1000` | Size of the node's P2P Notary request payloads memory pool where P2P Notary requests are stored before main or fallback transaction is completed and added to the chain.
This option is valid only if `P2PSigExtensions` are enabled. | Not supported by the C# node, thus may affect heterogeneous networks functionality. | -| P2PSigExtensions | `bool` | `false` | Enables following additional Notary service related logic:
• Transaction attribute `NotaryAssisted`
• Network payload of the `P2PNotaryRequest` type
• Native `Notary` contract
• Notary node module | Not supported by the C# node, thus may affect heterogeneous networks functionality. | +| P2PSigExtensions | `bool` | `false` | Enables following additional Notary service related logic:
• Transaction attribute `NotaryAssisted`
• Network payload of the `P2PNotaryRequest` type
• Notary node module | Not supported by the C# node, thus may affect heterogeneous networks functionality. | | P2PStateExchangeExtensions | `bool` | `false` | Enables the following P2P MPT state data exchange logic:
• `StateSyncInterval` protocol setting
• P2P commands `GetMPTDataCMD` and `MPTDataCMD` | Not supported by the C# node, thus may affect heterogeneous networks functionality. Can be supported either on MPT-complete node (`KeepOnlyLatestState`=`false`) or on light GC-enabled node (`RemoveUntraceableBlocks=true`) in which case `KeepOnlyLatestState` setting doesn't change the behavior, an appropriate set of MPTs is always stored (see `RemoveUntraceableBlocks`). | | ReservedAttributes | `bool` | `false` | Allows to have reserved attributes range for experimental or private purposes. | | SeedList | `[]string` | [] | List of initial nodes addresses used to establish connectivity. | diff --git a/pkg/core/blockchain.go b/pkg/core/blockchain.go index da40bc2d54..7d5429f5df 100644 --- a/pkg/core/blockchain.go +++ b/pkg/core/blockchain.go @@ -3081,9 +3081,6 @@ func (bc *Blockchain) GetMaxVerificationGAS() int64 { // GetMaxNotValidBeforeDelta returns maximum NotValidBeforeDelta Notary limit. func (bc *Blockchain) GetMaxNotValidBeforeDelta() (uint32, error) { - if !bc.config.P2PSigExtensions { - panic("disallowed call to Notary") // critical error, thus panic. - } if !bc.isHardforkEnabled(bc.contracts.Notary.ActiveIn(), bc.BlockHeight()) { return 0, fmt.Errorf("native Notary is active starting from %s", bc.contracts.Notary.ActiveIn().String()) } diff --git a/pkg/core/native/contract.go b/pkg/core/native/contract.go index a65631d3b6..b0bd92b958 100644 --- a/pkg/core/native/contract.go +++ b/pkg/core/native/contract.go @@ -100,15 +100,13 @@ func NewContracts(cfg config.ProtocolConfiguration) *Contracts { cs.Oracle = oracle cs.Contracts = append(cs.Contracts, oracle) - if cfg.P2PSigExtensions { - notary := newNotary() - notary.GAS = gas - notary.NEO = neo - notary.Desig = desig - notary.Policy = policy - cs.Notary = notary - cs.Contracts = append(cs.Contracts, notary) - } + notary := newNotary() + notary.GAS = gas + notary.NEO = neo + notary.Desig = desig + notary.Policy = policy + cs.Notary = notary + cs.Contracts = append(cs.Contracts, notary) return cs }