Skip to content

Commit

Permalink
Fix signature verification and /validators/eth1deposits page (closes #18
Browse files Browse the repository at this point in the history
, closes #19)
  • Loading branch information
k1rill-fedoseev committed Aug 7, 2021
1 parent fc4098b commit 13f8ca0
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 15 deletions.
8 changes: 5 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ services:


postgres:
image: postgres:12.0
image: postgres:13-alpine
container_name: postgres
restart: always
environment:
Expand All @@ -27,8 +27,10 @@ services:
- POSTGRES_DB=db
- PGDATA=/postgresql/data
volumes:
- db:/postgresql/data
network_mode: host
- ./pg_db:/postgresql/data
- ./tables.sql:/docker-entrypoint-initdb.d/tables.sql
ports:
- '5432:5432'

prysm:
image: gcr.io/prysmaticlabs/prysm/beacon-chain:latest
Expand Down
7 changes: 7 additions & 0 deletions exporter/eth1.go
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,13 @@ func VerifyEth1DepositSignature(obj *ethpb.Deposit_Data) error {
cfg.ZeroHash[:],
)
}
if utils.Config.Chain.Network == "stake" {
domain, err = ComputeDomain(
cfg.DomainDeposit,
[]byte{0x00, 0x00, 0x64, 0x64},
cfg.ZeroHash[:],
)
}
if err != nil {
return fmt.Errorf("could not get domain: %w", err)
}
Expand Down
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ require (
github.com/gofrs/uuid v3.3.0+incompatible // indirect
github.com/gogo/protobuf v1.3.1
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/google/go-querystring v1.0.0
github.com/gorilla/context v1.1.1
github.com/gorilla/csrf v1.7.0
github.com/gorilla/mux v1.8.0
Expand Down Expand Up @@ -65,7 +64,6 @@ require (
golang.org/x/text v0.3.6
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect
google.golang.org/api v0.44.0
google.golang.org/appengine v1.6.7
google.golang.org/genproto v0.0.0-20210415145412-64678f1ae2d5
google.golang.org/grpc v1.37.0
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
Expand Down
1 change: 0 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,6 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk=
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g=
Expand Down
11 changes: 3 additions & 8 deletions tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -606,9 +606,7 @@ CREATE TABLE stats_process (
sync_eth2_fallback_configured bool not null,
sync_eth2_fallback_connected bool not null,

meta_id bigint not null,

foreign key(meta_id) references stats_meta(id)
meta_id bigint not null
);
create index idx_stats_process_metaid on stats_process (meta_id);

Expand Down Expand Up @@ -673,11 +671,8 @@ CREATE TABLE stats_system (

misc_node_boot_ts_seconds bigint not null,
misc_os character varying(6) not null,

meta_id bigint not null,


foreign key(meta_id) references stats_meta(id)

meta_id bigint not null
);

create index idx_stats_system_meta_id on stats_system (meta_id);
Expand Down
2 changes: 1 addition & 1 deletion types/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ type Config struct {
Frontend struct {
Kong string `yaml:"kong" envconfig:"FRONTEND_KONG"`
OnlyAPI bool `yaml:"onlyAPI" envconfig:"FRONTEND_ONLY_API"`
CsrfAuthKey string `yaml:"csrfAuthKey" envconfig:"FRONTEND_CSRF_AUTHKEY`
CsrfAuthKey string `yaml:"csrfAuthKey" envconfig:"FRONTEND_CSRF_AUTHKEY"`
CsrfInsecure bool `yaml:"csrfInsecure" envconfig:"FRONTEND_CSRF_INSECURE"`
DisableCharts bool `yaml:"disableCharts" envconfig:"disableCharts"`
RecaptchaSiteKey string `yaml:"recaptchaSiteKey" envconfig:"FRONTEND_RECAPTCHA_SITEKEY"`
Expand Down

0 comments on commit 13f8ca0

Please sign in to comment.