fix: adapt to the upstream go-ethereum

This commit is contained in:
Igor Sirotin 2025-10-01 14:20:02 +01:00
parent ad7384abf9
commit 70a1794a43
No known key found for this signature in database
GPG Key ID: 0EABBCB40CB9AD4A
3 changed files with 6 additions and 12 deletions

View File

@ -13,12 +13,13 @@ import (
"github.com/multiformats/go-multiaddr"
"github.com/prometheus/client_golang/prometheus"
"github.com/waku-org/go-discover/discover"
"go.uber.org/zap"
"github.com/waku-org/go-waku/logging"
"github.com/waku-org/go-waku/waku/v2/peerstore"
wenr "github.com/waku-org/go-waku/waku/v2/protocol/enr"
"github.com/waku-org/go-waku/waku/v2/service"
"github.com/waku-org/go-waku/waku/v2/utils"
"go.uber.org/zap"
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/ethereum/go-ethereum/p2p/nat"
@ -142,11 +143,9 @@ func NewDiscoveryV5(priv *ecdsa.PrivateKey, localnode *enode.LocalNode, peerConn
localnode: localnode,
metrics: newMetrics(reg),
config: discover.Config{
PrivateKey: priv,
Bootnodes: bootnodes,
V5Config: discover.V5Config{
ProtocolID: &protocolID,
},
PrivateKey: priv,
Bootnodes: bootnodes,
V5ProtocolID: &protocolID,
},
udpAddr: &net.UDPAddr{
IP: net.IPv4zero,

View File

@ -45,11 +45,6 @@ func WithMultiaddress(multiaddrs ...multiaddr.Multiaddr) ENROption {
successIdx := -1
for i := len(multiaddrs); i > 0; i-- {
cpy := localnode.Node().Record() // Record() creates a copy for the current iteration
// Copy all the entries that might not have been written in the ENR record due to the
// async nature of localnode.Set
for _, entry := range localnode.Entries() {
cpy.Set(entry)
}
cpy.Set(enr.WithEntry(MultiaddrENRField, marshalMultiaddress(multiaddrs[0:i])))
cpy.SetSeq(localnode.Seq() + 1)
err = enode.SignV4(cpy, privk)

View File

@ -34,7 +34,7 @@ func (c *MockClient) Close() {
}
func (c *MockClient) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error) {
return types.NewBlock(&types.Header{Number: big.NewInt(c.latestBlockNum.Load())}, nil, nil, nil, nil), nil
return types.NewBlock(&types.Header{Number: big.NewInt(c.latestBlockNum.Load())}, nil, nil, nil), nil
}
func NewMockClient(t *testing.T, blockFile string) *MockClient {
blockChain := MockBlockChain{}