erigon-pulse/trie/rlphacks/serializable.go
ledgerwatch dca36e8b29
Restore the functionality CalcTrieRoots (compute trie root without modifying the trie) (#327)
* Trace first block

* Fixes for CalcTrieRoots

* Timings of the CalcTrieRoot

* Fix lint

* Add memory profiling

* Reduce allocations in StreamHash

* Fix

* Fix

* Fix

* Optimise allocations

* Reuse streams

* Fixes

* Fix

* Unit test fix

* Fix lint

* Reuse hashbuilder

* No loop

* Reuse resolver

* Fixed tests

* Fix test

* Fix test

* Fix test

* Fix witness threshold

* Optimise allocations in RLP transform

* Optimise allocations in RLP transform

* Optimise branchHash

* 100 times again

* Replace ToStream with Iterator

* StreamMergeIterator

* No streams

* Amplification

* Minimise the use of hashOnly

* 100 times

* Reduce stack operations

* Reduce appends

* More optimisations

* More optimisations

* More optimisations

* local hex

* Small fix

* Remove test

* Fix lint

* Fix lint

* Fix lint

* Add test for empty

* Fix lint

* More tests

* Fix lint

* Add measurement of stateless exec
2020-01-30 13:16:12 +00:00

19 lines
394 B
Go

package rlphacks
import (
"io"
)
// RlpSerializableTape is an abstraction for a tape that allows reading a sequence of
// RlpSerializable values.
type RlpSerializableTape interface {
Next() (RlpSerializable, error)
}
// RlpSerializable is a value that can be double-RLP coded.
type RlpSerializable interface {
ToDoubleRLP(io.Writer, []byte) error
DoubleRLPLen() int
RawBytes() []byte
}