Skip to content

Conversation

brunoerg
Copy link
Contributor

@brunoerg brunoerg commented Apr 5, 2024

In i2p documentation, it says that "the first time Bitcoin Core connects to the I2P router,
it automatically generates a persistent I2P address and its corresponding private key by
default or if -i2pacceptincoming=1 is set". This is weird, because -i2pacceptincoming=1
by itself does not have any effect. Moreover, -i2pacceptincoming is 1 by default anyway.

@DrahtBot
Copy link
Contributor

DrahtBot commented Apr 5, 2024

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK laanwj, byaye, davidgumberg, achow101

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

@DrahtBot DrahtBot added the Docs label Apr 5, 2024
@brunoerg
Copy link
Contributor Author

brunoerg commented Apr 5, 2024

cc: @vasild

@laanwj
Copy link
Member

laanwj commented Apr 9, 2024

This documentation change is correct and makes the documentation slightly shorter, thus easier to read. ACK 2179e2c

Copy link

@byaye byaye left a comment

Choose a reason for hiding this comment

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

ACK 2179e2c

@davidgumberg
Copy link
Contributor

ACK 2179e2c

Checked (without testing) that behavior is as described.
In CConman::ConnectNode, unless i2pacceptincoming == 0, a persistent I2P session (m_transient == false) with a private key stored on disk is used. Otherwise, we create a transient I2P session (m_transient == true).

Relevant section of i2p::sam::Session::CreateIfNotCreatedAlready() (called by i2p::sam::Session::Connect):

if (m_transient) {
	// The destination (private key) is generated upon session creation and returned
	// in the reply in DESTINATION=.

	// [...]
} else {
	// Read our persistent destination (private key) from disk or generate
	// one and save it to disk. Then use it when creating the session.
	const auto& [read_ok, data] = ReadBinaryFile(m_private_key_file);
	if (read_ok) {
		m_private_key.assign(data.begin(), data.end());
	} else {
		GenerateAndSavePrivateKey(*sock);
	}
	// [...]
}

@achow101
Copy link
Member

ACK 2179e2c

@achow101 achow101 merged commit 063072b into bitcoin:master Apr 30, 2024
Copy link
Contributor

@vasild vasild left a comment

Choose a reason for hiding this comment

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

ACK 2179e2c

kwvg added a commit to kwvg/dash that referenced this pull request Apr 14, 2025
PastaPastaPasta added a commit to dashpay/dash that referenced this pull request Apr 22, 2025
, bitcoin#28078, bitcoin#27071, bitcoin#28077, bitcoin#28692, bitcoin#29813, bitcoin#30085, bitcoin#29833, partial bitcoin#24356 (networking backports: part 11)

5699158 merge bitcoin#29833: fix and improve logs (Kittywhiskers Van Gogh)
95a1853 merge bitcoin#30085: detect addnode cjdns peers in GetAddedNodeInfo() (Kittywhiskers Van Gogh)
9d959d7 merge bitcoin#29813: improve `-i2pacceptincoming` mention (Kittywhiskers Van Gogh)
5045fa3 merge bitcoin#28692: Delete i2p fuzz test (Kittywhiskers Van Gogh)
7b01e8b merge bitcoin#28077: also sleep after errors in Accept() & destroy the session if we get an unexpected error (Kittywhiskers Van Gogh)
0c42410 merge bitcoin#27071: Handle CJDNS from LookupSubNet() (Kittywhiskers Van Gogh)
821c11f merge bitcoin#28078: remove unneeded exports, use helpers over low-level code, use optional (Kittywhiskers Van Gogh)
d051929 refactor: replace external `::GetLocal()` usage (Kittywhiskers Van Gogh)
481175f merge bitcoin#27719: remove Tor link & generalize onion getnodeaddresses RPC (Kittywhiskers Van Gogh)
378ad01 merge bitcoin#25989: abort if i2p/cjdns are chosen via -onlynet but are unreachable (Kittywhiskers Van Gogh)
8b23bfb partial bitcoin#24356: replace CConnman::SocketEvents() with mockable Sock::WaitMany() (Kittywhiskers Van Gogh)
1a64e8d merge bitcoin#25286: remove duplicate categories from LogPrint output (Kittywhiskers Van Gogh)

Pull request description:

  ## Breaking Changes

  None expected.

  ## Checklist

  - [x] I have performed a self-review of my own code
  - [x] I have commented my code, particularly in hard-to-understand areas **(note: N/A)**
  - [x] I have added or updated relevant unit/integration/functional/e2e tests
  - [x] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

ACKs for top commit:
  UdjinM6:
    utACK 5699158
  PastaPastaPasta:
    utACK 5699158

Tree-SHA512: b1ffc310574de5ec40d18aa4a453ef328d8f935c42d43a204c14fa264f099a106ddea793a018f56dcf75d9548fb06d1580c6aa1d90f66afa95089435e0b9606d
@bitcoin bitcoin locked and limited conversation to collaborators May 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants