Skip to content
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

Add gnosis config #5057

Merged
merged 9 commits into from
Dec 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/Nethermind/Baseline.sln
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Nethermind.Runner.Test", "N
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Nethermind.Analytics", "Nethermind.Analytics\Nethermind.Analytics.csproj", "{A59A7F43-E20A-42E6-97A6-7EE3B844EF43}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nethermind.Db.Rpc", "Nethermind.Db.Rpc\Nethermind.Db.Rpc.csproj", "{1A6DBD37-B44C-4D6B-835E-5122D860563C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nethermind.Init", "Nethermind.Init\Nethermind.Init.csproj", "{8D4D6A8D-B181-4812-BC5A-004700733E9D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nethermind.Network.Dns", "Nethermind.Network.Dns\Nethermind.Network.Dns.csproj", "{F4A7633A-3D4C-4DFC-8CC3-B7A1E08E84B4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -281,6 +287,18 @@ Global
{A59A7F43-E20A-42E6-97A6-7EE3B844EF43}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A59A7F43-E20A-42E6-97A6-7EE3B844EF43}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A59A7F43-E20A-42E6-97A6-7EE3B844EF43}.Release|Any CPU.Build.0 = Release|Any CPU
{1A6DBD37-B44C-4D6B-835E-5122D860563C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1A6DBD37-B44C-4D6B-835E-5122D860563C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1A6DBD37-B44C-4D6B-835E-5122D860563C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1A6DBD37-B44C-4D6B-835E-5122D860563C}.Release|Any CPU.Build.0 = Release|Any CPU
{8D4D6A8D-B181-4812-BC5A-004700733E9D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8D4D6A8D-B181-4812-BC5A-004700733E9D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8D4D6A8D-B181-4812-BC5A-004700733E9D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8D4D6A8D-B181-4812-BC5A-004700733E9D}.Release|Any CPU.Build.0 = Release|Any CPU
{F4A7633A-3D4C-4DFC-8CC3-B7A1E08E84B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F4A7633A-3D4C-4DFC-8CC3-B7A1E08E84B4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F4A7633A-3D4C-4DFC-8CC3-B7A1E08E84B4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F4A7633A-3D4C-4DFC-8CC3-B7A1E08E84B4}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -322,6 +340,9 @@ Global
{B404F580-428B-440A-B7AE-A2B846F9568F} = {E4D07050-1288-4344-B79D-470C2DC86146}
{DFDD625C-04B4-41BC-AC5F-3F9EBFA08248} = {E4D07050-1288-4344-B79D-470C2DC86146}
{A59A7F43-E20A-42E6-97A6-7EE3B844EF43} = {E4D07050-1288-4344-B79D-470C2DC86146}
{1A6DBD37-B44C-4D6B-835E-5122D860563C} = {E4D07050-1288-4344-B79D-470C2DC86146}
{8D4D6A8D-B181-4812-BC5A-004700733E9D} = {E4D07050-1288-4344-B79D-470C2DC86146}
{F4A7633A-3D4C-4DFC-8CC3-B7A1E08E84B4} = {E4D07050-1288-4344-B79D-470C2DC86146}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F5822673-96EF-4C5C-AEC1-74D165BF8D0C}
Expand Down
263 changes: 263 additions & 0 deletions src/Nethermind/Chains/gnosis.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Nethermind/Chains/xdai.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "DaiChain",
"name": "GnosisChain",
"engine": {
"authorityRound": {
"params": {
Expand Down
281 changes: 0 additions & 281 deletions src/Nethermind/Chains/xdai_nethermind_testnet.json

This file was deleted.

284 changes: 0 additions & 284 deletions src/Nethermind/Chains/xdai_testnet.json

This file was deleted.

273 changes: 0 additions & 273 deletions src/Nethermind/Chains/xdai_themerge.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ public void Baseline_is_disabled_by_default(string configWildcard, bool enabled)
"poacore_validator.cfg",
"xdai.cfg",
"xdai_archive.cfg",
"xdai_validator.cfg",
"spaceneth.cfg",
"spaceneth_persistent.cfg",
"volta.cfg",
Expand Down
24 changes: 12 additions & 12 deletions src/Nethermind/Nethermind.Baseline.Test/BaselineTreeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ public void Baseline_tree_fuzzer(
{
totalCountCheck += numberOfLeaves;

TestContext.WriteLine($"Adding {numberOfLeaves} at block {currentBlockNumber}");
// TestContext.WriteLine($"Adding {numberOfLeaves} at block {currentBlockNumber}");
for (int j = 0; j < numberOfLeaves; j++)
{
byte[] leafBytes = new byte[32];
Expand All @@ -563,7 +563,7 @@ public void Baseline_tree_fuzzer(
}

lastBlockWithLeavesCheck.TryPeek(out long previous);
TestContext.WriteLine($"Previous is {previous}");
// TestContext.WriteLine($"Previous is {previous}");
baselineTree.LastBlockWithLeaves.Should().Be(previous);
baselineTree.MemorizeCurrentCount(TestItem.Keccaks[currentBlockNumber], currentBlockNumber, baselineTree.Count);
lastBlockWithLeavesCheck.Push(currentBlockNumber);
Expand All @@ -573,7 +573,7 @@ public void Baseline_tree_fuzzer(
}
else
{
TestContext.WriteLine($"Block {currentBlockNumber} has no leaves");
// TestContext.WriteLine($"Block {currentBlockNumber} has no leaves");
}

historicalCountChecks[currentBlockNumber] = totalCountCheck;
Expand All @@ -582,9 +582,9 @@ public void Baseline_tree_fuzzer(

for (int j = 1; j <= currentBlockNumber; j++)
{
TestContext.WriteLine($"Creating historical at {j}");
// TestContext.WriteLine($"Creating historical at {j}");
var historicalTrie = helper.CreateHistoricalTree(address, j);
TestContext.WriteLine($"Checking if trie count ({historicalTrie.Count}) is {historicalCountChecks[j]} as expected");
// TestContext.WriteLine($"Checking if trie count ({historicalTrie.Count}) is {historicalCountChecks[j]} as expected");
historicalTrie.Count.Should().Be(historicalCountChecks[j], $"Block is {currentBlockNumber}, checking count at block {j}.");
}

Expand All @@ -594,7 +594,7 @@ public void Baseline_tree_fuzzer(
if (shouldReorg && currentBlockNumber >= 1)
{
int reorgDepth = random.Next(currentBlockNumber) + 1;
TestContext.WriteLine($"Reorganizing {reorgDepth} from {currentBlockNumber}");
// TestContext.WriteLine($"Reorganizing {reorgDepth} from {currentBlockNumber}");
uint expectedDeleteCount = historicalCountChecks[currentBlockNumber] - historicalCountChecks[currentBlockNumber - reorgDepth];
baselineTree.GoBackTo(currentBlockNumber - reorgDepth).Should().Be(expectedDeleteCount);
for (int j = 0; j < reorgDepth; j++)
Expand All @@ -606,7 +606,7 @@ public void Baseline_tree_fuzzer(
totalCountCheck = historicalCountChecks[currentBlockNumber];
baselineTree.MemorizeCurrentCount(TestItem.Keccaks[currentBlockNumber], currentBlockNumber, totalCountCheck);

TestContext.WriteLine($"Total count after reorg is {totalCountCheck} at block {currentBlockNumber}");
// TestContext.WriteLine($"Total count after reorg is {totalCountCheck} at block {currentBlockNumber}");


while (lastBlockWithLeavesCheck.Any() && lastBlockWithLeavesCheck.Peek() > currentBlockNumber)
Expand All @@ -617,7 +617,7 @@ public void Baseline_tree_fuzzer(
lastBlockWithLeavesCheck.TryPeek(out long last);
if (last != currentBlockNumber)
{
TestContext.WriteLine($"Pushing {currentBlockNumber} on test stack after reorg.");
// TestContext.WriteLine($"Pushing {currentBlockNumber} on test stack after reorg.");
// after reorg we always push a memorized count
lastBlockWithLeavesCheck.Push(currentBlockNumber);
}
Expand All @@ -632,12 +632,12 @@ private static void WriteHistory(Dictionary<long, uint> historicalCountChecks, B
{
foreach (KeyValuePair<long, uint> check in historicalCountChecks)
{
TestContext.WriteLine($" History is {check.Key}=>{check.Value} {baselineTree.Metadata.LoadBlockNumberCount(check.Key)})");
// TestContext.WriteLine($" History is {check.Key}=>{check.Value} {baselineTree.Metadata.LoadBlockNumberCount(check.Key)})");
}

TestContext.WriteLine($" Last with leaves {baselineTree.LastBlockWithLeaves}");
TestContext.WriteLine($" Last with leaves in DB {baselineTree.Metadata.LoadCurrentBlockInDb().LastBlockWithLeaves}");
TestContext.WriteLine($" Count {baselineTree.Count}");
// TestContext.WriteLine($" Last with leaves {baselineTree.LastBlockWithLeaves}");
// TestContext.WriteLine($" Last with leaves in DB {baselineTree.Metadata.LoadCurrentBlockInDb().LastBlockWithLeaves}");
// TestContext.WriteLine($" Count {baselineTree.Count}");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,26 +90,6 @@
<Link>configs\mainnet_archive.cfg</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\Nethermind.Runner\configs\ndm_consumer_goerli.cfg">
<Link>configs\ndm_consumer_goerli.cfg</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\Nethermind.Runner\configs\ndm_consumer_local.cfg">
<Link>configs\ndm_consumer_local.cfg</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\Nethermind.Runner\configs\ndm_consumer_mainnet_proxy.cfg">
<Link>configs\ndm_consumer_mainnet_proxy.cfg</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\Nethermind.Runner\configs\ndm_consumer_ropsten.cfg">
<Link>configs\ndm_consumer_ropsten.cfg</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\Nethermind.Runner\configs\ndm_consumer_ropsten_proxy.cfg">
<Link>configs\ndm_consumer_ropsten_proxy.cfg</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\Nethermind.Runner\configs\poacore.cfg">
<Link>configs\poacore.cfg</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand Down Expand Up @@ -174,12 +154,8 @@
<Link>configs\xdai_archive.cfg</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\Nethermind.Runner\configs\xdai_validator.cfg">
<Link>configs\xdai_validator.cfg</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="testBytecode">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/Nethermind/Nethermind.Network.Test/ForkInfoTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public void Fork_id_and_hash_as_expected_on_sepolia(long head, string forkHashHe
public void Fork_id_and_hash_as_expected_on_gnosis(long head, string forkHashHex, long next, string description)
{
ChainSpecLoader loader = new ChainSpecLoader(new EthereumJsonSerializer());
ChainSpec spec = loader.Load(File.ReadAllText(Path.Combine("../../../../Chains", "xdai.json")));
ChainSpec spec = loader.Load(File.ReadAllText(Path.Combine("../../../../Chains", "gnosis.json")));
ChainSpecBasedSpecProvider provider = new ChainSpecBasedSpecProvider(spec);
Test(head, KnownHashes.GnosisGenesis, forkHashHex, next, description, provider);
}
Expand Down
26 changes: 0 additions & 26 deletions src/Nethermind/Nethermind.Runner.Test/ConfigFilesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public void Required_config_files_exist(string configWildcard)

[TestCase("validators", true, true)]
[TestCase("poacore_validator.cfg", true, true)]
[TestCase("xdai_validator.cfg", true, true)]
[TestCase("spaceneth", false, false)]
[TestCase("archive", false, false)]
[TestCase("baseline", false, false)]
Expand All @@ -61,11 +60,6 @@ public void Sync_defaults_are_correct(string configWildcard, bool fastSyncEnable
[TestCase("fast", true)]
[TestCase("spaceneth", false)]
[TestCase("baseline", true)]
[TestCase("ndm_consumer_goerli.cfg", true)]
[TestCase("ndm_consumer_local.cfg", true)]
[TestCase("ndm_consumer_mainnet_proxy.cfg", false)]
[TestCase("ndm_consumer_ropsten.cfg", true)]
[TestCase("ndm_consumer_ropsten_proxy.cfg", false)]
public void Sync_is_disabled_when_needed(string configWildcard, bool isSyncEnabled)
{
Test<ISyncConfig, bool>(configWildcard, c => c.SynchronizationEnabled, isSyncEnabled);
Expand All @@ -75,11 +69,6 @@ public void Sync_is_disabled_when_needed(string configWildcard, bool isSyncEnabl
[TestCase("fast", true)]
[TestCase("spaceneth", false)]
[TestCase("baseline", true)]
[TestCase("ndm_consumer_goerli.cfg", true)]
[TestCase("ndm_consumer_local.cfg", true)]
[TestCase("ndm_consumer_mainnet_proxy.cfg", false)]
[TestCase("ndm_consumer_ropsten.cfg", true)]
[TestCase("ndm_consumer_ropsten_proxy.cfg", false)]
public void Networking_is_disabled_when_needed(string configWildcard, bool isEnabled)
{
Test<ISyncConfig, bool>(configWildcard, c => c.NetworkingEnabled, isEnabled);
Expand Down Expand Up @@ -146,19 +135,6 @@ public void Grpc_defaults(string configWildcard, bool expectedDefault)
Test<IGrpcConfig, bool>(configWildcard, c => c.Enabled, expectedDefault);
}

[TestCase("ndm_consumer_local.cfg")]
public void IsMining_enabled_for_ndm_consumer_local(string configWildcard)
{
Test<IInitConfig, bool>(configWildcard, c => c.IsMining, true);
}

// [TestCase("ndm", true)]
// [TestCase("^ndm", false)]
// public void Ndm_enabled_only_for_ndm_configs(string configWildcard, bool ndmEnabled)
// {
// Test<INdmConfig, bool>(configWildcard, c => c.Enabled, ndmEnabled);
// }

[TestCase("*")]
public void Analytics_defaults(string configWildcard)
{
Expand Down Expand Up @@ -384,7 +360,6 @@ public void Basic_configs_are_as_expected(string configWildcard, bool isProducti
[TestCase("poacore_validator.cfg", null, false)]
[TestCase("xdai.cfg", new[] { 16, 16, 16 })]
[TestCase("xdai_archive.cfg", new[] { 16, 16, 16 })]
[TestCase("xdai_validator.cfg", null, false)]
[TestCase("volta")]
public void Bloom_configs_are_as_expected(string configWildcard, int[] levels = null, bool index = true)
{
Expand Down Expand Up @@ -475,7 +450,6 @@ public void Memory_hint_is_enough(string configWildcard)
"poacore_validator.cfg",
"xdai.cfg",
"xdai_archive.cfg",
"xdai_validator.cfg",
"spaceneth.cfg",
"spaceneth_persistent.cfg",
"volta.cfg",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@
<Content Include="..\Chains\volta.json" CopyToOutputDirectory="PreserveNewest">
<Link>Chains\volta.json</Link>
</Content>
<Content Include="..\Chains\xdai.json" CopyToOutputDirectory="PreserveNewest">
<Link>Chains\xdai.json</Link>
<Content Include="..\Chains\gnosis.json" CopyToOutputDirectory="PreserveNewest">
<Link>Chains\gnosis.json</Link>
</Content>

<Content Include="..\Nethermind.Runner\configs\*.cfg" Link="configs\%(RecursiveDir)%(Filename)%(Extension)">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"Init": {
"ChainSpecPath": "chainspec/xdai.json",
"ChainSpecPath": "chainspec/gnosis.json",
"GenesisHash": "0x4f1dd23188aab3a76b463e4af801b52b1248ef073c648cbdc4c9333d3da79756",
"BaseDbPath": "nethermind_db/xdai",
"LogFileName": "xdai.logs.txt",
"BaseDbPath": "nethermind_db/gnosis",
"LogFileName": "gnosis.logs.txt",
"MemoryHint": 768000000
},
"JsonRpc": {
Expand All @@ -26,20 +26,16 @@
"MinGasPrice": "1000000000"
},
"EthStats": {
"Name": "Nethermind xDai"
"Name": "Nethermind Gnosis"
},
"Metrics": {
"NodeName": "xDai"
"NodeName": "Gnosis"
},
"Bloom": {
"IndexLevelBucketSizes": [
16,
16,
16
]
},
"Mev": {
"Enabled": true,
"MaxMergedBundles": 3
}
}
}
67 changes: 0 additions & 67 deletions src/Nethermind/Nethermind.Runner/configs/ndm_consumer_goerli.cfg

This file was deleted.

Loading