-
Notifications
You must be signed in to change notification settings - Fork 461
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
Trace/db traces #4535
Trace/db traces #4535
Conversation
src/Nethermind/Nethermind.JsonRpc.TraceStore/TraceSerializer.cs
Outdated
Show resolved
Hide resolved
src/Nethermind/Nethermind.JsonRpc.TraceStore/TraceSerializer.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, got an estimation of storage usage? |
# Conflicts: # src/Nethermind/Directory.Build.props # src/Nethermind/Nethermind.Consensus/Processing/BlockRef.cs # src/Nethermind/Nethermind.Core.Test/Collections/ArrayPoolListTests.cs # src/Nethermind/Nethermind.Core/BlockInfo.cs # src/Nethermind/Nethermind.Core/Collections/ArrayPoolList.cs # src/Nethermind/Nethermind.Core/Collections/IListExtensions.cs # src/Nethermind/Nethermind.Core/Extensions/Bytes.cs # src/Nethermind/Nethermind.Core/Resettables/ResettableList.cs # src/Nethermind/Nethermind.Db/RocksDbInitializer.cs # src/Nethermind/Nethermind.Evm/Tracing/BlockTracerBase.cs # src/Nethermind/Nethermind.Evm/Tracing/GethStyle/GethLikeBlockTracer.cs # src/Nethermind/Nethermind.Evm/Tracing/IBlockTracer.cs # src/Nethermind/Nethermind.Evm/Tracing/ITxTracer.cs # src/Nethermind/Nethermind.Evm/Tracing/ParityStyle/ParityResult.cs # src/Nethermind/Nethermind.Evm/Tracing/Proofs/ProofBlockTracer.cs # src/Nethermind/Nethermind.JsonRpc.Test/Modules/RpcModuleProviderTests.cs # src/Nethermind/Nethermind.JsonRpc.Test/Modules/TestRpcModuleProvider.cs # src/Nethermind/Nethermind.JsonRpc.Test/Modules/Trace/ParityTxTraceFromReplayConverterTest.cs # src/Nethermind/Nethermind.JsonRpc/JsonRpcService.cs # src/Nethermind/Nethermind.JsonRpc/Modules/BoundedModulePool.cs # src/Nethermind/Nethermind.JsonRpc/Modules/IRpcModulePool.cs # src/Nethermind/Nethermind.JsonRpc/Modules/IRpcModuleProvider.cs # src/Nethermind/Nethermind.JsonRpc/Modules/NullModuleProvider.cs # src/Nethermind/Nethermind.JsonRpc/Modules/RpcModuleProvider.cs # src/Nethermind/Nethermind.JsonRpc/Modules/SingletonModulePool.cs # src/Nethermind/Nethermind.JsonRpc/Modules/Subscribe/SubscribeRpcModule.cs # src/Nethermind/Nethermind.JsonRpc/Modules/Trace/ParityTxTraceFromReplay.cs # src/Nethermind/Nethermind.JsonRpc/Modules/Trace/TraceModuleFactory.cs # src/Nethermind/Nethermind.Serialization.Json/EthereumJsonSerializer.cs # src/Nethermind/Nethermind.Serialization.Json/KeccakConverter.cs # src/Nethermind/Nethermind.Serialization.Rlp/RlpDecoderExtensions.cs # src/Nethermind/Nethermind.State/IStateTracer.cs # src/Nethermind/Nethermind.State/IStorageTracer.cs # src/Nethermind/Nethermind.State/NullStorageTracer.cs
src/Nethermind/Nethermind.JsonRpc.TraceStore/DbPersistingBlockTracer.cs
Outdated
Show resolved
Hide resolved
src/Nethermind/Nethermind.JsonRpc/Modules/Trace/ParityTxTraceFromStore.cs
Show resolved
Hide resolved
if (trace is not null) | ||
{ | ||
FilterTrace(trace, traceTypes); | ||
result = ResultWrapper<T>.Success(map(trace)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NP: Another idea is to create a Map
method to ResultWrapper
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if I understood, but I think like this it is better separated to map just trace types instead of JSON RPC types
Span<byte> tracesSerialized = _traceStore.GetSpan(block.Hash!); | ||
try | ||
{ | ||
if (!tracesSerialized.IsEmpty) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NP: Prefer early return. Keep code to the left, easier to read and probably change easier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nested if
makes this hard, so there are multiple conditions to return from this path.
} | ||
|
||
traces = null; | ||
return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NP: I'm guessing returning trace directly and checking traces is null
would also work.
src/Nethermind/Nethermind.JsonRpc.TraceStore/TraceStoreRpcModule.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't see any significant issue.
# Conflicts: # src/Nethermind/Nethermind.Evm/Tracing/ITxTracer.cs
awesome |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks correct, I didn't find any bug
src/Nethermind/Nethermind.JsonRpc.TraceStore.Tests/DbPersistingBlockTracerTests.cs
Outdated
Show resolved
Hide resolved
src/Nethermind/Nethermind.JsonRpc.TraceStore.Tests/TraceStorePrunerTests.cs
Show resolved
Hide resolved
src/Nethermind/Nethermind.JsonRpc/Modules/Trace/ParityTxTraceFromReplay.cs
Outdated
Show resolved
Hide resolved
src/Nethermind/Nethermind.JsonRpc/Modules/Trace/TraceModuleFactory.cs
Outdated
Show resolved
Hide resolved
…fault on deserialization, even if not serialized
Resolves #4205, #4143
This is based on 1.14.6 version. Merge ready and Gnosis merge ready if someone wants to use it.
Changes:
EndBlockTrace
being called too early - before applying rewardsTypes of changes
What types of changes does your code introduce?
Put an
x
in the boxes that applyTesting
Requires testing
In case you checked yes, did you write tests??
Comments about testing , should you have some (optional)
Further comments (optional)
I've tested by syncing chunk of Gnosis chain. And sending RPC requests. Testing further...