Skip to content
This repository was archived by the owner on Apr 23, 2024. It is now read-only.
This repository was archived by the owner on Apr 23, 2024. It is now read-only.

sdk/agent: should not error if the reason close fails is because other client successfully submitted the close #461

Description

@leighmcculloch

In an early close scenario both participants submit the final close transaction. This is done so that neither party is relying on the other party doing the right thing.

The relevant code is here:

The client that lead the charge on the early close agreement gets the response from the other client and submits it:
https://github.com/stellar/starlight/blob/919096552e44eec5ec3fd6278922396926239874/sdk/agent/agent.go#L713-L728

The client that is asked to close early submits the transaction immediately after they sign the request:
https://github.com/stellar/starlight/blob/919096552e44eec5ec3fd6278922396926239874/sdk/agent/agent.go#L676-L691

This results in an error being passed back up to the application using the agent, which is not ideal.

The agent should inspect the error, and if the error indicates that the fee was insufficient it should take some smarter actions such as:

  • Increasing the fee 10x and resubmitting the tx.
  • Monitoring for if the inner tx was submitted successfully and if so considering all is good.

Related Discord discussion: https://discord.com/channels/897514728459468821/910623239292739585/1017480647373230110

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions