Skip to content

Commit

Permalink
Merge branch 'develop' into feature/partial-payment-fieldname
Browse files Browse the repository at this point in the history
  • Loading branch information
Bronek committed Oct 18, 2023
2 parents d1a2c59 + 41cd337 commit 44771d1
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 13 deletions.
21 changes: 19 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,27 @@ Please check [x] relevant options, delete irrelevant ones.
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Refactor (non-breaking change that only restructures code)
- [ ] Tests (You added tests for code that already exists, or your new feature included in this PR)
- [ ] Documentation Updates
- [ ] Tests (you added tests for code that already exists, or your new feature included in this PR)
- [ ] Documentation update
- [ ] Chore (no impact to binary, e.g. `.gitignore`, formatting, dropping support for older tooling)
- [ ] Release

### API Impact

<!--
Please check [x] relevant options, delete irrelevant ones.
* If there is any impact to the public API methods (HTTP / WebSocket), please update https://github.com/xrplf/rippled/blob/develop/API-CHANGELOG.md
* Update API-CHANGELOG.md and add the change directly in this PR by pushing to your PR branch.
* libxrpl: See https://github.com/XRPLF/rippled/blob/develop/docs/build/depend.md
* Peer Protocol: See https://xrpl.org/peer-protocol.html
-->

- [ ] Public API: New feature (new methods and/or new fields)
- [ ] Public API: Breaking change (in general, breaking changes should only impact the next api_version)
- [ ] `libxrpl` change (any change that may affect `libxrpl` or dependents of `libxrpl`)
- [ ] Peer protocol change (must be backward compatible or bump the peer protocol version)

<!--
## Before / After
If relevant, use this section for an English description of the change at a technical level.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
id: pip-cache
shell: bash
run: |
pip install --upgrade pip
python -m pip install --upgrade pip
echo "dir=$(pip cache dir)" | tee ${GITHUB_OUTPUT}
- name: restore Python cache directory
uses: actions/cache@v3
Expand Down
35 changes: 27 additions & 8 deletions src/ripple/peerfinder/impl/Logic.h
Original file line number Diff line number Diff line change
Expand Up @@ -416,10 +416,9 @@ class Logic
// assert later when erasing the key.
slot->public_key(key);
{
auto const result = keys_.insert(key);
[[maybe_unused]] bool const inserted = keys_.insert(key).second;
// Public key must not already exist
assert(result.second);
(void)result.second;
assert(inserted);
}

// Change state and update counts
Expand All @@ -434,7 +433,11 @@ class Logic
if (slot->fixed() && !slot->inbound())
{
auto iter(fixed_.find(slot->remote_endpoint()));
assert(iter != fixed_.end());
if (iter == fixed_.end())
LogicError(
"PeerFinder::Logic::activate(): remote_endpoint "
"missing from fixed_");

iter->second.success(m_clock.now());
JLOG(m_journal.trace()) << beast::leftw(18) << "Logic fixed "
<< slot->remote_endpoint() << " success";
Expand Down Expand Up @@ -858,7 +861,11 @@ class Logic
{
auto const iter = slots_.find(slot->remote_endpoint());
// The slot must exist in the table
assert(iter != slots_.end());
if (iter == slots_.end())
LogicError(
"PeerFinder::Logic::remove(): remote_endpoint "
"missing from slots_");

// Remove from slot by IP table
slots_.erase(iter);
}
Expand All @@ -867,15 +874,23 @@ class Logic
{
auto const iter = keys_.find(*slot->public_key());
// Key must exist
assert(iter != keys_.end());
if (iter == keys_.end())
LogicError(
"PeerFinder::Logic::remove(): public_key missing "
"from keys_");

keys_.erase(iter);
}
// Remove from connected address table
{
auto const iter(
connectedAddresses_.find(slot->remote_endpoint().address()));
// Address must exist
assert(iter != connectedAddresses_.end());
if (iter == connectedAddresses_.end())
LogicError(
"PeerFinder::Logic::remove(): remote_endpont "
"address missing from connectedAddresses_");

connectedAddresses_.erase(iter);
}

Expand All @@ -894,7 +909,11 @@ class Logic
if (slot->fixed() && !slot->inbound() && slot->state() != Slot::active)
{
auto iter(fixed_.find(slot->remote_endpoint()));
assert(iter != fixed_.end());
if (iter == fixed_.end())
LogicError(
"PeerFinder::Logic::on_closed(): remote_endpont "
"missing from fixed_");

iter->second.failure(m_clock.now());
JLOG(m_journal.debug()) << beast::leftw(18) << "Logic fixed "
<< slot->remote_endpoint() << " failed";
Expand Down
2 changes: 1 addition & 1 deletion src/ripple/protocol/TER.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ enum TECcodes : TERUnderlyingType {
tecKILLED = 150,
tecHAS_OBLIGATIONS = 151,
tecTOO_SOON = 152,
tecHOOK_ERROR [[maybe_unused]] = 153,
tecHOOK_REJECTED [[maybe_unused]] = 153,
tecMAX_SEQUENCE_REACHED = 154,
tecNO_SUITABLE_NFTOKEN_PAGE = 155,
tecNFTOKEN_BUY_SELL_MISMATCH = 156,
Expand Down
2 changes: 1 addition & 1 deletion src/ripple/protocol/impl/BuildInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace BuildInfo {
// and follow the format described at http://semver.org/
//------------------------------------------------------------------------------
// clang-format off
char const* const versionString = "2.0.0-b2"
char const* const versionString = "2.0.0-b3"
// clang-format on

#if defined(DEBUG) || defined(SANITIZER)
Expand Down

0 comments on commit 44771d1

Please sign in to comment.