-
Notifications
You must be signed in to change notification settings - Fork 503
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
Support stellar-core protocol 13 (CAP 18) - "Fine-Grained Control of Authorization" #2357
Comments
@ire-and-curses @tamirms @bartekn I think this is all we need for cap 18 support. I put a question in the requirements, we could combine both flags or we could expose both flags in the balances payload. I'd prefer to expose the new flag so it's clear for final users what's the actual state of the trust line. Alternatively, we could also add the attribute cc @jonjove |
I'm not a fan of having the authorization state spread across two booleans. Nor am I a fan of of having a bit masked integer as part of horizon's json api. I propose:
|
@tomerweller If you change to a "status" string field, how would you plan to deal with a future where there are flags that aren't mutually exclusive? |
@tomerweller I agree we should probably start soft deprecating I discussed this briefly with @tamirms and we'll do the following:
|
@jonjove you're right - I was under the assumption that states will be mutually exclusive. In that case maybe adding multiple boolean fields is indeed the "jsony" way to go. @abuiles and @tamirms, I'd say that adding fields that require an SDK to understand is a step in the wrong direction. Horizon's query results currently don't require that. This is not theoretical. When I write tools that query horizon I don't bother bringing in an sdk dependency. It would be great to keep it like that. |
@tomerweller good point! Also if you read the issue, we'll have to do something similar to list effects. So we are back to the original plan. |
Fixed in #2423 |
#274) The upcoming stellar-core protocol 13 release will add support for CAP 18 ("Fine-Grained Control of Authorization"). Horizon has added a is_authorized_to_maintain_liabilities field to the account balance attributes. Also, there is now a new effect which indicates a trustline was authorized to maintain liabilities. See stellar/go#2357 for more details. This PR updates the java SDK so that it's able to parse the new Horizon account balance and effects responses.
The upcoming
stellar-core
protocol 13 release will add support for CAP 18 ("Fine-Grained Control of Authorization").Horizon
is_authorized_to_maintain_liabilities
to balance attributesauthorized_to_main_liabilities
to operation details when Op is OperationAllowTrust https://github.com/stellar/go/blob/protocol-13/services/horizon/internal/expingest/processors/operations_processor.go#L260AllowTrust
in protocols to include Flags https://github.com/abuiles/go/blob/e12b580711a108b61a53bc58891ca2916f054c5a/protocols/horizon/operations/main.go#L191-L197 -history.EffectTrustlineAuthorizedToMaintainLiabilities
https://github.com/abuiles/go/blob/e12b580711a108b61a53bc58891ca2916f054c5a/services/horizon/internal/expingest/processors/effects_processor.go#L539-L559history.EffectTrustlineAuthorizedToMaintainLiabilities
to effects resource adapter https://github.com/abuiles/go/blob/e12b580711a108b61a53bc58891ca2916f054c5a/services/horizon/internal/resourceadapter/effects.go#L100-L103Backward compatibility
Since the binary representation of
bool authorize
is the same asuint32 authorize
fortrue
orfalse
, we can roll this changes in Horizon and SDKS before protocol 13 is deployed to stellar core.They'll only have problems if they try to set
authorize
toAUTHORIZED_TO_MAINTAIN_LIABILITIES_FLAG
since it won't be recognize by protocol 12.Again, if the CAP doesn't go through, we can roll the changes in a safe manner.
The text was updated successfully, but these errors were encountered: