Skip to content

Commit 0834ddc

Browse files
authored
Merge pull request #110 from wealdtech/electra
Add electra support.
2 parents c14183c + 010c574 commit 0834ddc

22 files changed

Lines changed: 1428 additions & 232 deletions
Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
1-
name: golangci-lint
1+
name: 'golangci-lint'
22
on:
33
push:
44
branches:
5-
- master
5+
- 'master'
66
pull_request:
77

88
permissions:
9-
contents: read
10-
pull-requests: read
9+
contents: 'read'
10+
pull-requests: 'read'
11+
checks: 'write'
1112

1213
jobs:
1314
golangci:
14-
name: lint
15-
runs-on: ubuntu-22.04
15+
name: 'lint'
16+
runs-on: 'ubuntu-22.04'
1617
steps:
17-
- uses: actions/checkout@v4
18-
- uses: actions/setup-go@v5
18+
- uses: 'actions/setup-go@v5'
1919
with:
2020
cache: false
2121
go-version: '1.22'
22-
- name: golangci-lint
23-
uses: golangci/golangci-lint-action@v5
22+
- uses: 'actions/checkout@v4'
23+
- name: 'golangci-lint'
24+
uses: 'golangci/golangci-lint-action@v6'
2425
with:
2526
version: 'latest'
2627
args: '--timeout=60m'
28+
only-new-issues: true
2729
skip-cache: true

.golangci.yml

Lines changed: 4 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -82,35 +82,9 @@ run:
8282

8383
# output configuration options
8484
output:
85-
# Format: colored-line-number|line-number|json|tab|checkstyle|code-climate|junit-xml|github-actions
86-
#
87-
# Multiple can be specified by separating them by comma, output can be provided
88-
# for each of them by separating format name and path by colon symbol.
89-
# Output path can be either `stdout`, `stderr` or path to the file to write to.
90-
# Example: "checkstyle:report.json,colored-line-number"
91-
#
92-
# Default: colored-line-number
93-
# format: json
94-
95-
# Print lines of code with issue.
96-
# Default: true
97-
# print-issued-lines: false
98-
99-
# Print linter name in the end of issue text.
100-
# Default: true
101-
# print-linter-name: false
102-
103-
# Make issues output unique by line.
104-
# Default: true
105-
# uniq-by-line: false
106-
107-
# Add a prefix to the output file references.
108-
# Default is no prefix.
109-
# path-prefix: ""
110-
111-
# Sort results by: filepath, line and column.
112-
# sort-results: true
113-
85+
formats:
86+
- format: colored-line-number
87+
path: stderr
11488

11589
# All available settings of specific linters.
11690
linters-settings:
@@ -142,14 +116,12 @@ linters:
142116
# Disable specific linter
143117
# https://golangci-lint.run/usage/linters/#disabled-by-default
144118
disable:
145-
- contextcheck
146119
- cyclop
147120
- depguard
148121
- dupl
149122
- err113
150123
- exhaustive
151124
- exhaustruct
152-
- exportloopref
153125
- forcetypeassert
154126
- funlen
155127
- gci
@@ -160,12 +132,12 @@ linters:
160132
- inamedparam
161133
- lll
162134
- mnd
163-
- musttag
164135
- nestif
165136
- nilnil
166137
- nlreturn
167138
- perfsprint
168139
- promlinter
140+
- tenv
169141
- varnamelen
170142
- wrapcheck
171143
- wsl

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
0.9.0:
2+
- support electra
3+
- add t_block_deposit_requests for Electra
4+
- add t_block_withdrawal_requests for Electra
5+
- add t_block_consolidation_requests for Electra
6+
- move from f_committee_index to f_committee_indices (see note in README for migration information)
7+
18
0.8.9:
29
- do not store 0 validator balances (i.e. from validators that are not active, or have exited and withdrawn)
310

README.md

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,30 @@
1919
- [Contribute](#contribute)
2020
- [License](#license)
2121

22+
23+
## Notes for 0.9.0 and Electra
24+
Release 0.9.0 of `chaind` brings with it support for the Electra hard fork. A significant change in Electra is that attestations now cover multiple committees. As such, there is a new column in the `t_attestations` table called `f_committee_indices`. The existing column, called `f_committee_index`, is deprecated and will no longer be populated from this release onwards.
25+
26+
Usually in these situations `chaind` would carry out an automatic migration of data, however mainnet has over 1 billion attestations and so any migration will take a large amount of time and storage. To avoid the upgrade locking out `chaind` updates there is _no_ automatic movement of this data, however there are a number of options for existing users:
27+
28+
* leave the data as-is. If this data is required then code to query the database will need to fetch data from either the `f_committee_index` or `f_committee_indices` columns, depending on the slot time at which `chaind` was updated to release 0.9.0.
29+
* move the data manually. Data can be moved from one column to the other with the following SQL:
30+
```sql
31+
UPDATE t_attestations
32+
SET f_committee_indices = ARRAY[f_committee_index]
33+
,f_committee_index = NULL
34+
WHERE f_committee_indices IS NULL
35+
AND <slot conditions>
36+
```
37+
Where `<slot_conditions>` are conditions to restrict the attestations to a subset of all slots. This restriction is important, as otherwise the update will take a very long time and require significant disk space. It would be possible to migrate the data over time by migrating a smaller number (e.g. 100000) slots at a time.
38+
39+
Note that although `f_committee_index` is now deprecated it is not removed by the update, due to the data not being automatically migrated. If a manual migration is completed then the column can be safely dropped, as it is no longer referenced within the `chaind` codebase.
40+
2241
## Install
2342

2443
### Binaries
2544

26-
Binaries for the latest version of `chaind` can be obtained from [the releases page](https://github.com/wealdtech/chaind/releases/latest ).
45+
Binaries for the latest version of `chaind` can be obtained from [the releases page](https://github.com/wealdtech/chaind/releases/latest).
2746

2847
### Docker
2948

@@ -38,7 +57,7 @@ docker pull wealdtech/chaind
3857
`chaind` is a standard Go binary which can be installed with:
3958

4059
```sh
41-
GO111MODULE=on go get github.com/wealdtech/chaind
60+
go install github.com/wealdtech/chaind@latest
4261
```
4362

4463
## Usage
@@ -53,8 +72,13 @@ Data gathers four pieces of information from the beacon node, broken down by the
5372
- proposer slashings
5473
- attester slashings
5574
- deposits
56-
- voluntary exits; and
57-
- **Ethereum 1 deposits** The Ethereum 1 deposits module provides information on deposits made on the Ethereum 1 network;
75+
- voluntary exits
76+
- BLS to execution change requests
77+
- blobs
78+
- deposit requests
79+
- withdrawal requests
80+
- consolidation requests
81+
- **Ethereum execution deposits** The Ethereum execution deposits module provides information on deposits made on the Ethereum execution network;
5882
- **Finalizer** The finalizer module augments the information present in the database from finalized states. This includes:
5983
- the canonical state of blocks.
6084

@@ -77,9 +101,7 @@ You can also run chaind using the example docker-compose file, it setups the Pos
77101
`chaind` supports Teku and Lighthouse beacon nodes. The current state of obtaining data from beacon nodes is as follows:
78102

79103
- Teku: must be run in [archive mode](https://docs.teku.consensys.net/en/latest/Reference/CLI/CLI-Syntax/#data-storage-mode) to allow `chaind` to obtain historical data
80-
- Lighthouse: Make sure to run with `--slots-per-restore-point 64 --reconstruct-historic-states --genesis-backfill`, else fetching historical information will be **very** slow. For more information on the trade off between Freezer DB size and fetching performance, please refer to [Database Configuration](https://lighthouse-book.sigmaprime.io/advanced_database.html) in the Lighthouse Book.
81-
82-
At current Prysm is not supported due to its lack of Altair-related information in its gRPC and HTTP APIs. We expect to be able to support Prysm again soon.
104+
- Lighthouse: Make sure to run with `--reconstruct-historic-states --genesis-backfill --disable-backfill-rate-limiting`,otherwise fetching historical information will be **very** slow. For more information please refer to the [Advanced Database Configuration](https://lighthouse-book.sigmaprime.io/advanced_database.html) section in the Lighthouse Book.
83105

84106
`chaind` supports all execution nodes. The current state of obtaining data from execution nodes is as follows:
85107

go.mod

Lines changed: 42 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -5,55 +5,56 @@ go 1.22.7
55
toolchain go1.23.2
66

77
require (
8-
github.com/attestantio/go-eth2-client v0.22.0
9-
github.com/aws/aws-sdk-go v1.55.5
8+
github.com/attestantio/go-eth2-client v0.24.0
9+
github.com/aws/aws-sdk-go v1.55.6
1010
github.com/jackc/pgx-shopspring-decimal v0.0.0-20220624020537-1d36b5a1853e
1111
github.com/jackc/pgx-zerolog v0.0.0-20230315001418-f978528409eb
12-
github.com/jackc/pgx/v5 v5.7.1
12+
github.com/jackc/pgx/v5 v5.7.2
1313
github.com/mitchellh/go-homedir v1.1.0
1414
github.com/pkg/errors v0.9.1
1515
github.com/prometheus/client_golang v1.20.5
1616
github.com/prysmaticlabs/go-bitfield v0.0.0-20240618144021-706c95b2dd15
1717
github.com/rs/zerolog v1.33.0
1818
github.com/sasha-s/go-deadlock v0.3.5
1919
github.com/shopspring/decimal v1.4.0
20-
github.com/spf13/pflag v1.0.5
20+
github.com/spf13/pflag v1.0.6
2121
github.com/spf13/viper v1.19.0
2222
github.com/stretchr/testify v1.10.0
2323
github.com/wealdtech/go-majordomo v1.1.1
24-
go.opentelemetry.io/otel v1.33.0
25-
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.33.0
26-
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.33.0
27-
go.opentelemetry.io/otel/sdk v1.33.0
28-
go.opentelemetry.io/otel/trace v1.33.0
24+
go.opentelemetry.io/otel v1.34.0
25+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0
26+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0
27+
go.opentelemetry.io/otel/sdk v1.34.0
28+
go.opentelemetry.io/otel/trace v1.34.0
2929
go.uber.org/atomic v1.11.0
30-
golang.org/x/sync v0.10.0
31-
google.golang.org/grpc v1.69.2
30+
golang.org/x/sync v0.11.0
31+
google.golang.org/grpc v1.70.0
3232
)
3333

3434
require (
35-
cloud.google.com/go/auth v0.13.0 // indirect
36-
cloud.google.com/go/auth/oauth2adapt v0.2.6 // indirect
35+
cloud.google.com/go/auth v0.14.1 // indirect
36+
cloud.google.com/go/auth/oauth2adapt v0.2.7 // indirect
3737
cloud.google.com/go/compute/metadata v0.6.0 // indirect
38-
cloud.google.com/go/iam v1.3.0 // indirect
39-
cloud.google.com/go/secretmanager v1.14.2 // indirect
38+
cloud.google.com/go/iam v1.3.1 // indirect
39+
cloud.google.com/go/secretmanager v1.14.4 // indirect
4040
github.com/beorn7/perks v1.0.1 // indirect
4141
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
4242
github.com/cespare/xxhash/v2 v2.3.0 // indirect
4343
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
4444
github.com/emicklei/dot v1.6.4 // indirect
45+
github.com/fatih/color v1.18.0 // indirect
4546
github.com/felixge/httpsnoop v1.0.4 // indirect
4647
github.com/ferranbt/fastssz v0.1.4 // indirect
4748
github.com/fsnotify/fsnotify v1.8.0 // indirect
4849
github.com/go-logr/logr v1.4.2 // indirect
4950
github.com/go-logr/stdr v1.2.2 // indirect
50-
github.com/goccy/go-yaml v1.15.11 // indirect
51+
github.com/goccy/go-yaml v1.9.2 // indirect
5152
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
52-
github.com/google/s2a-go v0.1.8 // indirect
53+
github.com/google/s2a-go v0.1.9 // indirect
5354
github.com/google/uuid v1.6.0 // indirect
5455
github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect
55-
github.com/googleapis/gax-go/v2 v2.14.0 // indirect
56-
github.com/grpc-ecosystem/grpc-gateway/v2 v2.24.0 // indirect
56+
github.com/googleapis/gax-go/v2 v2.14.1 // indirect
57+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.0 // indirect
5758
github.com/hashicorp/hcl v1.0.0 // indirect
5859
github.com/holiman/uint256 v1.3.2 // indirect
5960
github.com/huandu/go-clone v1.7.2 // indirect
@@ -64,43 +65,44 @@ require (
6465
github.com/klauspost/compress v1.17.11 // indirect
6566
github.com/klauspost/cpuid/v2 v2.2.9 // indirect
6667
github.com/magiconair/properties v1.8.9 // indirect
67-
github.com/mattn/go-colorable v0.1.13 // indirect
68+
github.com/mattn/go-colorable v0.1.14 // indirect
6869
github.com/mattn/go-isatty v0.0.20 // indirect
6970
github.com/minio/sha256-simd v1.0.1 // indirect
7071
github.com/mitchellh/mapstructure v1.5.0 // indirect
7172
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
7273
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
73-
github.com/petermattis/goid v0.0.0-20241211131331-93ee7e083c43 // indirect
74+
github.com/petermattis/goid v0.0.0-20250121172306-05bcfb9a85dc // indirect
7475
github.com/pk910/dynamic-ssz v0.0.5 // indirect
7576
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
7677
github.com/prometheus/client_model v0.6.1 // indirect
77-
github.com/prometheus/common v0.61.0 // indirect
78+
github.com/prometheus/common v0.62.0 // indirect
7879
github.com/prometheus/procfs v0.15.1 // indirect
7980
github.com/r3labs/sse/v2 v2.10.0 // indirect
80-
github.com/sagikazarmark/locafero v0.6.0 // indirect
81+
github.com/sagikazarmark/locafero v0.7.0 // indirect
8182
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
8283
github.com/sourcegraph/conc v0.3.0 // indirect
83-
github.com/spf13/afero v1.11.0 // indirect
84+
github.com/spf13/afero v1.12.0 // indirect
8485
github.com/spf13/cast v1.7.1 // indirect
8586
github.com/subosito/gotenv v1.6.0 // indirect
8687
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
87-
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.58.0 // indirect
88-
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 // indirect
89-
go.opentelemetry.io/otel/metric v1.33.0 // indirect
90-
go.opentelemetry.io/proto/otlp v1.4.0 // indirect
88+
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0 // indirect
89+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 // indirect
90+
go.opentelemetry.io/otel/metric v1.34.0 // indirect
91+
go.opentelemetry.io/proto/otlp v1.5.0 // indirect
9192
go.uber.org/multierr v1.11.0 // indirect
92-
golang.org/x/crypto v0.31.0 // indirect
93-
golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 // indirect
94-
golang.org/x/net v0.33.0 // indirect
95-
golang.org/x/oauth2 v0.24.0 // indirect
96-
golang.org/x/sys v0.28.0 // indirect
97-
golang.org/x/text v0.21.0 // indirect
98-
golang.org/x/time v0.8.0 // indirect
99-
google.golang.org/api v0.213.0 // indirect
100-
google.golang.org/genproto v0.0.0-20241216192217-9240e9c98484 // indirect
101-
google.golang.org/genproto/googleapis/api v0.0.0-20241216192217-9240e9c98484 // indirect
102-
google.golang.org/genproto/googleapis/rpc v0.0.0-20241216192217-9240e9c98484 // indirect
103-
google.golang.org/protobuf v1.36.0 // indirect
93+
golang.org/x/crypto v0.32.0 // indirect
94+
golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c // indirect
95+
golang.org/x/net v0.34.0 // indirect
96+
golang.org/x/oauth2 v0.26.0 // indirect
97+
golang.org/x/sys v0.30.0 // indirect
98+
golang.org/x/text v0.22.0 // indirect
99+
golang.org/x/time v0.10.0 // indirect
100+
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
101+
google.golang.org/api v0.220.0 // indirect
102+
google.golang.org/genproto v0.0.0-20250204164813-702378808489 // indirect
103+
google.golang.org/genproto/googleapis/api v0.0.0-20250204164813-702378808489 // indirect
104+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250204164813-702378808489 // indirect
105+
google.golang.org/protobuf v1.36.4 // indirect
104106
gopkg.in/Knetic/govaluate.v3 v3.0.0 // indirect
105107
gopkg.in/cenkalti/backoff.v1 v1.1.0 // indirect
106108
gopkg.in/ini.v1 v1.67.0 // indirect

0 commit comments

Comments
 (0)