-
Notifications
You must be signed in to change notification settings - Fork 12.2k
Add RLP library #5680
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
Merged
Merged
Add RLP library #5680
Changes from all commits
Commits
Show all changes
131 commits
Select commit
Hold shift + click to select a range
9eb5f1c
Add memory utils
ernestognw 2d397f4
Fix tests upgradeable
ernestognw 2a0fb7e
Add docs
ernestognw a7e61c3
Make use of the library
ernestognw 1aae8bb
Update docs/modules/ROOT/pages/utilities.adoc
ernestognw 1b2679a
Merge branch 'master' into utils/memory
Amxx d514606
fix tests
Amxx 14fa04e
Update contracts/utils/Memory.sol
ernestognw d0d55fc
Update contracts/utils/Memory.sol
arr00 7b3cb66
Add RLP library
ernestognw 95149f8
Add TrieProof library
ernestognw ad5d4ac
up
ernestognw 18540ef
Add docs
ernestognw 163f27c
Workaround stack too deep
ernestognw c484289
Add Changesets
ernestognw e0d4790
Add more changesets
ernestognw a6f9053
Add FV and fuzz tests
ernestognw e2b5e4c
Merge branch 'master' into feature/rlp
ernestognw 203d1a2
up
ernestognw 48eabc1
docs
ernestognw 63ced95
up pragma
ernestognw f342756
Add missing Bytes test
ernestognw 23dba37
Add unit tests
ernestognw 0cacca2
up pragma
ernestognw 831e8ab
Move TrieProof
ernestognw 5da111f
Fix countLeadingZeroes
ernestognw ba2293e
nits
ernestognw 9409bc6
Improve
ernestognw e740dac
Fix
ernestognw 0332ffe
Add Memory.sol library
ernestognw 608e3cd
Merge branch 'master' into utils/memory
ernestognw ac92bb4
up
ernestognw 6094bb7
Merge branch 'master' into utils/memory
ernestognw 6bb96d5
WIP: Add more Memory functions
ernestognw 860e5a8
up
ernestognw ecdb768
revert
ernestognw 95907aa
Update docs
ernestognw 124ccee
Nit
ernestognw c3237df
Finish fuzz tests and FV
ernestognw 27f0a9b
up
ernestognw 282ce39
up
ernestognw bdd2cf1
Add operations to Math.sol
ernestognw 42c79f1
Add new equal, nibbles and countLeadingZeroes functions
ernestognw 5754ab8
Rename countLeadingZeroes to clz
ernestognw 44f0e14
up
ernestognw 05c73bd
Pragma changes
ernestognw 3a6fbf6
up
ernestognw e67e8b4
up
ernestognw 3385718
Rename to in Math library and update corresponding tests for consis…
ernestognw 40d7922
Update return types of reverseBits functions to match their respectiv…
ernestognw 89860bc
Refactor reverseBits functions in to use fixed-size byte types
ernestognw 9b58730
Test nits
ernestognw 77ffa8c
Simplify
ernestognw ce91c80
up
ernestognw b3e3add
Move reverse functions to Bytes.sol
ernestognw 2f3107c
Move Bytes.t.sol
ernestognw 4383e01
Merge branch 'master' into feat/bytes-rlp
ernestognw 5a44b11
up
ernestognw d6db2d7
Document
ernestognw 3847050
Remove extra functions
ernestognw 4fd1947
Update docs
ernestognw c4e0375
up
ernestognw acb14cb
Merge branch 'utils/memory' into feature/rlp
ernestognw 2208006
Merge branch 'feat/math-reverse-bits' into feature/rlp
ernestognw 13f4d8f
Merge branch 'feat/bytes-rlp' into feature/rlp
ernestognw 502a520
Merge branch 'master' into feature/rlp
ernestognw aab9274
Merge branch 'master' into feature/rlp
Amxx aa26e48
up
Amxx 948f0a1
Merge branch 'master' into feature/rlp
ernestognw d4bfb8b
Fix compilation
ernestognw 138de7f
Remove dangling clz
ernestognw 5efeb37
Make nibbles function private
ernestognw 00ff228
Remove nibbles test
ernestognw c58c7fd
Remove TrieProof library
ernestognw d1aa944
Add some tests
ernestognw 0925577
Merge branch 'master' into feature/rlp
ernestognw 590b7d7
Use Bytes.concat
ernestognw 8928039
Use Math.ternary
ernestognw bb027df
refactor encoding to reduce memory allocation
Amxx ec4a5c1
refactor tests to use ethers.encodeRlp as a reference
Amxx b75dc7c
fix comments
Amxx fc208c8
use mstore8 to avoid shift
Amxx fe0597c
decoding works
Amxx 106764e
Add Memory.slice and refactor RLP read/decode
Amxx b55b1db
testing
Amxx e490d79
inspired by
Amxx bde8251
remove unecessary imports
Amxx 8b6ea8c
read bool and string
Amxx dba642d
Bytes.Accumulator & RLP.encoder
Amxx 5e3ce7c
reorder
Amxx 4d39206
Merge branch 'master' into feature/rlp
Amxx 902b222
document Bytes.accumulator
Amxx b301b06
pragma fix
Amxx 1b112b2
mock stateless
Amxx 9c0e924
slither
Amxx c48e623
Memory slice doc
Amxx b10ae8c
Update enums.js
Amxx d411318
avoid load error
Amxx df528af
fuzz test Memory slices
Amxx da61a5e
coverage
Amxx fadc8ac
Merge branch 'master' into feature/rlp
Amxx 283ce7c
remove unused code
Amxx 5561d52
Merge branch 'feature/rlp' of https://github.com/ernestognw/openzeppe…
Amxx 33b57b5
Move Bytes.Accumulator to a dedicated file in utils/structs
Amxx 8b86b1b
add changeset entry
Amxx 785ae84
Update test/utils/Bytes.t.sol
Amxx 452d4b8
Update .changeset/wise-webs-fly.md
Amxx 00af6a4
pragma
Amxx 27dd119
update solidity-coverage
Amxx 93f4d4b
add slice support to Accumulator
Amxx 0e503b4
revert solidity-coverage update
Amxx 9cfaceb
Update .changeset/modern-moments-raise.md
Amxx 07f5db8
move fuzzing test
Amxx 8534802
zero out-of-slice bytes when doing load(Slice,uint256)
Amxx c3df360
doc
Amxx 8c98d4a
dec -> hex
Amxx 6efa28d
up
ernestognw 7478616
Reorder private functions
ernestognw fb62ca3
Docs
ernestognw 698221f
Add to CHANGELOG
ernestognw 5fa4c3e
Merge branch 'master' into feature/rlp
ernestognw 2bd9cc4
Delete .changeset/lovely-cooks-add.md
ernestognw fefd039
Uncomment invalid tests
ernestognw f2e5c81
up
ernestognw ff4c153
dynamic allocation of space for lists
Amxx dd242c2
use a single custom error
Amxx 46914e9
Update contracts/utils/RLP.sol
Amxx fdcb15f
Memory pointer equality
Amxx 0c5d508
test panic code of out-of-bound slice operations
Amxx 42dd3d3
Avoid Accumulators NatSpec to show up on docs sidebar
ernestognw 371595d
Pointer forward
Amxx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'openzeppelin-solidity': minor | ||
--- | ||
|
||
`RLP`: Add a library for encoding and decoding data in Ethereum's Recursive Length Prefix format. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'openzeppelin-solidity': minor | ||
--- | ||
|
||
`Memory`: Add a UDVT for handling slices on memory space similarly to calldata slices. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'openzeppelin-solidity': minor | ||
--- | ||
|
||
`Accumulators`: A library for merging an arbitrary dynamic number of bytes buffers. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ernestognw marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Any reason for this?
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.
If we're keeping it we should add it to the changelog. I did in 698221f
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.
This imports memory, and memory needs 0.24 because it does mcopy