stellar-deprecated / stellard

INACTIVE. Server in the Stellar network. Maintains the distributed ledger. Introduces and validates transactions. This repo is not in active development, it is being replaced by stellar-core.
Other
271 stars 60 forks source link

Cannot remove trustlines with NoRipple flag set to true. #156

Open nullstyle opened 9 years ago

nullstyle commented 9 years ago

As reported here https://stellartalk.org/topic/6435-removing-trust-lines/ and it appears as well in #96:

When a trustline has been set with the NoRipple flag set to true, it appears you cannot remove it, even when you balance is zero and you set the limit to "0".

Notice, for example from an account_lines response on my account:

         {
            "account" : "gnhPFpbYXcYGMkGxfWdQGFfuKEdJoEThVo",
            "balance" : "0",
            "currency" : "NOK",
            "limit" : "0",
            "limit_peer" : "0",
            "no_ripple" : true
         }

Submitting a transaction while logged into my account returns tesSuccess, but nothing changes. An example script to perform this (if executed after logging into the stellar client:

var tx = $get("StellarNetwork").remote.transaction();
tx.trustSet($get("session").get('address'), {
  value: "0",
  currency: "NOK",
  issuer: "gnhPFpbYXcYGMkGxfWdQGFfuKEdJoEThVo"
});
tx.setFlags('NoRipple');
tx.submit();
nullstyle commented 9 years ago

Note, setting NoRipple or not on the transaction to remove the trustline has no discernible effect.

MarkusTeufelberger commented 9 years ago

This is intentional in Ripple at least. Why should this be a bug?

nullstyle commented 9 years ago

Because it's confusing, and also raises the reserve on my account. Why should setting NoRipple to true make a trustline permanent in the ledger? What was the intention?

MarkusTeufelberger commented 9 years ago

It is not permanent, it just is not cleared out if you have any flag left not in its default position. Otherwise it would be easy to make others enable rippling (as a new trust line would have default flags) by resetting their flags, you'd just need a way to set their balance to 0 shortly.

nullstyle commented 9 years ago

I don't understand the attack, could you please elaborate? Are you saying, in the event that a person holds a balance on one issuer, but has set the limit of that trustline to zero, you can make them enable rippling again if you somehow convince them to send their entire balance to another account? If so, that seems fine, since the limit is 0, they will not be able to receive any additional funds from that issuer.

To me, in the absence of a specific "Delete this trust line" transaction, setting a limit to zero seems to be an unambiguous signal for deleting a trustline: "Delete this when you can", if you will.

johansten commented 9 years ago

The problem I was facing in the end seems to have been that my serialized '0' Amount had an exponent that was off by one. So, my bad.