Skip to content

Commit 257545b

Browse files
author
Temirlan
authored
Merge pull request #6 from chainstack/luban-fork
Luban fork support
2 parents 5ce0f03 + 7459674 commit 257545b

File tree

370 files changed

+13149
-9670
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

370 files changed

+13149
-9670
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ COPY --from=builder /app/build/bin/sentry /usr/local/bin/sentry
8181
COPY --from=builder /app/build/bin/state /usr/local/bin/state
8282
COPY --from=builder /app/build/bin/txpool /usr/local/bin/txpool
8383
COPY --from=builder /app/build/bin/verkle /usr/local/bin/verkle
84+
COPY --from=builder /app/build/bin/caplin-phase1 /usr/local/bin/caplin-phase1
8485

8586

8687

Dockerfile.debian

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ COPY --from=builder /app/build/bin/erigon-cl /usr/local/bin/erigon-cl
6565
COPY --from=builder /app/build/bin/evm /usr/local/bin/evm
6666
COPY --from=builder /app/build/bin/hack /usr/local/bin/hack
6767
COPY --from=builder /app/build/bin/integration /usr/local/bin/integration
68-
COPY --from=builder /app/build/bin/lightclient /usr/local/bin/lightclient
6968
COPY --from=builder /app/build/bin/observer /usr/local/bin/observer
7069
COPY --from=builder /app/build/bin/pics /usr/local/bin/pics
7170
COPY --from=builder /app/build/bin/rpcdaemon /usr/local/bin/rpcdaemon
@@ -75,6 +74,7 @@ COPY --from=builder /app/build/bin/sentry /usr/local/bin/sentry
7574
COPY --from=builder /app/build/bin/state /usr/local/bin/state
7675
COPY --from=builder /app/build/bin/txpool /usr/local/bin/txpool
7776
COPY --from=builder /app/build/bin/verkle /usr/local/bin/verkle
77+
COPY --from=builder /app/build/bin/caplin-phase1 /usr/local/bin/caplin-phase1
7878

7979
EXPOSE 8545 \
8080
8551 \

Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ COMMANDS += state
120120
COMMANDS += txpool
121121
COMMANDS += verkle
122122
COMMANDS += evm
123-
COMMANDS += lightclient
124123
COMMANDS += sentinel
125-
COMMANDS += erigon-el
124+
COMMANDS += erigon-el
125+
COMMANDS += caplin-phase1
126126

127127
# build each command using %.cmd rule
128128
$(COMMANDS): %: %.cmd
@@ -136,6 +136,7 @@ db-tools:
136136

137137
go mod vendor
138138
cd vendor/github.com/torquem-ch/mdbx-go && MDBX_BUILD_TIMESTAMP=unknown make tools
139+
mkdir -p $(GOBIN)
139140
cd vendor/github.com/torquem-ch/mdbx-go/mdbxdist && cp mdbx_chk $(GOBIN) && cp mdbx_copy $(GOBIN) && cp mdbx_dump $(GOBIN) && cp mdbx_drop $(GOBIN) && cp mdbx_load $(GOBIN) && cp mdbx_stat $(GOBIN)
140141
rm -rf vendor
141142
@echo "Run \"$(GOBIN)/mdbx_stat -h\" to get info about mdbx db file."
@@ -166,7 +167,7 @@ lintci:
166167
## lintci-deps: (re)installs golangci-lint to build/bin/golangci-lint
167168
lintci-deps:
168169
rm -f ./build/bin/golangci-lint
169-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./build/bin v1.52.1
170+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./build/bin v1.52.2
170171

171172
## clean: cleans the go cache, build dir, libmdbx db dir
172173
clean:
@@ -214,7 +215,7 @@ git-submodules:
214215
@git submodule update --quiet --init --recursive --force || true
215216

216217
PACKAGE_NAME := github.com/ledgerwatch/erigon
217-
GOLANG_CROSS_VERSION ?= v1.19.5
218+
GOLANG_CROSS_VERSION ?= v1.20.2
218219

219220
.PHONY: release-dry-run
220221
release-dry-run: git-submodules

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ by default.
2626
+ [Faster Initial Sync](#faster-initial-sync)
2727
+ [JSON-RPC daemon](#json-rpc-daemon)
2828
+ [Run all components by docker-compose](#run-all-components-by-docker-compose)
29-
+ [Grafana dashboar god](#grafana-dashboard)
29+
+ [Grafana dashboard](#grafana-dashboard)
3030
- [Documentation](#documentation)
3131
- [FAQ](#faq)
3232
- [Getting in touch](#getting-in-touch)
@@ -159,10 +159,10 @@ How to start Erigon's services as separated processes, see in [docker-compose.ym
159159

160160
### Embedded Consensus Layer
161161

162-
By default, on Ethereum Mainnet, Görli, and Sepolia, the Engine API is disabled in favour of the Erigon native Embedded
162+
On Ethereum Mainnet, Görli, and Sepolia, the Engine API can be disabled in favour of the Erigon native Embedded
163163
Consensus Layer.
164-
If you want to use an external Consensus Layer, run Erigon with flag `--externalcl`.
165-
_Warning:_ Staking (block production) is not possible with the embedded CL – use `--externalcl` instead.
164+
If you want to use the internal Consensus Layer, run Erigon with flag `--internalcl`.
165+
_Warning:_ Staking (block production) is not possible with the embedded CL.
166166

167167
### Testnets
168168

@@ -502,7 +502,7 @@ Windows support for docker-compose is not ready yet. Please help us with .ps1 po
502502

503503
`docker-compose up prometheus grafana`, [detailed docs](./cmd/prometheus/Readme.md).
504504

505-
###
505+
###
506506

507507
old data
508508

@@ -529,7 +529,7 @@ FAQ
529529

530530
Detailed explanation: [./docs/programmers_guide/db_faq.md](./docs/programmers_guide/db_faq.md)
531531

532-
### Default Ports and Protocols / Firewalls?
532+
### Default Ports and Firewalls
533533

534534
#### `erigon` ports
535535

@@ -587,13 +587,13 @@ you'll have to change one if you want to run both at the same time. use `--help`
587587

588588
Reserved for future use: **gRPC ports**: `9092` consensus engine, `9093` snapshot downloader, `9094` TxPool
589589

590-
Hetzner may want strict firewall rules, like:
590+
#### Hetzner expecting strict firewall rules
591591

592592
```
593593
0.0.0.0/8 "This" Network RFC 1122, Section 3.2.1.3
594594
10.0.0.0/8 Private-Use Networks RFC 1918
595595
100.64.0.0/10 Carrier-Grade NAT (CGN) RFC 6598, Section 7
596-
127.0.0.0/8 Loopback RFC 1122, Section 3.2.1.3
596+
127.16.0.0/12 Private-Use Networks RFC 1918
597597
169.254.0.0/16 Link Local RFC 3927
598598
172.16.0.0/12 Private-Use Networks RFC 1918
599599
192.0.0.0/24 IETF Protocol Assignments RFC 5736
@@ -610,6 +610,8 @@ Hetzner may want strict firewall rules, like:
610610
RFC 922, Section 7
611611
```
612612

613+
Same in [IpTables syntax](https://ethereum.stackexchange.com/questions/6386/how-to-prevent-being-blacklisted-for-running-an-ethereum-client/13068#13068)
614+
613615
### How to get diagnostic for bug report?
614616

615617
- Get stack trace: `kill -SIGUSR1 <pid>`, get trace and stop: `kill -6 <pid>`

accounts/abi/bind/backends/simulated.go

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -113,18 +113,12 @@ func NewSimulatedBackendWithConfig(alloc types.GenesisAlloc, config *chain.Confi
113113
func NewSimulatedBackend(t *testing.T, alloc types.GenesisAlloc, gasLimit uint64) *SimulatedBackend {
114114
b := NewSimulatedBackendWithConfig(alloc, params.TestChainConfig, gasLimit)
115115
t.Cleanup(b.Close)
116-
//if b.m.HistoryV3 {
117-
// t.Skip("TODO: Fixme")
118-
//}
119116
return b
120117
}
121118

122119
func NewTestSimulatedBackendWithConfig(t *testing.T, alloc types.GenesisAlloc, config *chain.Config, gasLimit uint64) *SimulatedBackend {
123120
b := NewSimulatedBackendWithConfig(alloc, config, gasLimit)
124121
t.Cleanup(b.Close)
125-
//if b.m.HistoryV3 {
126-
// t.Skip("TODO: Fixme")
127-
//}
128122
return b
129123
}
130124
func (b *SimulatedBackend) DB() kv.RwDB { return b.m.DB }
@@ -179,20 +173,6 @@ func (b *SimulatedBackend) emptyPendingBlock() {
179173
b.pendingReceipts = chain.Receipts[0]
180174
b.pendingHeader = chain.Headers[0]
181175
b.gasPool = new(core.GasPool).AddGas(b.pendingHeader.GasLimit)
182-
if ethconfig.EnableHistoryV4InTest {
183-
panic("implement domain state reader")
184-
/*
185-
agg := db.(*temporal.DB).GetAgg()
186-
agg.SetTx(tx)
187-
188-
rs := state.NewStateV3("", agg.BufferedDomains())
189-
stateWriter = state.NewStateWriterV3(rs)
190-
r := state.NewStateReaderV3(rs)
191-
r.SetTx(tx)
192-
stateReader = r
193-
defer agg.StartUnbufferedWrites().FinishWrites()
194-
*/
195-
}
196176
if b.pendingReaderTx != nil {
197177
b.pendingReaderTx.Rollback()
198178
}
@@ -201,18 +181,21 @@ func (b *SimulatedBackend) emptyPendingBlock() {
201181
panic(err)
202182
}
203183
b.pendingReaderTx = tx
204-
b.pendingReader = state.NewPlainStateReader(b.pendingReaderTx)
184+
if ethconfig.EnableHistoryV4InTest {
185+
panic("implement me")
186+
//b.pendingReader = state.NewReaderV4(b.pendingReaderTx.(kv.TemporalTx))
187+
} else {
188+
b.pendingReader = state.NewPlainStateReader(b.pendingReaderTx)
189+
}
205190
b.pendingState = state.New(b.pendingReader)
206191
}
207192

208193
// stateByBlockNumber retrieves a state by a given blocknumber.
209194
func (b *SimulatedBackend) stateByBlockNumber(db kv.Tx, blockNumber *big.Int) *state.IntraBlockState {
210195
if blockNumber == nil || blockNumber.Cmp(b.pendingBlock.Number()) == 0 {
211-
return state.New(state.NewPlainState(db, b.pendingBlock.NumberU64()+1, nil))
212-
//return state.New(b.m.NewHistoryStateReader(b.pendingBlock.NumberU64()+1, db))
196+
return state.New(b.m.NewHistoryStateReader(b.pendingBlock.NumberU64()+1, db))
213197
}
214-
return state.New(state.NewPlainState(db, blockNumber.Uint64()+1, nil))
215-
//return state.New(b.m.NewHistoryStateReader(blockNumber.Uint64()+1, db))
198+
return state.New(b.m.NewHistoryStateReader(blockNumber.Uint64()+1, db))
216199
}
217200

218201
// CodeAt returns the code associated with a certain account in the blockchain.
@@ -705,7 +688,8 @@ func (b *SimulatedBackend) callContract(_ context.Context, call ethereum.CallMsg
705688

706689
txContext := core.NewEVMTxContext(msg)
707690
header := block.Header()
708-
evmContext := core.NewEVMBlockContext(header, core.GetHashFn(header, b.getHeader), b.m.Engine, nil, nil /*excessDataGas*/)
691+
excessDataGas := header.ParentExcessDataGas(b.getHeader)
692+
evmContext := core.NewEVMBlockContext(header, core.GetHashFn(header, b.getHeader), b.m.Engine, nil, excessDataGas)
709693
// Create a new environment which holds all relevant information
710694
// about the transaction and calling mechanisms.
711695
vmEnv := vm.NewEVM(evmContext, txContext, statedb, b.m.ChainConfig, vm.Config{})
@@ -738,7 +722,8 @@ func (b *SimulatedBackend) SendTransaction(ctx context.Context, tx types.Transac
738722
&b.pendingHeader.Coinbase, b.gasPool,
739723
b.pendingState, state.NewNoopWriter(),
740724
b.pendingHeader, tx,
741-
&b.pendingHeader.GasUsed, vm.Config{}); err != nil {
725+
&b.pendingHeader.GasUsed, vm.Config{},
726+
b.pendingHeader.ParentExcessDataGas(b.getHeader)); err != nil {
742727
return err
743728
}
744729
//fmt.Printf("==== Start producing block %d\n", (b.prependBlock.NumberU64() + 1))
@@ -820,6 +805,10 @@ func (m callMsg) Data() []byte { return m.CallMsg.Data }
820805
func (m callMsg) AccessList() types2.AccessList { return m.CallMsg.AccessList }
821806
func (m callMsg) IsFree() bool { return false }
822807

808+
func (m callMsg) DataGas() uint64 { return params.DataGasPerBlob * uint64(len(m.CallMsg.DataHashes)) }
809+
func (m callMsg) MaxFeePerDataGas() *uint256.Int { return m.CallMsg.MaxFeePerDataGas }
810+
func (m callMsg) DataHashes() []libcommon.Hash { return m.CallMsg.DataHashes }
811+
823812
/*
824813
// filterBackend implements filters.Backend to support filtering for logs without
825814
// taking bloom-bits acceleration structures into account.

accounts/abi/bind/backends/simulated_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import (
3535
"github.com/ledgerwatch/erigon/common"
3636
"github.com/ledgerwatch/erigon/common/u256"
3737
"github.com/ledgerwatch/erigon/core/rawdb"
38-
"github.com/ledgerwatch/erigon/core/state"
3938
"github.com/ledgerwatch/erigon/core/types"
4039
"github.com/ledgerwatch/erigon/crypto"
4140
"github.com/ledgerwatch/erigon/params"
@@ -147,8 +146,7 @@ func TestNewSimulatedBackend(t *testing.T) {
147146
t.Fatal(err)
148147
}
149148

150-
//statedb := sim.stateByBlockNumber(tx, big.NewInt(int64(num+1)))
151-
statedb := state.New(state.NewPlainState(tx, num+1, nil))
149+
statedb := sim.stateByBlockNumber(tx, big.NewInt(int64(num+1)))
152150
bal := statedb.GetBalance(testAddr)
153151
if !bal.Eq(expectedBal) {
154152
t.Errorf("expected balance for test address not received. expected: %v actual: %v", expectedBal, bal)

accounts/abi/bind/bind_test.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1848,11 +1848,18 @@ func TestGolangBindings(t *testing.T) {
18481848
t.Fatalf("failed to replace binding test dependency to current source tree: %v\n%s", err, out)
18491849
}
18501850

1851-
replacer = exec.Command(gocmd, "mod", "edit", "-x", "-require", "github.com/tendermint/[email protected]", "-replace", "github.com/tendermint/tendermint=github.com/bnb-chain/[email protected].12") // Repo root
1851+
replacer = exec.Command(gocmd, "mod", "edit", "-x", "-require", "github.com/tendermint/[email protected]", "-replace", "github.com/tendermint/tendermint=github.com/bnb-chain/[email protected].15") // Repo root
18521852
replacer.Dir = pkg
18531853
if out, err := replacer.CombinedOutput(); err != nil {
18541854
t.Fatalf("failed to replace tendermint dependency to bnb-chain source: %v\n%s", err, out)
18551855
}
1856+
1857+
replacer = exec.Command(gocmd, "mod", "edit", "-x", "-require", "github.com/cometbft/[email protected]", "-replace", "github.com/cometbft/cometbft=github.com/bnb-chain/[email protected]") // Repo root
1858+
replacer.Dir = pkg
1859+
if out, err := replacer.CombinedOutput(); err != nil {
1860+
t.Fatalf("failed to replace cometbft dependency to bnb-chain source: %v\n%s", err, out)
1861+
}
1862+
18561863
tidier := exec.Command(gocmd, "mod", "tidy")
18571864
tidier.Dir = pkg
18581865
if out, err := tidier.CombinedOutput(); err != nil {

cl/clparams/config.go

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -68,21 +68,6 @@ var (
6868
"enr:-LK4QA8FfhaAjlb_BXsXxSfiysR7R52Nhi9JBt4F8SPssu8hdE1BXQQEtVDC3qStCW60LSO7hEsVHv5zm8_6Vnjhcn0Bh2F0dG5ldHOIAAAAAAAAAACEZXRoMpC1MD8qAAAAAP__________gmlkgnY0gmlwhAN4aBKJc2VjcDI1NmsxoQJerDhsJ-KxZ8sHySMOCmTO6sHM3iCFQ6VMvLTe948MyYN0Y3CCI4yDdWRwgiOM",
6969
"enr:-LK4QKWrXTpV9T78hNG6s8AM6IO4XH9kFT91uZtFg1GcsJ6dKovDOr1jtAAFPnS2lvNltkOGA9k29BUN7lFh_sjuc9QBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpC1MD8qAAAAAP__________gmlkgnY0gmlwhANAdd-Jc2VjcDI1NmsxoQLQa6ai7y9PMN5hpLe5HmiJSlYzMuzP7ZhwRiwHvqNXdoN0Y3CCI4yDdWRwgiOM",
7070
}
71-
GoerliBootstrapNodes = []string{
72-
"enr:-Ku4QFmUkNp0g9bsLX2PfVeIyT-9WO-PZlrqZBNtEyofOOfLMScDjaTzGxIb1Ns9Wo5Pm_8nlq-SZwcQfTH2cgO-s88Bh2F0dG5ldHOIAAAAAAAAAACEZXRoMpDkvpOTAAAQIP__________gmlkgnY0gmlwhBLf22SJc2VjcDI1NmsxoQLV_jMOIxKbjHFKgrkFvwDvpexo6Nd58TK5k7ss4Vt0IoN1ZHCCG1g",
73-
"enr:-LK4QH1xnjotgXwg25IDPjrqRGFnH1ScgNHA3dv1Z8xHCp4uP3N3Jjl_aYv_WIxQRdwZvSukzbwspXZ7JjpldyeVDzMCh2F0dG5ldHOIAAAAAAAAAACEZXRoMpB53wQoAAAQIP__________gmlkgnY0gmlwhIe1te-Jc2VjcDI1NmsxoQOkcGXqbCJYbcClZ3z5f6NWhX_1YPFRYRRWQpJjwSHpVIN0Y3CCIyiDdWRwgiMo",
74-
"enr:-Ly4QFPk-cTMxZ3jWTafiNblEZkQIXGF2aVzCIGW0uHp6KaEAvBMoctE8S7YU0qZtuS7By0AA4YMfKoN9ls_GJRccVpFh2F0dG5ldHOI__________-EZXRoMpCC9KcrAgAQIIS2AQAAAAAAgmlkgnY0gmlwhKh3joWJc2VjcDI1NmsxoQKrxz8M1IHwJqRIpDqdVW_U1PeixMW5SfnBD-8idYIQrIhzeW5jbmV0cw-DdGNwgiMog3VkcIIjKA",
75-
"enr:-L64QJmwSDtaHVgGiqIxJWUtxWg6uLCipsms6j-8BdsOJfTWAs7CLF9HJnVqFE728O-JYUDCxzKvRdeMqBSauHVCMdaCAVWHYXR0bmV0c4j__________4RldGgykIL0pysCABAghLYBAAAAAACCaWSCdjSCaXCEQWxOdolzZWNwMjU2azGhA7Qmod9fK86WidPOzLsn5_8QyzL7ZcJ1Reca7RnD54vuiHN5bmNuZXRzD4N0Y3CCIyiDdWRwgiMo",
76-
"enr:-KG4QCIzJZTY_fs_2vqWEatJL9RrtnPwDCv-jRBuO5FQ2qBrfJubWOWazri6s9HsyZdu-fRUfEzkebhf1nvO42_FVzwDhGV0aDKQed8EKAAAECD__________4JpZIJ2NIJpcISHtbYziXNlY3AyNTZrMaED4m9AqVs6F32rSCGsjtYcsyfQE2K8nDiGmocUY_iq-TSDdGNwgiMog3VkcIIjKA",
77-
}
78-
79-
SepoliaBootstrapNodes = []string{
80-
// EF boot nodes
81-
"enr:-Iq4QMCTfIMXnow27baRUb35Q8iiFHSIDBJh6hQM5Axohhf4b6Kr_cOCu0htQ5WvVqKvFgY28893DHAg8gnBAXsAVqmGAX53x8JggmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk",
82-
"enr:-KG4QE5OIg5ThTjkzrlVF32WT_-XT14WeJtIz2zoTqLLjQhYAmJlnk4ItSoH41_2x0RX0wTFIe5GgjRzU2u7Q1fN4vADhGV0aDKQqP7o7pAAAHAyAAAAAAAAAIJpZIJ2NIJpcISlFsStiXNlY3AyNTZrMaEC-Rrd_bBZwhKpXzFCrStKp1q_HmGOewxY3KwM8ofAj_ODdGNwgiMog3VkcIIjKA",
83-
// Teku boot node
84-
"enr:-Ly4QFoZTWR8ulxGVsWydTNGdwEESueIdj-wB6UmmjUcm-AOPxnQi7wprzwcdo7-1jBW_JxELlUKJdJES8TDsbl1EdNlh2F0dG5ldHOI__78_v2bsV-EZXRoMpA2-lATkAAAcf__________gmlkgnY0gmlwhBLYJjGJc2VjcDI1NmsxoQI0gujXac9rMAb48NtMqtSTyHIeNYlpjkbYpWJw46PmYYhzeW5jbmV0cw-DdGNwgiMog3VkcIIjKA",
85-
}
8671

8772
GnosisBootstrapNodes = []string{
8873
"enr:-Ly4QMU1y81COwm1VZgxGF4_eZ21ub9-GHF6dXZ29aEJ0oZpcV2Rysw-viaEKfpcpu9ZarILJLxFZjcKOjE0Sybs3MQBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpCCS-QxAgAAZP__________gmlkgnY0gmlwhANLnx-Jc2VjcDI1NmsxoQKoaYT8I-wf2I_f_ii6EgoSSXj5T3bhiDyW-7ZLsY3T64hzeW5jbmV0cwCDdGNwgiMog3VkcIIjKA",
@@ -174,7 +159,7 @@ var NetworkConfigs map[NetworkType]NetworkConfig = map[NetworkType]NetworkConfig
174159
SyncCommsSubnetKey: "syncnets",
175160
MinimumPeersInSubnetSearch: 20,
176161
ContractDeploymentBlock: 1273020,
177-
BootNodes: SepoliaBootstrapNodes,
162+
BootNodes: MainnetBootstrapNodes,
178163
},
179164

180165
GoerliNetwork: {
@@ -194,7 +179,7 @@ var NetworkConfigs map[NetworkType]NetworkConfig = map[NetworkType]NetworkConfig
194179
SyncCommsSubnetKey: "syncnets",
195180
MinimumPeersInSubnetSearch: 20,
196181
ContractDeploymentBlock: 4367322,
197-
BootNodes: GoerliBootstrapNodes,
182+
BootNodes: MainnetBootstrapNodes,
198183
},
199184

200185
GnosisNetwork: {
@@ -266,18 +251,18 @@ var CheckpointSyncEndpoints = map[NetworkType][]string{
266251
MainnetNetwork: {
267252
"https://sync.invis.tools/eth/v2/debug/beacon/states/finalized",
268253
"https://mainnet-checkpoint-sync.attestant.io/eth/v2/debug/beacon/states/finalized",
269-
"https://mainnet.checkpoint.sigp.io/eth/v2/debug/beacon/states/finalized",
254+
//"https://mainnet.checkpoint.sigp.io/eth/v2/debug/beacon/states/finalized",
270255
"https://mainnet-checkpoint-sync.stakely.io/eth/v2/debug/beacon/states/finalized",
271256
"https://checkpointz.pietjepuk.net/eth/v2/debug/beacon/states/finalized",
272257
},
273258
GoerliNetwork: {
274259
"https://goerli.beaconstate.info/eth/v2/debug/beacon/states/finalized",
275260
"https://goerli-sync.invis.tools/eth/v2/debug/beacon/states/finalized",
276-
"https://goerli.checkpoint-sync.ethdevops.io/eth/v2/debug/beacon/states/finalized",
261+
"https://goerli.checkpoint-sync.ethpandaops.io/eth/v2/debug/beacon/states/finalized",
277262
"https://prater-checkpoint-sync.stakely.io/eth/v2/debug/beacon/states/finalized",
278263
},
279264
SepoliaNetwork: {
280-
"https://sepolia.checkpoint-sync.ethdevops.io/eth/v2/debug/beacon/states/finalized",
265+
"https://checkpoint-sync.sepolia.ethpandaops.io/eth/v2/debug/beacon/states/finalized",
281266
"https://sepolia.beaconstate.info/eth/v2/debug/beacon/states/finalized",
282267
},
283268
GnosisNetwork: {

cl/cltypes/attestations.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,3 +603,8 @@ func (a *PendingAttestation) HashSSZ() ([32]byte, error) {
603603

604604
return merkle_tree.ArraysRoot(leaves, 4)
605605
}
606+
607+
func IsSlashableAttestationData(d1, d2 *AttestationData) bool {
608+
return (!d1.Equal(d2) && d1.Target.Epoch == d2.Target.Epoch) ||
609+
(d1.Source.Epoch < d2.Source.Epoch && d2.Target.Epoch < d1.Target.Epoch)
610+
}

cl/cltypes/beacon_header.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ type BeaconBlockHeader struct {
2020
BodyRoot libcommon.Hash
2121
}
2222

23+
func (b *BeaconBlockHeader) Copy() *BeaconBlockHeader {
24+
copied := *b
25+
return &copied
26+
}
2327
func (b *BeaconBlockHeader) EncodeSSZ(dst []byte) ([]byte, error) {
2428
buf := dst
2529
buf = append(buf, ssz.Uint64SSZ(b.Slot)...)

0 commit comments

Comments
 (0)