Skip to content

Conversation

@0xMimir
Copy link
Contributor

@0xMimir 0xMimir commented Dec 3, 2025

Issue #1641

@github-actions
Copy link

github-actions bot commented Dec 3, 2025

OCaml Reference Validation Results

Repository: https://github.com/MinaProtocol/mina.git
Branch: compatible
Status: ✓ Validation passed

Click to see full validation output
Checking OCaml references against https://github.com/MinaProtocol/mina.git (branch: compatible)
Fetching current commit from compatible...
Current OCaml commit: ecbf1132c1c05dddc4629dd1ecf0a31c1af6682c

Validating references...
========================
✓ VALID: ledger/src/account/account.rs -> src/lib/mina_base/account.ml L:201-224
  ⚠ STALE COMMIT: fc6be4c58091c761f827c858229c2edf9519e941 (current: ecbf1132c1c05dddc4629dd1ecf0a31c1af6682c)
✓ VALID: ledger/src/scan_state/transaction_logic/for_tests.rs -> src/lib/transaction_logic/mina_transaction_logic.ml L:2285-2285
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: ecbf1132c1c05dddc4629dd1ecf0a31c1af6682c)
✓ VALID: ledger/src/scan_state/transaction_logic/for_tests.rs -> src/lib/transaction_logic/mina_transaction_logic.ml L:2351-2356
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: ecbf1132c1c05dddc4629dd1ecf0a31c1af6682c)
✓ VALID: ledger/src/scan_state/transaction_logic/for_tests.rs -> src/lib/transaction_logic/mina_transaction_logic.ml L:2407
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: ecbf1132c1c05dddc4629dd1ecf0a31c1af6682c)
✓ VALID: ledger/src/scan_state/transaction_logic/mod.rs -> src/lib/mina_base/transaction_status.ml L:9-51
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: ecbf1132c1c05dddc4629dd1ecf0a31c1af6682c)
✓ VALID: ledger/src/scan_state/transaction_logic/mod.rs -> src/lib/mina_base/transaction_status.ml L:452-454
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: ecbf1132c1c05dddc4629dd1ecf0a31c1af6682c)
✓ VALID: ledger/src/scan_state/transaction_logic/mod.rs -> src/lib/mina_base/with_status.ml L:6-10
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: ecbf1132c1c05dddc4629dd1ecf0a31c1af6682c)
✓ VALID: ledger/src/scan_state/transaction_logic/mod.rs -> src/lib/mina_base/fee_transfer.ml L:76-80
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: ecbf1132c1c05dddc4629dd1ecf0a31c1af6682c)
✓ VALID: ledger/src/scan_state/transaction_logic/mod.rs -> src/lib/mina_base/fee_transfer.ml L:68-69
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: ecbf1132c1c05dddc4629dd1ecf0a31c1af6682c)
✓ VALID: ledger/src/scan_state/transaction_logic/mod.rs -> src/lib/mina_base/coinbase.ml L:17-21
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: ecbf1132c1c05dddc4629dd1ecf0a31c1af6682c)
✓ VALID: ledger/src/scan_state/transaction_logic/mod.rs -> src/lib/transaction/transaction.ml L:8-11
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: ecbf1132c1c05dddc4629dd1ecf0a31c1af6682c)
✓ VALID: ledger/src/scan_state/transaction_logic/signed_command.rs -> src/lib/mina_base/signed_command_payload.ml L:34-48
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: ecbf1132c1c05dddc4629dd1ecf0a31c1af6682c)
✓ VALID: ledger/src/scan_state/transaction_logic/signed_command.rs -> src/lib/mina_base/stake_delegation.ml L:11-13
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: ecbf1132c1c05dddc4629dd1ecf0a31c1af6682c)
✓ VALID: ledger/src/scan_state/transaction_logic/signed_command.rs -> src/lib/mina_base/signed_command_payload.ml L:179-181
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: ecbf1132c1c05dddc4629dd1ecf0a31c1af6682c)
✓ VALID: ledger/src/scan_state/transaction_logic/signed_command.rs -> src/lib/mina_base/signed_command_payload.ml L:239-243
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: ecbf1132c1c05dddc4629dd1ecf0a31c1af6682c)
✓ VALID: ledger/src/scan_state/transaction_logic/signed_command.rs -> src/lib/mina_base/signed_command_payload.ml L:352-362
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: ecbf1132c1c05dddc4629dd1ecf0a31c1af6682c)

Summary
=======
Total references found: 16
Valid references: 16
Invalid references: 0
Stale commits: 16

⚠ Warning: 16 reference(s) have stale commits
Run with --update to update them automatically

@github-actions
Copy link

github-actions bot commented Dec 3, 2025

✓ Code Reference Verification Passed

All code references in the documentation have been verified successfully!

Total references checked: 1
Valid references: 1

The documentation is in sync with the codebase on the develop branch.

@0xMimir 0xMimir force-pushed the feat/add-exit branch 2 times, most recently from 9033737 to b7212dd Compare December 3, 2025 10:04
@0xMimir 0xMimir changed the title Added exit if initial peers are invalid Added log if initial peers are invalid Dec 3, 2025
@0xMimir 0xMimir force-pushed the feat/add-exit branch 3 times, most recently from 35f70b1 to adf6fba Compare December 3, 2025 10:44
@0xMimir 0xMimir requested a review from dannywillems December 3, 2025 12:40
@0xMimir 0xMimir force-pushed the feat/add-exit branch 2 times, most recently from 51216b4 to 38dc53f Compare December 4, 2025 08:06
@dannywillems dannywillems moved this to In Review in Rust node Dec 4, 2025
@dannywillems
Copy link
Member

Looking at it now.
Running:

cargo run \
  -r \
  --bin mina -- \
    node \
    -P /ip4/5.5.5.5/tcp/8302/p2p/12D3KooWAMKZM7ysxRka2RfQWxCXXFTopjZ1eZcwtSi4VPgcdont

crate::core::error!(
crate::core::log::system_time();
summary = "Exiting",
error = "Invalid initial peers"
Copy link
Member

Choose a reason for hiding this comment

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

We are continuously printing on the stdout:

2025-12-04T16:42:16.552063Z ERROR node::reducer: time="1764866536552054251" summary="Exiting" error="Invalid initial peers"
2025-12-04T16:42:16.656957Z ERROR node::reducer: time="1764866536656948167" summary="Exiting" error="Invalid initial peers"
2025-12-04T16:42:16.761831Z ERROR node::reducer: time="1764866536761823042" summary="Exiting" error="Invalid initial peers"
2025-12-04T16:42:16.866726Z ERROR node::reducer: time="1764866536866719208" summary="Exiting" error="Invalid initial peers"
2025-12-04T16:42:16.971191Z ERROR node::reducer: time="1764866536971179084" summary="Exiting" error="Invalid initial peers"
2025-12-04T16:42:17.076161Z ERROR node::reducer: time="1764866537076153209" summary="Exiting" error="Invalid initial peers"
2025-12-04T16:42:17.181250Z ERROR node::reducer: time="1764866537181236750" summary="Exiting" error="Invalid initial peers"
2025-12-04T16:42:17.286159Z ERROR node::reducer: time="1764866537286148292" summary="Exiting" error="Invalid initial peers"
2025-12-04T16:42:17.391037Z ERROR node::reducer: time="1764866537391026792" summary="Exiting" error="Invalid initial peers"
2025-12-04T16:42:17.496219Z ERROR node::reducer: time="1764866537496203709" summary="Exiting" error="Invalid initial peers"
2025-12-04T16:42:17.601182Z ERROR node::reducer: time="1764866537601171959" summary="Exiting" error="Invalid initial peers"
2025-12-04T16:42:17.706175Z ERROR node::reducer: time="1764866537706161792" summary="Exiting" error="Invalid initial peers"
2025-12-04T16:42:17.811069Z ERROR node::reducer: time="1764866537811057709" summary="Exiting" error="Invalid initial peers"

However, it does not say which peers to remove. I know from the command I run for my test, but a user might be confused. Can you make it more explicit, please?

RpcEffectful(RpcEffectfulAction),

WatchedAccounts(WatchedAccountsAction),
Exit(ExitAction),
Copy link
Member

Choose a reason for hiding this comment

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

There is no documentation for the others. Could you add a one-liner please?

Also, why do you call it Exit? By reading the code, I would have expected that it is an action to kill the node. But it is simply writing an error message. It is inconsistent with what we would expect by reading the code.

if p2p.ready_peers().is_empty() && kad_state.has_bootstraped {
if let Some(tip) = &state.transition_frontier.best_tip_breadcrumb() {
// TODO: this might need to change in future
if tip.height() == 296372 {
Copy link
Member

Choose a reason for hiding this comment

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

Where does this value come from?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure where it comes from exactly, but when adding:

dbg!(state
                .transition_frontier
                .best_tip_breadcrumb()
                .map(|t| t.height()));

To check timeouts action and running node without internet connecting that is the value that gets printed

CHANGELOG.md Outdated
Dashboard, documenting all endpoints and specific data fields used by the
frontend ([#1566](https://github.com/o1-labs/mina-rust/issues/1566))

- **FEATURE**: Add logging if initial peers are invalid
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- **FEATURE**: Add logging if initial peers are invalid
- **Feature**: Add logging if an initial peer is invalid

FEATURE -> Feature: there is no need to capitalize the word.
Plural -> singular: one initial peer is enough to have a log.

pub streams: StreamState<P2pNetworkKadStreamState>,
pub status: P2pNetworkKadStatus,
pub filter_addrs: bool,
pub has_bootstraped: bool,
Copy link
Member

Choose a reason for hiding this comment

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

Is it still related to the initial goal of this patch? I don't understand the link.

Copy link
Member

Choose a reason for hiding this comment

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

I see, it is used in a condition above.

Copy link
Member

@dannywillems dannywillems left a comment

Choose a reason for hiding this comment

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

See comments

@dannywillems dannywillems moved this from In Review to In Progress in Rust node Dec 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

Node runs indefinitely and doesn't exit if initial peer is invalid/offline

3 participants