Add robust property-based tests for the assertNoTimeWarp function using
the rapid testing library. The tests verify the following scenarios:
- Basic property tests:
- Only retarget blocks (block height divisible by blocksPerRetarget) are checked
- Valid timestamps (within maxTimeWarp of previous block) pass validation
- Invalid timestamps (too early) fail with appropriate ErrTimewarpAttack
- Correct boundary behavior (exactly at maxTimeWarp limit)
- Invariant tests:
- Function never panics with valid inputs
- Non-retarget blocks always return nil regardless of timestamps
- Security tests:
- All retarget blocks are protected from timewarp attacks
- Non-retarget blocks are not affected by the timewarp check
A fix for a bug introduced by #2168
Previously, config.Host worked in the following way:
1. Documented as supporting ip addresses only
2. In fact supported "host/path" syntax
3. Did not support "scheme" prefixes, i.e. https://
Not sure this is the desired approach, probably the best thing would
have been to extend config to contain "Scheme" and "Path" fields as well.
However, this was the way it worked.
1. Now Host can contain scheme prefixes "unix://..."
2. Host can no longer contain ".../path"
This PR solves this behavior while maintaining support of the "unix://" flow
as well.
For some reason, "scheme" is named "network" in #2168 - I did not change that.
Also remove disambiguation in "network:address:port", where it parsed
"myhost:8888" as network:address instead address:port.
IBD for new nodes were broken due to the version handshake failing
between nodes that recognized wtxid based relays. Reverting the changes
that were made so that the node is able to connect to those nodes.
Execution traces are part of the go runtime tooling and is useful to
check what is slowing down the ibd. For example, a slow ibd because of
slow block downloads from peers won't show up on cpu profiling but will
on a trace.
* Add support for wtxidrelay message.
This adds support for the wtxidrelay (BIP339) message in wire.
While here, add tests for sendaddrv2 and rename AddrV2Version to
SendAddrV2Version in order to make the code consistent with all other
messages. This diff does keep the old AddrV2Version constant for
backwards compatibility.
* Bump copyrights
Fixes#2224 and lightningnetwork/lnd#9053.
Depending on the version of Bitcoin Core, the "warnings" field in the
response to getnetworkinfo is either a single string value or an array
of strings.
We can easily parse those two variants with a custom type that
implements an UnmarshalJSON method.