Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Touch amendment #294

Open
wants to merge 19 commits into
base: dev
Choose a base branch
from
Open

Touch amendment #294

wants to merge 19 commits into from

Conversation

RichardAH
Copy link
Contributor

An amendment to ensure that all accounts that are affected or could be affected by a txn appear in the txn metadata, akin to the touch command in *nix systems.

WIP

#288

High Level Overview of Change

Context of Change

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • 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 update
  • Chore (no impact to binary, e.g. .gitignore, formatting, dropping support for older tooling)
  • Release

API Impact

  • 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)

@dangell7 dangell7 added Amendment New feature or fix amendment feature Feature Request labels Mar 18, 2024
@dangell7
Copy link
Collaborator

Because the new field TouchCounter doesnt exist and is optional the first update leaves us with an empty json PreviousFields.

This occurs here. I dont believe we need do anything I just wanted to notate it.

{
    "ModifiedNode" : 
    {
        "FinalFields" : 
        {
            "Account" : "rPMh7Pi9ct699iZUTWaytJUoHcJ7cgyziK",
            "AccountIndex" : "1",
            "Balance" : "997999990",
            "Flags" : 41943040,
            "OwnerCount" : 1,
            "Sequence" : 3,
            "TouchCount" : "1"
        },
        "LedgerEntryType" : "AccountRoot",
        "LedgerIndex" : "DE3BE7FDF6864FB024807B36BFCB4607E7CDA7D4C155C7AFB4B0973D638938BF",
        "PreviousFields" : {}
    }
}

@dangell7
Copy link
Collaborator

For Reviewers:

When a trustline is frozen it updates the TouchCount for the account that has the trustline. This didn't occur previously.

This was one of the only locations where the number of affected nodes is tested. This change does mean that every TSH will get a TouchCount update which may add txns to their account_tx stream which they may or may not understand.

@dangell7 dangell7 changed the title Touch amendment [DO NOT MERGE] Touch amendment May 23, 2024
@dangell7 dangell7 requested a review from tequdev September 19, 2024 12:54
@RichardAH
Copy link
Contributor Author

I think this is basically ready

src/ripple/protocol/Feature.h Outdated Show resolved Hide resolved
touchAccount(
ApplyView& view,
AccountID const& id,
std::optional<std::shared_ptr<SLE>> sle)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the intent of this argument that is not actually used?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RichardAH I removed this. Can you re-review? Was this done so that later you could call it from another location and include the sle? Can we just remove that and add it later if we need to?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was forward thinking for other touches where the SLE is already provided by the calling function.
Speaking of which, I just did a quick code review and don't we need touch in a few other places not just unfunded offers?

@RichardAH RichardAH force-pushed the dev branch 2 times, most recently from 77b8c83 to 532a471 Compare December 11, 2024 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Amendment New feature or fix amendment feature Feature Request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants