Skip to content

Releases: stellar/go

Horizon 1.3.0

20 May 01:11
820becd
Compare
Choose a tag to compare

Breaking changes

  • The type for the following attributes has been changed from int64 to string (#2555):

Changes

  • Add last_modified_time to account responses. last_modified_time is the closing time of the most recent ledger in which the account was modified (#2528).
  • Balances in the Account resource are now sorted by asset code and asset issuer (#2516).
  • Ingestion system has its dedicated DB connection pool (#2560).
  • A new metric has been added to /metrics (#2537 and #2553):
    • ingest.local_latest_ledger: a gauge with the local latest ledger,
    • txsub.v0: a meter counting v0 transactions in POST /transaction,
    • txsub.v1: a meter counting v1 transactions in POST /transaction,
    • txsub.feebump: a meter counting feebump transactions in POST /transaction.
  • Fix a memory leak in the code responsible for streaming (#2548, #2575 and #2576).

horizonclient v3.0.1 & txnbuild v3.0.1

11 May 16:24
5b5b4d6
Compare
Choose a tag to compare
  • Fix a bug in txnbuild which occurs when parsing transactions with manage data operations containing nil values (#2573)

Horizon 1.2.2

07 May 20:21
b6be38c
Compare
Choose a tag to compare
  • Fix bug which occurs when ingesting ledgers containing both fee bump and normal transactions (#2562).

Horizon 1.2.1

01 May 08:08
ddb2b85
Compare
Choose a tag to compare

Database migration notes

This version removes two unused columns that could overflow in catchup complete deployments. If your Horizon database contains entire public network history, you should upgrade to this version as soon as possible and run horizon db migrate up.

Changes

  • Remove id columns from history_operation_participants and history_transaction_participants to prevent possible integer overflow #2532.

horizonclient v3.0.0 & txnbuild v3.0.0

28 Apr 19:47
20797e3
Compare
Choose a tag to compare

txnbuild

Breaking changes

  • The Account interface has been extended to include GetSequenceNumber() (int64, error). Also, IncrementSequenceNumber() now returns an (int64, error) pair instead of a (xdr.SequenceNumber, error) pair.
  • Refactor workflow for creating and signing transactions. Previously, you could create a transaction envelope by populating a Transaction instance and calling the Build() function on the Transaction instance.

Transaction is now an opaque type which has accessor functions like SourceAccount() SimpleAccount, Memo() Memo, etc. The motivation behind this change is to make Transaction more immutable. Here is an example of how to use the new transaction type:

	kp := keypair.MustParse("SBPQUZ6G4FZNWFHKUWC5BEYWF6R52E3SEP7R3GWYSM2XTKGF5LNTWW4R")
	client := horizonclient.DefaultTestNetClient
	ar := horizonclient.AccountRequest{AccountID: kp.Address()}
	sourceAccount, err := client.AccountDetail(ar)
	check(err)

	op := txnbuild.Payment{
		Destination: "GCCOBXW2XQNUSL467IEILE6MMCNRR66SSVL4YQADUNYYNUVREF3FIV2Z",
		Amount:      "10",
		Asset:       NativeAsset{},
	}

	tx, err := txnbuild.NewTransaction(
		txnbuild.TransactionParams{
			SourceAccount:        &sourceAccount,
			// If IncrementSequenceNum is true, NewTransaction() will call `sourceAccount.IncrementSequenceNumber()`
			// to obtain the sequence number for the transaction.
			// If IncrementSequenceNum is false, NewTransaction() will call `sourceAccount.GetSequenceNumber()`
			// to obtain the sequence number for the transaction.
			IncrementSequenceNum: true,
			Operations:           []Operation{&op},
			BaseFee:              MinBaseFee,
			Timebounds:           NewInfiniteTimeout(),
		},
	)
	check(err)

	tx, err = tx.Sign(network.TestNetworkPassphrase, kp.(*keypair.Full))
  • TransactionFromXDR now has the following signature TransactionFromXDR(txeB64 string) (*GenericTransaction, error). A GenericTransaction is a container which can be unpacked into either a Transaction or a FeeBumpTransaction.
  • BuildChallengeTx now returns a Transaction instance instead of the base 64 string encoding of the SEP 10 challenge transaction.
  • VerifyChallengeTx has been removed. Use VerifyChallengeTxThreshold or VerifyChallengeTxSigners instead.

Add

  • Add NewFeeBumpTransaction(params FeeBumpTransactionParams) (*FeeBumpTransaction, error) function for creating fee bump transactions. Note that fee bump transactions will only be accepted by Stellar Core once Protocol 13 is enabled.

Updates

  • AllowTrust supports CAP0018 Fine-Grained Control of Authorization by exposing a AuthorizeToMaintainLiabilities boolean field.
  • ReadChallengeTx will reject any challenge transactions which are fee bump transactions.
  • ReadChallengeTx will reject any challenge transactions which contain a MuxedAccount with a memo ID.

Remove

  • Dropped support for Go 1.12.

horizonclient

Breaking changes

  • The type for the following fields in the Transaction struct have changed from int32 to int64:
    • FeeCharged
    • MaxFee
  • The TransactionSuccess Horizon response has been removed. Instead, all submit transaction functions return with a full Horizon Transaction response on success.
  • The GetSequenceNumber() and IncrementSequenceNumber() functions on the Account struct now return int64 values instead of xdr.SequenceNumber values.

Add

  • Add IsNotFoundError
  • Add client.SubmitFeeBumpTransaction and client.SubmitFeeBumpTransactionWithOptions for submitting fee bump transactions. Note that fee bump transactions will only be accepted by Stellar Core once Protocol 13 is enabled.

Updates

  • To support CAP0018 Fine-Grained Control of Authorization:
    • There is a new effect TrustlineAuthorizedToMaintainLiabilities which occurs when a trustline has been authorized to maintain liabilities.
    • The AuthorizeToMaintainLiabilities boolean field was added to the AllowTrust operation struct.
  • These fields were added to the Transaction struct to support fee bump transactions:
    • FeeAccount (the account which paid the transaction fee)
    • FeeBumpTransaction (only present in Protocol 13 fee bump transactions)
    • InnerTransaction (only present in Protocol 13 fee bump transactions).
  • Transaction has a new MemoBytes field which is populated when MemoType is equal to text. MemoBytes stores the base 64 encoding of the memo bytes set in the transaction envelope.
  • Fixed a bug where HorizonTimeOut has misleading units of time by:
    • Removed HorizonTimeOut (seconds)
    • Added HorizonTimeout (nanoseconds)

Horizon 1.2.0

27 Apr 18:06
793ac79
Compare
Choose a tag to compare

Scheduled Breaking Changes

  • The type for the following attributes will be changed from int64 to string in 1.3.0:

The changes are required by CAP-15.

Changes

  • Added support for CAP-27 and SEP-23 #2491.
  • The XDR definition of a transaction memo is a string. However, XDR strings are actually binary blobs with no enforced encoding. It is possible to set the memo in a transaction envelope to a binary sequence which is not valid ASCII or unicode. Previously, if you wanted to recover the original binary sequence for a transaction memo, you would have to decode the transaction's envelope. In this release, we have added a memo_bytes field to the Horizon transaction response for transactions with memo_type equal text. memo_bytes stores the base 64 encoding of the memo bytes set in the transaction envelope #2485.

Horizon 1.1.0

09 Apr 04:17
2f93e52
Compare
Choose a tag to compare

IMPORTANT: Database migration

This version includes a significant database migration which changes the column types of fee_charged and max_fee in the history_transactions table from integer to bigint. This essential change paves the way for fee bump transactions (CAP 15), a major improvement that will be released soon in Stellar Protocol 13.

This migration will run for a long time, especially if you have a Horizon database with full history. For reference, it took around 8 hours and 42 minutes to complete this migration on a AWS db.r4.xlarge instance with full transaction history.

To execute the migration run horizon db migrate up using the Horizon v1.1.0 binary.

Important Note: Horizon should not be serving requests or ingesting while the migration is running. For service continuity, if you run a production Horizon deployment it is recommended that you perform the migration on a second instance and then switch over.

Changes

  • DB: Remove unnecessary duplicate indexes: index_history_transactions_on_id, index_history_ledgers_on_id, exp_asset_stats_by_code, and asset_by_code (#2419).
  • DB: Remove asset_stats table which is no longer necessary (#2419).
  • Validate transaction hash IDs as 64 lowercase hex chars. As such, wrongly-formatted parameters which used to cause 404 (Not found) errors will now cause 400 (Bad request) HTTP errors (#2394).
  • Fix ask and bid price levels of GET /order_book when encountering non-canonical price values. The limit parameter is now respected and levels are coallesced properly. Also, price_r is now in canonical form (#2400).
  • Added missing top-level HAL links to the GET / response (#2407).
  • Full transaction details are now included in the POST /transactions response. If you submit a transaction and it succeeds, the response will match the GET /transactions/{hash} response (#2406).
  • The following attributes are now included in the transaction resource:
    • fee_account (the account which paid the transaction fee)
    • fee_bump_transaction (only present in Protocol 13 fee bump transactions)
    • inner_transaction (only present in Protocol 13 fee bump transactions) (#2406).
  • Add support for CAP0018: Fine-Grained Control of Authorization (Protocol 13) (#2423).
    • Add is_authorized_to_maintain_liabilities to Balance.
      "balances": [
        {
          "is_authorized": true,
          "is_authorized_to_maintain_liabilities": true,
          "balance": "27.1374422",
          "limit": "922337203685.4775807",
          "buying_liabilities": "0.0000000",
          "selling_liabilities": "0.0000000",
          "last_modified_ledger": 28893780,
          "asset_type": "credit_alphanum4",
          "asset_code": "USD",
          "asset_issuer": "GBSTRUSD7IRX73RQZBL3RQUH6KS3O4NYFY3QCALDLZD77XMZOPWAVTUK"
        },
        {
          "balance": "1.5000000",
          "buying_liabilities": "0.0000000",
          "selling_liabilities": "0.0000000",
          "asset_type": "native"
        }
      ]
      
    • Add authorize_to_maintain_liabilities to AllowTrust operation.
      {
        "id": "124042211741474817",
        "paging_token": "124042211741474817",
        "transaction_successful": true,
        "source_account": "GBSTRUSD7IRX73RQZBL3RQUH6KS3O4NYFY3QCALDLZD77XMZOPWAVTUK",
        "type": "allow_trust",
        "type_i": 7,
        "created_at": "2020-03-27T03:40:10Z",
        "transaction_hash": "a77d4ee5346d55fb8026cdcdad6e4b5e0c440c96b4627e3727f4ccfa6d199e94",
        "asset_type": "credit_alphanum4",
        "asset_code": "USD",
        "asset_issuer": "GBSTRUSD7IRX73RQZBL3RQUH6KS3O4NYFY3QCALDLZD77XMZOPWAVTUK",
        "trustee": "GBSTRUSD7IRX73RQZBL3RQUH6KS3O4NYFY3QCALDLZD77XMZOPWAVTUK",
        "trustor": "GA332TXN6BX2DYKGYB7FW5BWV2JLQKERNX4T7EUJT4MHWOW2TSGC2SPM",
        "authorize": true,
        "authorize_to_maintain_liabilities": true,
      }
      
    • Add effect trustline_authorized_to_maintain_liabilities.
      {
        "id": "0124042211741474817-0000000001",
        "paging_token": "124042211741474817-1",
        "account": "GBSTRUSD7IRX73RQZBL3RQUH6KS3O4NYFY3QCALDLZD77XMZOPWAVTUK",
        "type": "trustline_authorized_to_maintain_liabilities",
        "type_i": 25,
        "created_at": "2020-03-27T03:40:10Z",
        "trustor": "GA332TXN6BX2DYKGYB7FW5BWV2JLQKERNX4T7EUJT4MHWOW2TSGC2SPM",
        "asset_type": "credit_alphanum4",
        "asset_code": "USD"
      }    
      
  • It is no longer possible to use Redis as a mechanism for rate-limiting requests (#2409).

horizonclient v2.2.0

26 Mar 18:09
4864939
Compare
Choose a tag to compare

Added

  • Add client.SubmitTransactionWithOptions with support for SEP0029.
    If any of the operations included in client.SubmitTransactionWithOptions is of type
    payment, pathPaymentStrictReceive, pathPaymentStrictSend, or
    mergeAccount, then the SDK will load the destination account from Horizon and check if
    config.memo_required is set to 1 as defined in SEP0029.

    For performance reasons, you may choose to skip the check by setting the SkipMemoRequiredCheck to true:

     	client.SubmitTransactionWithOptions(tx, horizonclient.SubmitTxOpts{SkipMemoRequiredCheck: true})
    

    Additionally, the check will be skipped automatically if the transaction includes a memo.

Changed

  • Change client.SubmitTransaction to always check if memo is required.
    If you want to skip the check, call client.SubmitTransactionWithOptions instead.

Horizon v1.0.1

16 Mar 21:26
2c2d8fb
Compare
Choose a tag to compare

Fixed

  • Fix horizon db reap bug which caused the command to exit without deleting any history table rows (#2336).
  • The horizon reap system now also deletes rows from history_trades. Previously, the reap system only deleted rows from history_operation_participants, history_operations, history_transaction_participants, history_transactions, history_ledgers, and history_effects (#2336).
  • Fix deadlock when running horizon db reingest range (#2373).
  • Fix signer update effects (#2375).
  • Fix incorrect error in log when shutting down the system while verifyState is running (#2366).
  • Expose date header to CORS clients (#2316).
  • Fix inconsistent ledger view in /accounts/{id} when streaming (#2344).

Removed

  • Dropped support for Go 1.12. (#2346).

horizonclient v2.1.0

24 Feb 15:45
4e70d6a
Compare
Choose a tag to compare

Add

  • Add client.StrictReceivePaths and client.StrictSendPaths (#2237).

client.StrictReceivePaths:

	client := horizonclient.DefaultPublicNetClient
	// Find paths for XLM->NGN
	pr := horizonclient.PathsRequest{
		DestinationAccount:     "GCLWGQPMKXQSPF776IU33AH4PZNOOWNAWGGKVTBQMIC5IMKUNP3E6NVU",
		DestinationAmount:      "100",
		DestinationAssetCode:   "NGN",
		DestinationAssetIssuer: "GDZST3XVCDTUJ76ZAV2HA72KYQODXXZ5PTMAPZGDHZ6CS7RO7MGG3DBM",
		DestinationAssetType:   horizonclient.AssetType4,
		SourceAccount:          "GDZST3XVCDTUJ76ZAV2HA72KYQODXXZ5PTMAPZGDHZ6CS7RO7MGG3DBM",
	}
	paths, err := client.StrictReceivePaths(pr)
	if err != nil {
		fmt.Println(err)
		return
	}
	fmt.Print(paths)

client.StrictSendPaths:

	client := horizonclient.DefaultPublicNetClient
	// Find paths for USD->EUR
	pr := horizonclient.StrictSendPathsRequest{
		SourceAmount:      "20",
		SourceAssetCode:   "USD",
		SourceAssetIssuer: "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX",
		SourceAssetType:   horizonclient.AssetType4,
		DestinationAssets: "EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S",
	}
	paths, err := client.StrictSendPaths(pr)
  • Add client.OfferDetails (#2303).
	client := horizonclient.DefaultPublicNetClient
	offer, err := client.OfferDetails("2")
	if err != nil {
		fmt.Println(err)
		return
	}	
	fmt.Print(offer)
  • Add support to client.Offers for the filters: Seller, Selling and Buying (#2230).
	offerRequest = horizonclient.OfferRequest{
		Seller:  "GCLWGQPMKXQSPF776IU33AH4PZNOOWNAWGGKVTBQMIC5IMKUNP3E6NVU",
		Selling: "COP:GCLWGQPMKXQSPF776IU33AH4PZNOOWNAWGGKVTBQMIC5IMKUNP3E6NVU",
		Buying:  "EUR:GCLWGQPMKXQSPF776IU33AH4PZNOOWNAWGGKVTBQMIC5IMKUNP3E6NVU",
		Order:   horizonclient.OrderDesc,
	}	
	offers, err = client.Offers(offerRequest)
	if err != nil {
		fmt.Println(err)
		return
	}
	fmt.Print(offers)
  • Add client.Accounts (#2229).

This feature allows account retrieval filtering by signer or by a trustline to an asset.

	client := horizonclient.DefaultPublicNetClient
	accountID := "GCLWGQPMKXQSPF776IU33AH4PZNOOWNAWGGKVTBQMIC5IMKUNP3E6NVU"
	accountsRequest := horizonclient.AccountsRequest{Signer: accountID}	
	account, err := client.Accounts(accountsRequest)
	if err != nil {
		fmt.Println(err)
		return
	}	
	fmt.Print(account)
  • Add IsNotFoundError (#2197).

Deprecate

  • Make hProtocol.FeeStats backwards compatible with Horizon 0.24.1 and 1.0 deprecating usage of *_accepted_fee (#2290).

All the _accepted_fee fields were removed in Horizon 1.0, however we extended this version of the SDK to backfill the FeeStat struct using data from MaxFee. This is a temporary workaround and it will be removed in horizonclient 3.0. Please start using data from FeeStat.MaxFee instead.