From 775456471c3ae35e8396ad64ea88a0502657fdf3 Mon Sep 17 00:00:00 2001 From: Fernando Diaz Toledano Date: Wed, 21 Feb 2024 14:20:42 +0100 Subject: [PATCH 1/7] Extend version --- src/RpcServer/RpcServer.Node.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/RpcServer/RpcServer.Node.cs b/src/RpcServer/RpcServer.Node.cs index b28820f2f..3e563f110 100644 --- a/src/RpcServer/RpcServer.Node.cs +++ b/src/RpcServer/RpcServer.Node.cs @@ -73,6 +73,7 @@ protected virtual JToken GetVersion(JArray _params) json["nonce"] = LocalNode.Nonce; json["useragent"] = LocalNode.UserAgent; json["protocol"] = new JObject(); + // system settings json["protocol"]["addressversion"] = system.Settings.AddressVersion; json["protocol"]["network"] = system.Settings.Network; json["protocol"]["validatorscount"] = system.Settings.ValidatorsCount; @@ -82,6 +83,7 @@ protected virtual JToken GetVersion(JArray _params) json["protocol"]["maxtransactionsperblock"] = system.Settings.MaxTransactionsPerBlock; json["protocol"]["memorypoolmaxtransactions"] = system.Settings.MemoryPoolMaxTransactions; json["protocol"]["initialgasdistribution"] = system.Settings.InitialGasDistribution; + // hardforks json["protocol"]["hardforks"] = new JArray(system.Settings.Hardforks.Select(hf => { JObject forkJson = new(); @@ -90,6 +92,9 @@ protected virtual JToken GetVersion(JArray _params) forkJson["blockheight"] = hf.Value; return forkJson; })); + // rpc settings + json["protocol"]["maxiteratorresultitems "] = settings.MaxIteratorResultItems; + json["protocol"]["sessionenabled"] = settings.SessionEnabled; return json; } From 6d1e41aae010a4e4d9aa9d0a339b1e1b99364dcb Mon Sep 17 00:00:00 2001 From: Shargon Date: Wed, 21 Feb 2024 05:24:17 -0800 Subject: [PATCH 2/7] Update src/RpcServer/RpcServer.Node.cs --- src/RpcServer/RpcServer.Node.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/RpcServer/RpcServer.Node.cs b/src/RpcServer/RpcServer.Node.cs index 3e563f110..3bf936d4a 100644 --- a/src/RpcServer/RpcServer.Node.cs +++ b/src/RpcServer/RpcServer.Node.cs @@ -83,7 +83,6 @@ protected virtual JToken GetVersion(JArray _params) json["protocol"]["maxtransactionsperblock"] = system.Settings.MaxTransactionsPerBlock; json["protocol"]["memorypoolmaxtransactions"] = system.Settings.MemoryPoolMaxTransactions; json["protocol"]["initialgasdistribution"] = system.Settings.InitialGasDistribution; - // hardforks json["protocol"]["hardforks"] = new JArray(system.Settings.Hardforks.Select(hf => { JObject forkJson = new(); From 795171e93625b8ef2812a71dff553c6c841c4d0b Mon Sep 17 00:00:00 2001 From: Shargon Date: Wed, 21 Feb 2024 06:34:10 -0800 Subject: [PATCH 3/7] Update RpcServer.Node.cs --- src/RpcServer/RpcServer.Node.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/RpcServer/RpcServer.Node.cs b/src/RpcServer/RpcServer.Node.cs index 3bf936d4a..d4d1a1cde 100644 --- a/src/RpcServer/RpcServer.Node.cs +++ b/src/RpcServer/RpcServer.Node.cs @@ -92,8 +92,10 @@ protected virtual JToken GetVersion(JArray _params) return forkJson; })); // rpc settings - json["protocol"]["maxiteratorresultitems "] = settings.MaxIteratorResultItems; - json["protocol"]["sessionenabled"] = settings.SessionEnabled; + JObject rpc = new(); + rpc["maxiteratorresultitems "] = settings.MaxIteratorResultItems; + rpc["sessionenabled"] = settings.SessionEnabled; + json["protocol"]["rpc"] = rpc; return json; } From 35a32773edafdf3b3dc028b918821e816b46cdcd Mon Sep 17 00:00:00 2001 From: Shargon Date: Wed, 21 Feb 2024 06:36:40 -0800 Subject: [PATCH 4/7] Update RpcServer.Node.cs --- src/RpcServer/RpcServer.Node.cs | 34 +++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/src/RpcServer/RpcServer.Node.cs b/src/RpcServer/RpcServer.Node.cs index d4d1a1cde..e4cf3f258 100644 --- a/src/RpcServer/RpcServer.Node.cs +++ b/src/RpcServer/RpcServer.Node.cs @@ -73,17 +73,22 @@ protected virtual JToken GetVersion(JArray _params) json["nonce"] = LocalNode.Nonce; json["useragent"] = LocalNode.UserAgent; json["protocol"] = new JObject(); - // system settings - json["protocol"]["addressversion"] = system.Settings.AddressVersion; - json["protocol"]["network"] = system.Settings.Network; - json["protocol"]["validatorscount"] = system.Settings.ValidatorsCount; - json["protocol"]["msperblock"] = system.Settings.MillisecondsPerBlock; - json["protocol"]["maxtraceableblocks"] = system.Settings.MaxTraceableBlocks; - json["protocol"]["maxvaliduntilblockincrement"] = system.Settings.MaxValidUntilBlockIncrement; - json["protocol"]["maxtransactionsperblock"] = system.Settings.MaxTransactionsPerBlock; - json["protocol"]["memorypoolmaxtransactions"] = system.Settings.MemoryPoolMaxTransactions; - json["protocol"]["initialgasdistribution"] = system.Settings.InitialGasDistribution; - json["protocol"]["hardforks"] = new JArray(system.Settings.Hardforks.Select(hf => + // rpc settings + JObject rpc = new(); + rpc["maxiteratorresultitems "] = settings.MaxIteratorResultItems; + rpc["sessionenabled"] = settings.SessionEnabled; + // protocol settings + JObject protocol = new(); + protocol["addressversion"] = system.Settings.AddressVersion; + protocol["network"] = system.Settings.Network; + protocol["validatorscount"] = system.Settings.ValidatorsCount; + protocol["msperblock"] = system.Settings.MillisecondsPerBlock; + protocol["maxtraceableblocks"] = system.Settings.MaxTraceableBlocks; + protocol["maxvaliduntilblockincrement"] = system.Settings.MaxValidUntilBlockIncrement; + protocol["maxtransactionsperblock"] = system.Settings.MaxTransactionsPerBlock; + protocol["memorypoolmaxtransactions"] = system.Settings.MemoryPoolMaxTransactions; + protocol["initialgasdistribution"] = system.Settings.InitialGasDistribution; + protocol["hardforks"] = new JArray(system.Settings.Hardforks.Select(hf => { JObject forkJson = new(); // Strip "HF_" prefix. @@ -91,11 +96,8 @@ protected virtual JToken GetVersion(JArray _params) forkJson["blockheight"] = hf.Value; return forkJson; })); - // rpc settings - JObject rpc = new(); - rpc["maxiteratorresultitems "] = settings.MaxIteratorResultItems; - rpc["sessionenabled"] = settings.SessionEnabled; - json["protocol"]["rpc"] = rpc; + protocol["rpc"] = rpc; + json["protocol"] = protocol; return json; } From 70a8655b32e93cdf3df63cd22c3baa9ef72b0ca4 Mon Sep 17 00:00:00 2001 From: Shargon Date: Wed, 21 Feb 2024 06:38:19 -0800 Subject: [PATCH 5/7] Update src/RpcServer/RpcServer.Node.cs --- src/RpcServer/RpcServer.Node.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/RpcServer/RpcServer.Node.cs b/src/RpcServer/RpcServer.Node.cs index e4cf3f258..ae01abd39 100644 --- a/src/RpcServer/RpcServer.Node.cs +++ b/src/RpcServer/RpcServer.Node.cs @@ -75,7 +75,7 @@ protected virtual JToken GetVersion(JArray _params) json["protocol"] = new JObject(); // rpc settings JObject rpc = new(); - rpc["maxiteratorresultitems "] = settings.MaxIteratorResultItems; + rpc["maxiteratorresultitems"] = settings.MaxIteratorResultItems; rpc["sessionenabled"] = settings.SessionEnabled; // protocol settings JObject protocol = new(); From 98fdd574255cd102ade692e912c1ce46852cbd6c Mon Sep 17 00:00:00 2001 From: Shargon Date: Sun, 25 Feb 2024 23:31:53 +0100 Subject: [PATCH 6/7] Update src/RpcServer/RpcServer.Node.cs Co-authored-by: Owen Zhang <38493437+superboyiii@users.noreply.github.com> --- src/RpcServer/RpcServer.Node.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/RpcServer/RpcServer.Node.cs b/src/RpcServer/RpcServer.Node.cs index ae01abd39..c02fbcf97 100644 --- a/src/RpcServer/RpcServer.Node.cs +++ b/src/RpcServer/RpcServer.Node.cs @@ -96,7 +96,7 @@ protected virtual JToken GetVersion(JArray _params) forkJson["blockheight"] = hf.Value; return forkJson; })); - protocol["rpc"] = rpc; + json["rpc"] = rpc; json["protocol"] = protocol; return json; } From 12ccd6810248a7d89670a9a8f72c46a33cb39810 Mon Sep 17 00:00:00 2001 From: Shargon Date: Mon, 26 Feb 2024 15:17:02 +0100 Subject: [PATCH 7/7] Update RpcServer.Node.cs --- src/RpcServer/RpcServer.Node.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/RpcServer/RpcServer.Node.cs b/src/RpcServer/RpcServer.Node.cs index c02fbcf97..1b08e62db 100644 --- a/src/RpcServer/RpcServer.Node.cs +++ b/src/RpcServer/RpcServer.Node.cs @@ -72,7 +72,6 @@ protected virtual JToken GetVersion(JArray _params) json["tcpport"] = localNode.ListenerTcpPort; json["nonce"] = LocalNode.Nonce; json["useragent"] = LocalNode.UserAgent; - json["protocol"] = new JObject(); // rpc settings JObject rpc = new(); rpc["maxiteratorresultitems"] = settings.MaxIteratorResultItems;