Skip to content

Commit

Permalink
Merge pull request #8 from skylenet/make-deposit-signature-valid
Browse files Browse the repository at this point in the history
set genesis fork version based on phase0 so that signatures are valid
  • Loading branch information
parithosh committed Dec 23, 2021
2 parents b8b7b59 + c3e25ef commit c964ffa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion exporter/eth1.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ package exporter

import (
"context"
"encoding/hex"
"eth2-exporter/db"
"eth2-exporter/types"
"eth2-exporter/utils"
"fmt"
"math/big"
"regexp"
"strings"
"time"

"github.com/ethereum/go-ethereum"
Expand Down Expand Up @@ -158,9 +160,13 @@ func fetchEth1Deposits(fromBlock, toBlock uint64) (depositsToSave []*types.Eth1D
txsToFetch := []string{}

cfg := params.BeaconConfig()
genForkVersion, err := hex.DecodeString(strings.Replace(utils.Config.Chain.Phase0.GenesisForkVersion, "0x", "", -1))
if err != nil {
return nil, err
}
domain, err := helpers.ComputeDomain(
cfg.DomainDeposit,
cfg.GenesisForkVersion,
genForkVersion,
cfg.ZeroHash[:],
)
if utils.Config.Chain.Network == "zinken" {
Expand Down
2 changes: 2 additions & 0 deletions types/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ type Config struct {
type Phase0 struct {
ConfigName string `yaml:"CONFIG_NAME"` // the name of the configuration e.g. mainnet

GenesisForkVersion string `yaml:"GENESIS_FORK_VERSION"`

// Misc constants.
MaxCommitteesPerSlot uint64 `yaml:"MAX_COMMITTEES_PER_SLOT"` // MaxCommitteesPerSlot defines the max amount of committee in a single slot.
TargetCommitteeSize uint64 `yaml:"TARGET_COMMITTEE_SIZE"` // TargetCommitteeSize is the number of validators in a committee when the chain is healthy.
Expand Down

0 comments on commit c964ffa

Please sign in to comment.