Skip to content

Conversation

@SomberNight
Copy link
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
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.
Similar to scripthash statuses, the height of an unconfirmed tx is:
- `-1` if it has any unconfirmed parents,
- `0` otherwise.
History.get_txnums and History.backup depend on ordering of tx_nums,
so we want the lexicographical order (used by leveldb comparator) to
match the numerical order.
in a way that works consistently between LevelDB and RocksDB.
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.

1 participant