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

RLP decoding #687

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

RLP decoding #687

wants to merge 2 commits into from

Conversation

rodiazet
Copy link
Collaborator

  • Implement RLP decoding for basic types
  • Use it to implement Transaction decoding.
  • Add unit tests

@codecov
Copy link

codecov bot commented Aug 16, 2023

Codecov Report

Merging #687 (0045be6) into master (78ad5fe) will increase coverage by 0.09%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #687      +/-   ##
==========================================
+ Coverage   97.60%   97.69%   +0.09%     
==========================================
  Files          95       96       +1     
  Lines        8645     8985     +340     
==========================================
+ Hits         8438     8778     +340     
  Misses        207      207              
Flag Coverage Δ
blockchaintests 62.37% <ø> (ø)
statetests 69.74% <0.00%> (-3.74%) ⬇️
statetests-silkpre 21.79% <0.00%> (-0.85%) ⬇️
unittests 95.75% <100.00%> (+0.16%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
test/state/rlp.cpp 100.00% <100.00%> (ø)
test/state/rlp.hpp 100.00% <100.00%> (ø)
test/state/state.cpp 98.99% <100.00%> (+0.22%) ⬆️
test/state/state.hpp 100.00% <ø> (ø)
test/unittests/state_rlp_test.cpp 99.79% <100.00%> (+0.14%) ⬆️

@@ -119,4 +121,116 @@ inline bytes internal::encode_container(InputIterator begin, InputIterator end)
content += encode(*it);
return wrap_list(content);
}

// Load unsigned integral from bytes_view. The destination size must not me smaller than input data.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// Load unsigned integral from bytes_view. The destination size must not me smaller than input data.
// Load unsigned integral from bytes_view. The destination size must not be smaller than input data.

Put this comment above load()

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@@ -127,7 +127,7 @@ struct Transaction

Type type = Type::legacy;
bytes data;
int64_t gas_limit;
int64_t gas_limit{};
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
int64_t gas_limit{};
int64_t gas_limit = 0;

to be consistent with initializations below

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@@ -0,0 +1,90 @@
// evmone: Fast Ethereum Virtual Machine implementation
// Copyright 2021 The evmone Authors.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// Copyright 2021 The evmone Authors.
// Copyright 2023 The evmone Authors.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@rodiazet rodiazet changed the title Rlp decoding RLP decoding Sep 28, 2023
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.

2 participants