Skip to content

Develop#46

Merged
Super-Genius merged 73 commits intomainfrom
develop
Mar 24, 2026
Merged

Develop#46
Super-Genius merged 73 commits intomainfrom
develop

Conversation

@Super-Genius
Copy link
Contributor

No description provided.

itsafuu and others added 30 commits March 11, 2026 20:37
…ructors. Edited discv4 client to not use only posix
- RlpxSession: inherit enable_shared_from_this; connect() returns
  shared_ptr; I/O coroutines capture shared_ptr to prevent
  use-after-free crash on session teardown
- ETH/68+69: StatusMessage as std::variant<StatusMessage68, StatusMessage69>
  with get_common_fields() helper and 3-param validate_status()
- Fix Snappy compression: msg_id uncompressed, payload compressed separately
- Fix test files: eth_handshake_test, eth_messages_test,
  eth_watch_integration_test updated for variant API
- 512/512 tests pass
  ✅ ENRRequest wire encode (type 0x05)
  ✅ ENRResponse wire decode (type 0x06)
  ✅ request_enr() in discv4_client with reply matching
  ✅ ParseEthForkId() extracts ForkId from ENR record
  ✅ Bond → ENR → eth_fork_id enrichment in handle_neighbours coroutine
  ✅ make_fork_id_filter() + DialScheduler::filter_fn for pre-dial chain filtering
…ode registry, crawler, and client

Co-authored-by: Super-Genius <1320023+Super-Genius@users.noreply.github.com>
Co-authored-by: Super-Genius <1320023+Super-Genius@users.noreply.github.com>
…+17 compatibility

Co-authored-by: Super-Genius <1320023+Super-Genius@users.noreply.github.com>
…S.md

Co-authored-by: Super-Genius <1320023+Super-Genius@users.noreply.github.com>
…ISTAKES.md M015

Co-authored-by: Super-Genius <1320023+Super-Genius@users.noreply.github.com>
- clean corrupted patch artifacts in discv5_client.cpp
- fix rlp::Bytes/std::vector conversion boundaries
- harden noexcept endpoint/address lookups with error_code overloads
- link discv5 against rlpx to resolve Ecdh symbol
- update CHECKPOINT.md with build-blocker/repair context
- expect unsolicited WHOAREYOU packets to remain uncounted
- add regression assertions that unrelated protocol counters stay zero for generic valid UDP packets
… flow

- initialize discv5_crawl with generated secp256k1 keypair
- add handshake/message diagnostics to client + crawl summary
- gate deep diagnostics to --log-level trace
- reduce per-peer discovery logs at info level
- align WHOAREYOU/handshake details closer to geth behavior
- fix packet construction bug by preserving header/AAD and appending ciphertext
itsafuu and others added 14 commits March 18, 2026 15:53
- fix compiler warnings across rlp, rlpx, discv4, and tests
- normalize signed/unsigned size comparisons and remove tautological limit checks
- harden frame and ECIES parsing with explicit wire-size validation
- fully initialize discv4 pending reply state to avoid missing-field issues
- restore selected warnings as errors (-Werror=unused-lambda-capture, -Werror=sign-compare, -Werror=type-limits)
- replace protocol magic numbers with named constexpr constants in rlpx, discv4, and discv5
- clean up discovery tests by using condition-variable synchronization instead of sleep_for
- remove unused lambda captures, dead test fields, and skip the non-real timeout test
- register discv4 pending reply matchers before sending PING, FINDNODE, and ENRRequest packets
- erase pending discv4 reply entries on send failure to avoid stale state
- prevent fast PONG/NEIGHBOURS/ENR responses from being dropped as unsolicited
- clear stale discv5 pending FINDNODE requests that never received WHOAREYOU
- allow discv5 silent peers to be retried instead of becoming permanently blocked by pending_requests_
- keep discovery retry state bounded and aligned with the intended request/response flow
…tdown

ping() and request_enr() both treat operation_aborted as a successful
reply, but stop() cancels every pending timer unconditionally, which
caused the same code path to fire during shutdown races.

- ping(): require pong_slot->expiration != 0 before declaring bond success;
  prevents default-constructed discv4_pong from marking unreachable peers
  as bonded and driving follow-up discovery on bad state.
- request_enr(): require !enr_slot->record_rlp.empty() before returning
  the response; prevents an empty/i
Removed triggers for push, pull_request, and schedule events.
Removed triggers for push, pull request, and schedule events.
Removed triggers for push, pull_request, and schedule events.
Removed triggers for push, pull request, and schedule events.
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 473efa351b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Super-Genius
Copy link
Contributor Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ca19c92c0b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Super-Genius
Copy link
Contributor Author

@codex review

@Super-Genius Super-Genius merged commit c14be5c into main Mar 24, 2026
43 of 48 checks passed
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ad037727b2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +258 to +259
// Cancel the waiting find_node() coroutine — we got the reply.
it->second.timer->cancel();

Choose a reason for hiding this comment

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

P1 Badge Keep FIND_NODE matcher active for full neighbors burst

Cancelling the pending FIND_NODE timer on the first NEIGHBOURS packet means find_node() immediately wakes and erases the matcher, so additional NEIGHBOURS packets from the same reply window are dropped by the pending_replies_ guard. In discv4, peers are often split across multiple NEIGHBOURS packets due UDP size limits, so this truncates discovery results and can significantly reduce crawl coverage.

Useful? React with 👍 / 👎.

Comment on lines +567 to +569
const std::string key = reply_key(ip, port, kPacketTypeNeighbours);
auto timer = std::make_shared<asio::steady_timer>(io_context_);
pending_replies_[key] = PendingReply{ timer, nullptr, nullptr, {} };

Choose a reason for hiding this comment

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

P2 Badge Use unique reply keys per request to avoid matcher clobbering

This matcher key is only ip:port:ptype, so concurrent requests of the same type to one endpoint overwrite each other in pending_replies_. When that happens, one coroutine can wait on a timer that will never be canceled, and later erase(key) calls can remove another in-flight request’s matcher, producing spurious timeouts and lost replies during concurrent crawl activity.

Useful? React with 👍 / 👎.

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.

3 participants