mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 03:30:35 +00:00
Use math.MaxUint64
(#9857)
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
parent
7974fe01cd
commit
341a2f1ea3
@ -3,6 +3,7 @@ package debug
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"math"
|
||||||
|
|
||||||
types "github.com/prysmaticlabs/eth2-types"
|
types "github.com/prysmaticlabs/eth2-types"
|
||||||
"github.com/prysmaticlabs/prysm/beacon-chain/core/helpers"
|
"github.com/prysmaticlabs/prysm/beacon-chain/core/helpers"
|
||||||
@ -61,7 +62,7 @@ func (ds *Server) GetInclusionSlot(ctx context.Context, req *pbrpc.InclusionSlot
|
|||||||
return nil, status.Errorf(codes.Internal, "Could not retrieve blocks: %v", err)
|
return nil, status.Errorf(codes.Internal, "Could not retrieve blocks: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
inclusionSlot := types.Slot(1<<64 - 1)
|
inclusionSlot := types.Slot(math.MaxUint64)
|
||||||
targetStates := make(map[[32]byte]state.ReadOnlyBeaconState)
|
targetStates := make(map[[32]byte]state.ReadOnlyBeaconState)
|
||||||
for _, blk := range blks {
|
for _, blk := range blks {
|
||||||
for _, a := range blk.Block().Body().Attestations() {
|
for _, a := range blk.Block().Body().Attestations() {
|
||||||
|
@ -65,8 +65,8 @@ var mainnetNetworkConfig = &NetworkConfig{
|
|||||||
|
|
||||||
var mainnetBeaconConfig = &BeaconChainConfig{
|
var mainnetBeaconConfig = &BeaconChainConfig{
|
||||||
// Constants (Non-configurable)
|
// Constants (Non-configurable)
|
||||||
FarFutureEpoch: 1<<64 - 1,
|
FarFutureEpoch: math.MaxUint64,
|
||||||
FarFutureSlot: 1<<64 - 1,
|
FarFutureSlot: math.MaxUint64,
|
||||||
BaseRewardsPerEpoch: 4,
|
BaseRewardsPerEpoch: 4,
|
||||||
DepositContractTreeDepth: 32,
|
DepositContractTreeDepth: 32,
|
||||||
GenesisDelay: 604800, // 1 week.
|
GenesisDelay: 604800, // 1 week.
|
||||||
|
@ -82,8 +82,8 @@ func MinimalSpecConfig() *BeaconChainConfig {
|
|||||||
minimalConfig.GenesisForkVersion = []byte{0, 0, 0, 1}
|
minimalConfig.GenesisForkVersion = []byte{0, 0, 0, 1}
|
||||||
|
|
||||||
minimalConfig.DepositContractTreeDepth = 32
|
minimalConfig.DepositContractTreeDepth = 32
|
||||||
minimalConfig.FarFutureEpoch = 1<<64 - 1
|
minimalConfig.FarFutureEpoch = math.MaxUint64
|
||||||
minimalConfig.FarFutureSlot = 1<<64 - 1
|
minimalConfig.FarFutureSlot = math.MaxUint64
|
||||||
|
|
||||||
// New Altair params
|
// New Altair params
|
||||||
minimalConfig.AltairForkVersion = []byte{1, 0, 0, 1} // Highest byte set to 0x01 to avoid collisions with mainnet versioning
|
minimalConfig.AltairForkVersion = []byte{1, 0, 0, 1} // Highest byte set to 0x01 to avoid collisions with mainnet versioning
|
||||||
|
@ -416,8 +416,8 @@ func TestPrevSlot(t *testing.T) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "max",
|
name: "max",
|
||||||
slot: 1<<64 - 1,
|
slot: math.MaxUint64,
|
||||||
want: 1<<64 - 1 - 1,
|
want: math.MaxUint64 - 1,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
|
Loading…
Reference in New Issue
Block a user