-
Notifications
You must be signed in to change notification settings - Fork 57
Iterative Channel Package Computation
Nodes set fee rate restrictions as a mechanism to limit the size of their memory pools. The variability of these restrictions may prevent the propagation of transactions to miners which would accept these lesser fees. Packaging related transactions which together satisfy the restriction would allow the potential to overcome network bottlenecks. However, redundant signaling of transactions may lead to a waste of bandwidth. It is thus desirable to customize packages between peers to minimize such waste. The following proposes a mechanism of dynamically packaging related transactions in such a way that the fee rate would be acceptable to a receiving node and thus further the propagation of transactions with minimal data redundancy.
Let
Let
For each known channel
Package(t, c):
Let P_{t,c} be the potential canonical package of t to c, initially empty.
Let f be the cumulative fee, initially zero.
Let b be the cumulative bytes, initially zero.
Let s be the cumulative sigops, initially zero.
Let Visited_{t,c}(t_{v}) provide an indicator that a transaction has been
traversed, initially all false.
try
Visit(t, t, c, &f, &b, &s, &P_{t,c})
catch IMPOSSIBLE_PACKAGE
return {}
if (f / b >= R(c))
return P_(t,c)
Visit(t_{origin}, t_{current}, c, f, b, s, P_{t_{origin},c}):
if ((b_{max} < Bytes(t_{current}) + b) || (s_{max} < Sigops(t_{current}) + s))
throw IMPOSSIBLE_PACKAGE
b += Bytes(t_{current})
s += Sigops(t_{current})
f += Fee(t_{current})
prepend t_{current} to the list P_{t_{origin},c}
Visited_{t_{origin},c}(t_{current}) = true
for each transaction input t_{input} of t_{current}
if (!Visited_{t_{origin},c}(t_{input}) && !Known_{c}(t_{input}) &&
!Confirmed(t_{input}))
Visit(t_{origin}, t_{input}, c, f, b, s, P_{t_{origin},c})
The above provides a depth-first walk through the graph of transactions. By holding in a graph only those transactions in the memory pool, checking for confirmedness would be unnecessary.
Assume
The above depends on
- Assume on connection that a peer is long running and contains our memory pool.
- Rely upon memory pool synchronization to populate.
- Upon channel creation, iterate the above algorithm for each transaction, starting with transactions whose parents are confirmed.
Upon reception of a transaction
Users | Developers | License | Copyright © 2011-2024 libbitcoin developers