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

Trie RlpStreams as structs #6584

Merged
merged 1 commit into from
Jan 21, 2024
Merged

Trie RlpStreams as structs #6584

merged 1 commit into from
Jan 21, 2024

Conversation

benaadams
Copy link
Member

Changes

Types of changes

What types of changes does your code introduce?

  • Optimization

Testing

Requires testing

  • No

@@ -673,9 +673,12 @@ public void ReadOnly_store_returns_copies(bool pruning)
readOnlyNode.Should().NotBe(originalNode);
readOnlyNode.Should().BeEquivalentTo(originalNode,
eq => eq.Including(t => t.Keccak)
.Including(t => t.RlpStream)
Copy link
Member Author

Choose a reason for hiding this comment

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

Isn't happy with ref items so rearranged to test this bit below

Copy link
Member

@LukaszRozmej LukaszRozmej left a comment

Choose a reason for hiding this comment

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

lookgs good, but lets wait for @asdacap to also take a look


namespace Nethermind.Serialization.Rlp
{
public class RlpFactory
Copy link
Member

Choose a reason for hiding this comment

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

would it make sense to make it struct?

Copy link
Member Author

Choose a reason for hiding this comment

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

Is class to have atomic writes on the CappedArray<byte> struct; which is {byte[],int} which otherwise could cause a concurrent reader to read the array but a different length from an earlier write for example; because the two items are not written atomicly.

Copy link
Contributor

@asdacap asdacap left a comment

Choose a reason for hiding this comment

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

Third RLP decoder type though. Thats unfortunate.

@benaadams benaadams merged commit 3d20677 into master Jan 21, 2024
67 checks passed
@benaadams benaadams deleted the RlpStream-as-structs branch January 21, 2024 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants