@@ -32,6 +32,7 @@ import (
32
32
33
33
"github.com/ethereum/go-ethereum/common"
34
34
"github.com/prysmaticlabs/prysm/v3/crypto/bls"
35
+ "github.com/stader-labs/stader-node/shared/types/config"
35
36
"github.com/stader-labs/stader-node/stader-lib/types"
36
37
eth2types "github.com/wealdtech/go-eth2-types/v2"
37
38
"golang.org/x/sync/errgroup"
@@ -62,8 +63,6 @@ const (
62
63
63
64
MaxRequestValidatorsCount = 600
64
65
threadLimit int = 6
65
-
66
- CapellaForkVersion = "0x03001020"
67
66
)
68
67
69
68
// Beacon client using the standard Beacon HTTP REST API (https://ethereum.github.io/beacon-APIs/)
@@ -411,22 +410,30 @@ func (c *StandardHttpClient) GetValidatorIndex(pubkey types.ValidatorPubkey) (ui
411
410
}
412
411
413
412
// Get domain data for a domain type at a given epoch
414
- func (c * StandardHttpClient ) GetExitDomainData (domainType []byte ) ([]byte , error ) {
413
+ func (c * StandardHttpClient ) GetExitDomainData (domainType []byte , network config. Network ) ([]byte , error ) {
415
414
416
415
var genesis GenesisResponse
417
416
418
417
genesis , err := c .getGenesis ()
419
418
420
419
// Get fork version
421
- forkVersion , err := hexutil .Decode (CapellaForkVersion )
420
+ var capellaForkVersion string
421
+ // TODO - we currently only support mainnet and testnet envs. We will have to update this as we change n/ws
422
+ if network == config .Network_Mainnet {
423
+ capellaForkVersion = eth2 .MainnetCapellaForkVersion
424
+ } else {
425
+ capellaForkVersion = eth2 .GoerliCapellaForkVersion
426
+ }
427
+
428
+ decodedForkVersion , err := hexutil .Decode (capellaForkVersion )
422
429
if err != nil {
423
430
return []byte {}, err
424
431
}
425
432
426
433
// Compute & return domain
427
434
var dt [4 ]byte
428
435
copy (dt [:], domainType [:])
429
- return eth2types .Domain (dt , forkVersion , genesis .Data .GenesisValidatorsRoot ), nil
436
+ return eth2types .Domain (dt , decodedForkVersion , genesis .Data .GenesisValidatorsRoot ), nil
430
437
431
438
}
432
439
0 commit comments