mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-05-02 03:02:54 -04:00
Merge branch '__develop' into features/native-beacon-state
# Conflicts: # beacon-chain/blockchain/service.go # beacon-chain/blockchain/service_test.go # beacon-chain/core/blocks/block_operations_fuzz_test.go # beacon-chain/p2p/broadcaster_test.go # beacon-chain/powchain/service.go # beacon-chain/rpc/eth/beacon/pool_test.go # beacon-chain/state/v1/setters_attestation.go # beacon-chain/state/v1/state_trie.go # beacon-chain/state/v1/types_test.go # beacon-chain/state/v2/state_trie.go # beacon-chain/state/v3/state_trie.go # testing/util/block_test.go
This commit is contained in:
@@ -12,7 +12,7 @@ go_library(
|
||||
importpath = "github.com/prysmaticlabs/prysm/encoding/ssz",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//config/params:go_default_library",
|
||||
"//config/fieldparams:go_default_library",
|
||||
"//container/trie:go_default_library",
|
||||
"//crypto/hash:go_default_library",
|
||||
"//encoding/bytesutil:go_default_library",
|
||||
|
||||
@@ -13,8 +13,8 @@ import (
|
||||
// checks in progress are true when it reencounters them.
|
||||
// Visited comparisons are stored in a map indexed by visit.
|
||||
type visit struct {
|
||||
a1 unsafe.Pointer /* #nosec G103 */
|
||||
a2 unsafe.Pointer /* #nosec G103 */
|
||||
a1 unsafe.Pointer // #nosec G103 -- Test use only
|
||||
a2 unsafe.Pointer // #nosec G103 -- Test use only
|
||||
typ reflect.Type
|
||||
}
|
||||
|
||||
@@ -48,8 +48,8 @@ func deepValueEqual(v1, v2 reflect.Value, visited map[visit]bool, depth int) boo
|
||||
}
|
||||
|
||||
if v1.CanAddr() && v2.CanAddr() && hard(v1.Kind()) {
|
||||
addr1 := unsafe.Pointer(v1.UnsafeAddr()) /* #nosec G103 */
|
||||
addr2 := unsafe.Pointer(v2.UnsafeAddr()) /* #nosec G103 */
|
||||
addr1 := unsafe.Pointer(v1.UnsafeAddr()) // #nosec G103 -- Test compare only
|
||||
addr2 := unsafe.Pointer(v2.UnsafeAddr()) // #nosec G103 -- Test compare only
|
||||
|
||||
if uintptr(addr1) > uintptr(addr2) {
|
||||
// Canonicalize order to reduce number of entries in visited.
|
||||
@@ -139,8 +139,8 @@ func deepValueEqualExportedOnly(v1, v2 reflect.Value, visited map[visit]bool, de
|
||||
}
|
||||
|
||||
if v1.CanAddr() && v2.CanAddr() && hard(v1.Kind()) {
|
||||
addr1 := unsafe.Pointer(v1.UnsafeAddr()) /* #nosec G103 */
|
||||
addr2 := unsafe.Pointer(v2.UnsafeAddr()) /* #nosec G103 */
|
||||
addr1 := unsafe.Pointer(v1.UnsafeAddr()) // #nosec G103 -- Test compare only
|
||||
addr2 := unsafe.Pointer(v2.UnsafeAddr()) // #nosec G103 -- Test compare only
|
||||
if uintptr(addr1) > uintptr(addr2) {
|
||||
// Canonicalize order to reduce number of entries in visited.
|
||||
// Assumes non-moving garbage collector.
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"encoding/binary"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/prysmaticlabs/prysm/config/params"
|
||||
fieldparams "github.com/prysmaticlabs/prysm/config/fieldparams"
|
||||
"github.com/prysmaticlabs/prysm/crypto/hash"
|
||||
"github.com/prysmaticlabs/prysm/encoding/bytesutil"
|
||||
ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1"
|
||||
@@ -78,7 +78,7 @@ func ByteArrayRootWithLimit(roots [][]byte, limit uint64) ([32]byte, error) {
|
||||
// a list of uint64 slashing values according to the Ethereum
|
||||
// Simple Serialize specification.
|
||||
func SlashingsRoot(slashings []uint64) ([32]byte, error) {
|
||||
slashingMarshaling := make([][]byte, params.BeaconConfig().EpochsPerSlashingsVector)
|
||||
slashingMarshaling := make([][]byte, fieldparams.SlashingsLength)
|
||||
for i := 0; i < len(slashings) && i < len(slashingMarshaling); i++ {
|
||||
slashBuf := make([]byte, 8)
|
||||
binary.LittleEndian.PutUint64(slashBuf, slashings[i])
|
||||
|
||||
Reference in New Issue
Block a user