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

Increase Trust Operation #285

Open
JeremyRubin opened this issue Apr 9, 2019 · 0 comments
Open

Increase Trust Operation #285

JeremyRubin opened this issue Apr 9, 2019 · 0 comments
Labels
CAP Represents an issue that requires a CAP. enhancement CAP that adds or changes functionality as opposed to a fix. needs draft This an issue that has no corresponding draft, and as such has not entered the CAP/SEP process.

Comments

@JeremyRubin
Copy link
Contributor

One of the issues with trust lines is that when they need to be increased, it requires an out-of-band read of the current value.

This issues proposes a new operation which combines a read with a write (similar semantics to fetch_add).

What the new operation should do is to have an increment and a maximum value for the trustline. e.g.:

Operation FetchAddIncreaseTrust {
    asset a
    int increment,
    int limit,
}

The increment saturates up to the limit. Therefore, if the account exists, increment should never fail -- it can only succeed less.

If limit < the trust line's limit, nothing happens.

This makes it easier to have multiple pending payments from different parties without ever giving a user more trustline capacity than they need to have to hold the assets sent to them.

This is useful because otherwise every trustline increase before a payment sent has an inherent race condition, and every transaction with a increase and a send must happen serially otherwise. It also makes it impossible to have long standing smart contracts which pay to trustlines.

The trustline itself may also require Authorization, in which case this operation should either automatically require an Allow Trust or should be paired with an allow trust.

Opening for discussion now.

@theaeolianmachine theaeolianmachine added CAP Represents an issue that requires a CAP. enhancement CAP that adds or changes functionality as opposed to a fix. needs draft This an issue that has no corresponding draft, and as such has not entered the CAP/SEP process. labels Apr 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CAP Represents an issue that requires a CAP. enhancement CAP that adds or changes functionality as opposed to a fix. needs draft This an issue that has no corresponding draft, and as such has not entered the CAP/SEP process.
Projects
None yet
Development

No branches or pull requests

3 participants
@theaeolianmachine @JeremyRubin and others