Conversation
…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> |
There was a problem hiding this comment.
This is redundant:
| <TargetFramework>net9.0</TargetFramework> |
Marchhill
left a comment
There was a problem hiding this comment.
would be great to add lots of tests once everything is compiling
| @@ -0,0 +1,52 @@ | |||
| // SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited | |||
There was a problem hiding this comment.
| // 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; |
There was a problem hiding this comment.
| ArrayPoolList<ReadOnlyMemory<byte>> _roots; | |
| private readonly ArrayPoolList<ReadOnlyMemory<byte>> _roots; |
| public ReceiptMessageDecoder(bool skipStateAndStatus = false, bool skipBloom = false) | ||
| { | ||
| _skipStateAndStatus = skipStateAndStatus; | ||
| _skipBloom = skipBloom; |
| using Nethermind.Core.Crypto; | ||
| using Nethermind.Serialization.Ssz; | ||
|
|
||
| namespace Nethermind.Serialization.Rlp; |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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()) |
| return hash; | ||
| } | ||
| catch (EraException) { | ||
| return null; // accumulator is not available for this era |
There was a problem hiding this comment.
should do something here?
| catch (EraException) { | ||
| return null; // accumulator is not available for this era | ||
| } | ||
| catch (Exception e) { |
There was a problem hiding this comment.
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]; |
There was a problem hiding this comment.
consider using ArrayPoolList
WIP
Fixes #9378
Changes
Types of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?
Notes on testing
Optional. Remove if not applicable.
Documentation
Requires documentation update
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
If yes, fill in the details here. Remove if not applicable.
Remarks
Optional. Remove if not applicable.