Skip to content

WIP implementation of protocol 1.7#303

Draft
SomberNight wants to merge 27 commits into
spesmilo:masterfrom
SomberNight:202502_protocol_1_6
Draft

WIP implementation of protocol 1.7#303
SomberNight wants to merge 27 commits into
spesmilo:masterfrom
SomberNight:202502_protocol_1_6

Conversation

@SomberNight
Copy link
Copy Markdown
Member

WIP implementation of spesmilo/electrum-protocol#2

@SomberNight SomberNight force-pushed the 202502_protocol_1_6 branch 2 times, most recently from 938fde4 to 6370b49 Compare July 29, 2025 17:01
@SomberNight SomberNight changed the title WIP implementation of protocol 1.6 WIP implementation of protocol 1.7 Oct 23, 2025
@SomberNight SomberNight added this to the protocol 1.7 milestone Oct 23, 2025
Supposedly it makes a difference (see e.g. [0]), and depending on how batching
works it makes sense it would, but during a few full syncs of testnet I've done,
it was within measurement error. Still, existing code was already doing this.

[0]: https://stackoverflow.com/q/54941342
with the pending db changes, an upgrade is ~as fast as a resync from genesis
khanbilal732

This comment was marked as abuse.

khanbilal732

This comment was marked as abuse.

khanbilal732

This comment was marked as abuse.

Comment thread src/electrumx/server/mempool.py
@SomberNight SomberNight force-pushed the 202502_protocol_1_6 branch from 525d000 to b9abbff Compare April 29, 2026 14:30
Comment thread src/electrumx/server/session.py Outdated

PROTOCOL_MIN = (1, 4)
# consider bumping Coin.MIN_REQUIRED_DAEMON_VERSION too when releasing a new protocol version
PROTOCOL_MAX = (1, 6, 0)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

should be (1, 7, 0)

This will allow looking up which tx spent an outpoint.
In Bitcoin consensus, a txout index is stored as a uint32_t.
However, in practice, an output in a tx uses at least 10 bytes (for an OP_TRUE output), so
- to exhaust a 2 byte namespace, a tx would need to have a size of at least 2 ** 16 * 10 = 655 KB,
- to exhaust a 3 byte namespace, a tx would need to have a size of at least 2 ** 24 * 10 = 167 MB.
@SomberNight SomberNight force-pushed the 202502_protocol_1_6 branch from 1303e45 to a1f2942 Compare May 6, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants