mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 21:08:10 -05:00
Update go to 1.19.3 (#11630)
* Update go to 1.19.3 * Update other items to 1.19 * Update golangci-lint to latest release * Run gofmt -s with go1.19 * Huge gofmt changes Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
This commit is contained in:
@@ -18,7 +18,6 @@ This means it is the exact mirror of a token bucket.
|
||||
n := b.Add(1)
|
||||
// n == 0
|
||||
|
||||
|
||||
A Collector is a convenient way to keep track of multiple LeakyBucket's.
|
||||
Buckets are associated with string keys for fast lookup. It can dynamically
|
||||
add new buckets and automatically remove them as they become empty, freeing
|
||||
|
||||
@@ -296,11 +296,12 @@ func SplitCommaSeparated(arr []string) []string {
|
||||
//
|
||||
// Spec pseudocode definition:
|
||||
// def get_split_offset(list_size: int, chunks: int, index: int) -> int:
|
||||
// """
|
||||
// Returns a value such that for a list L, chunk count k and index i,
|
||||
// split(L, k)[i] == L[get_split_offset(len(L), k, i): get_split_offset(len(L), k, i+1)]
|
||||
// """
|
||||
// return (list_size * index) // chunks
|
||||
//
|
||||
// """
|
||||
// Returns a value such that for a list L, chunk count k and index i,
|
||||
// split(L, k)[i] == L[get_split_offset(len(L), k, i): get_split_offset(len(L), k, i+1)]
|
||||
// """
|
||||
// return (list_size * index) // chunks
|
||||
func SplitOffset(listSize, chunks, index uint64) uint64 {
|
||||
return (listSize * index) / chunks
|
||||
}
|
||||
|
||||
@@ -101,8 +101,9 @@ func (m *SparseMerkleTrie) Items() [][]byte {
|
||||
}
|
||||
|
||||
// HashTreeRoot of the Merkle trie as defined in the deposit contract.
|
||||
// Spec Definition:
|
||||
// sha256(concat(node, self.to_little_endian_64(self.deposit_count), slice(zero_bytes32, start=0, len=24)))
|
||||
//
|
||||
// Spec Definition:
|
||||
// sha256(concat(node, self.to_little_endian_64(self.deposit_count), slice(zero_bytes32, start=0, len=24)))
|
||||
func (m *SparseMerkleTrie) HashTreeRoot() ([32]byte, error) {
|
||||
enc := [32]byte{}
|
||||
depositCount := uint64(len(m.originalItems))
|
||||
|
||||
Reference in New Issue
Block a user