Skip to content

[release-v2.1] multi: Main module backports.#3660

Merged
davecgh merged 5 commits intodecred:release-v2.1from
davecgh:rel21_main_backports
Apr 6, 2026
Merged

[release-v2.1] multi: Main module backports.#3660
davecgh merged 5 commits intodecred:release-v2.1from
davecgh:rel21_main_backports

Conversation

@davecgh
Copy link
Copy Markdown
Member

@davecgh davecgh commented Apr 6, 2026

davecgh added 5 commits April 6, 2026 13:32
This cleans up and modernizes the code related to checking transaction
inputs as follows:

- Make code more consistent with the rest of the package
- Update various errors to include more detailed information:
  - Consistently include the full referenced output in errors instead of
    only the transaction hash
  - Use fewer abbreviations in errors to improve clarity
- Add some additional checks to assert invalid states
- Consolidate logic for adding txouts to views and improve readability
  with new types and funcs
- Conform to the modern editorconfig settings
The sync manager considers the services when the initial peer is
created, but the remote services are not known until the handshake
completes.

This adds a channel that is closed when a verack is received in order to
wait for the handshake to complete prior to creating the sync manager
peer to ensure the remote services are known and populated.

It also moves the code that adds the peer to the server to happen after
the handshake as well since it relies on the sync manager.

This was discovered by changes that will be in the next commit to no
longer improperly assume the remote services before they're known.
- Comments and more descriptive names for tests.
- Using t.Run() provides better test metrics and removes the need to
  include the name of the test in log lines.
- Pull a block out TestCheckAuth and make it a separate test.
This fixes an issue where the server treated an unset admin auth hash as
unconditional success under the assumption that this state corresponds
to the server running certificate auth. However, the server can also
reach this state under basic auth by configuring limited credentials
without admin credentials. In this case the limited user would have
unrestricted access to all admin functions.
When both the `Origin` header and the request `Host` header lack an
explicit port (common behind reverse proxies on standard ports 443/80),
both values collapse to empty string, and `equalASCIIFold("",
"")` returns `true` - allowing **any cross-origin websocket handshake**
to succeed.
@davecgh davecgh added this to the 2.1.4 milestone Apr 6, 2026
@davecgh davecgh merged commit b2331a9 into decred:release-v2.1 Apr 6, 2026
34 checks passed
@davecgh davecgh deleted the rel21_main_backports branch April 6, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants