Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eth/protocols/eth: fix loading "eth" ENR key in dial filter #31251

Merged
merged 4 commits into from
Feb 25, 2025

Conversation

islishude
Copy link
Contributor

@islishude islishude changed the title p2p: correct pointer usage in node loading function p2p: correct pointer usage in ENR loading function Feb 25, 2025
@islishude
Copy link
Contributor Author

Can I add this line as well?

It updates the enr early, and the node has correct enr to let other nodes to connect quickly

diff --git a/eth/protocols/eth/discovery.go b/eth/protocols/eth/discovery.go
index 86464ff82..f43e6f864 100644
--- a/eth/protocols/eth/discovery.go
+++ b/eth/protocols/eth/discovery.go
@@ -42,6 +42,7 @@ func StartENRUpdater(chain *core.BlockChain, ln *enode.LocalNode) {
        var newHead = make(chan core.ChainHeadEvent, 10)
        sub := chain.SubscribeChainHeadEvent(newHead)
 
+       ln.Set(currentENREntry(chain))
        go func() {
                defer sub.Unsubscribe()
                for {

@fjl fjl changed the title p2p: correct pointer usage in ENR loading function eth/protocols/eth: fix loading "eth" ENR key in dial filter Feb 25, 2025
@fjl
Copy link
Contributor

fjl commented Feb 25, 2025

Sure!

Copy link
Contributor

@fjl fjl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for finding the issue!

@fjl fjl added this to the 1.15.3 milestone Feb 25, 2025
@fjl fjl merged commit 756310f into ethereum:master Feb 25, 2025
1 of 2 checks passed
@islishude islishude deleted the fix-p2p branch February 25, 2025 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants