Skip to content

EraE support#9458

Closed
Nurchik wants to merge 9 commits intomasterfrom
feature/erae-support
Closed

EraE support#9458
Nurchik wants to merge 9 commits intomasterfrom
feature/erae-support

Conversation

@Nurchik
Copy link
Copy Markdown

@Nurchik Nurchik commented Oct 14, 2025

WIP

Fixes #9378

Changes

  • WIP

Types of changes

What types of changes does your code introduce?

  • Bugfix (a non-breaking change that fixes an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a change that causes existing functionality not to work as expected)
  • Optimization
  • Refactoring
  • Documentation update
  • Build-related changes
  • Other: Description

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

Notes on testing

Optional. Remove if not applicable.

Documentation

Requires documentation update

  • Yes
  • No

If yes, link the PR to the docs update or the issue with the details labeled docs. Remove if not applicable.

Requires explanation in Release Notes

  • Yes
  • No

If yes, fill in the details here. Remove if not applicable.

Remarks

Optional. Remove if not applicable.

…Importer, EraExporter, and EraStore, while enhancing E2StoreReader and EraWriter for improved functionality and structure. Update interfaces and configurations to support the new EraE format.

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is redundant:

Suggested change
<TargetFramework>net9.0</TargetFramework>

Copy link
Copy Markdown
Contributor

@Marchhill Marchhill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be great to add lots of tests once everything is compiling

@@ -0,0 +1,52 @@
// SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited
// SPDX-FileCopyrightText: 2025 Demerzel Solutions Limited

use up to date year for new files

internal class AccumulatorCalculator : IDisposable
public class AccumulatorCalculator : IDisposable
{
ArrayPoolList<ReadOnlyMemory<byte>> _roots;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ArrayPoolList<ReadOnlyMemory<byte>> _roots;
private readonly ArrayPoolList<ReadOnlyMemory<byte>> _roots;

public ReceiptMessageDecoder(bool skipStateAndStatus = false, bool skipBloom = false)
{
_skipStateAndStatus = skipStateAndStatus;
_skipBloom = skipBloom;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this needed?

using Nethermind.Core.Crypto;
using Nethermind.Serialization.Ssz;

namespace Nethermind.Serialization.Rlp;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

give file more specific name than Structs. Also move to Nethermind.Serialization.SSZ since it's SSZ not RLP encoding

[SszVector(32)]
public byte[] Data { get; set; }

public ValueHash256 Hash => new(Data);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use readonly where possible

IBlockValidator blockValidator,
IFileSystem fileSystem,
IEraConfig eraConfig
) : Era1.EraStoreFactory(specProvider, blockValidator, fileSystem, new Era1.EraConfig { NetworkName = eraConfig.NetworkName, MaxEra1Size = eraConfig.MaxEraESize, Concurrency = eraConfig.Concurrency }), IEraStoreFactory
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to use eg. _specProvider inside the class, can't use specProvider and pass to base class


private bool VerifyEpochAccumulator(ArrayPoolList<(Hash256, UInt256)> blockHashes, ValueHash256 accumulator) {
using AccumulatorCalculator calculator = new();
foreach (var valueTuple in blockHashes.AsSpan())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use explicit types

return hash;
}
catch (EraException) {
return null; // accumulator is not available for this era
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should do something here?

catch (EraException) {
return null; // accumulator is not available for this era
}
catch (Exception e) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

catch specific exceptions

{
int totalBytesRead = 0;
// read bytes from the stream until the end and write to this stream
var buffer = new byte[1024 * 1024];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider using ArrayPoolList

@svlachakis
Copy link
Copy Markdown
Contributor

#10812

@svlachakis svlachakis closed this Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EraE Import / Export

4 participants