The Codeberg repositories are being retired. README links, the five
Gitian descriptors' source URL, gitian-build.py and dockrun.sh now use
github.com/wownero/wownero and github.com/wownero/gitian.sigs.
The Codeberg repositories are being retired. GitHub wownero/RandomWOW
carries the same 1.2.1-wow history, and the pinned RandomWOW commit is
unchanged.
Port of tevador/RandomX#325, shipped in RandomX v1.2.2 and picked up
by Monero v0.18.5.3. With src = dst and imm = 0x80000000 the ARM64
and RISC-V JIT negated -2^31 to itself and produced a wrong hash.
RandomWOW is RandomX v1.2.1 plus parameters, and the patch applies
unchanged.
estimate_rct_tx_size() and estimate_tx_weight() compute the Bulletproof padded
output count with `while ((1<<log_padded_outputs) < n_outputs)`, shifting a
signed int. For n_outputs > 2^30 this reaches `1 << 31` (signed overflow, UB),
and once the shift count exceeds the int width the value cycles and never
reaches n_outputs, so the loop never terminates. estimate_tx_size_and_weight()
accepts n_outputs up to INT_MAX (only negative is rejected), so a single
wallet-rpc call spins the handling thread forever.
Shift an unsigned 64-bit one and compare in uint64_t at all three shift sites,
and accumulate the estimated size in size_t (cast the per-input and per-output
terms) so the size arithmetic cannot overflow for large counts.
(cherry picked from commit a3deaab98a)
(cherry picked from commit ac37e75df8aedf43aa7afa1199ec24e229039f34)
Simple API to check max blob size before parsing. This is useful
when reading blobs from untrusted sources.
@selsta pointed out that coinbase txs can technically be larger
than get_max_tx_size(), otherwise we could enforce it on all txs.
(cherry picked from commit b66e2227c2f937a3e09dd62ed770b0667bff0779)
Detect peer EOF and TLS closure before reusing idle connections. Make
disconnect idempotent while preserving buffered data and pending operation
lifetimes.
Keep the release branch's multi-byte recv_n behavior, and cover partial EOF,
socket modes, and TLS shutdown with loopback regression tests. Use fixed
test certificates and retain compatibility with the release branch's
Google Test version.
Co-authored-by: woodser <13068859+woodser@users.noreply.github.com>
(cherry picked from commit 096abdaa22b71ade9ca673ed8012c500cecb58d3)
The handshake timeout should just be an absolute timeout, we don't
care about partial messages received during the handshake.
(cherry picked from commit c7c43686878166cd0b93bed0cc712c8dd9845c89)
- We select peers to relay to based on their latest known sync height.
- This change:
A) makes sure to update the peer's latest known sync height upon
validating the peer's newly relayed blocks.
B) Allows for a wider window so that if we haven't yet received the
peer's block or finished validating it, then the peer can still be
a valid candidate to receive our new txs.
(cherry picked from commit 437c45bebd621b1fdbcf0b19a4437d002b51ef8e)