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

refactor trie package a bit #171

Merged
merged 4 commits into from
Nov 15, 2019
Merged

refactor trie package a bit #171

merged 4 commits into from
Nov 15, 2019

Conversation

mandrigin
Copy link
Collaborator

fixes #129

@mandrigin mandrigin changed the base branch from master to issue-126-v2 November 15, 2019 11:55
@mandrigin mandrigin changed the base branch from issue-126-v2 to master November 15, 2019 12:31
Copy link
Contributor

@JekaMas JekaMas left a comment

Choose a reason for hiding this comment

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

lgtm

@@ -37,7 +39,7 @@ func (b RlpEncodedBytes) DoubleRLPLen() int {

func encodeBytesAsRlpToWriter(source []byte, w io.Writer, prefixGenFunc func([]byte, int, int) int, prefixBufferSize uint) error {
// > 1 byte, write a prefix or prefixes first
if len(source) > 1 || (len(source) == 1 && source[0] >= 0x80) {
if len(source) > 1 || (len(source) == 1 && source[0] >= rlp.EmptyStringCode) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Strictly speaking, in this particular case, 0x80 is not used as the encoding of the empty string. It is another constant of the RLP algorithm, which happens to be the same value as the encoding of the empty string.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is related though, otherwise how would they know if that is a prefix or not, so I understand why it is there :) But I can add a comment about that too.

@mandrigin mandrigin merged commit 7fd4b04 into master Nov 15, 2019
@mandrigin mandrigin deleted the issue-129 branch November 15, 2019 16:50
BlinkyStitt pushed a commit to llamanodes/erigon that referenced this pull request Sep 1, 2023
battlmonstr pushed a commit that referenced this pull request Sep 14, 2023
* Delete code with account, add code test

* Fix test

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
anshalshukla pushed a commit that referenced this pull request Mar 5, 2024
* save l1Blockhash separately

* add l1blockhash and ger to block info treeon injected batches

* fixed a bug on delete
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.

Merge files trie/structural.go and trie/structural_2.go
3 participants