Skip to content

Commit 7368210

Browse files
Added Bump Sequence documentation
1 parent 4a13c3b commit 7368210

File tree

3 files changed

+38
-8
lines changed

3 files changed

+38
-8
lines changed

guides/concepts/list-of-operations.md

+25-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ For the protocol specification, see [stellar-transactions.x](https://github.com/
1717
- [Account Merge](#account-merge)
1818
- [Inflation](#inflation)
1919
- [Manage Data](#manage-data)
20-
20+
- [Bump Sequence](#bump-sequence)
2121

2222
## Create Account
2323
[JavaScript](http://stellar.github.io/js-stellar-sdk/Operation.html#.createAccount) | [Java](http://stellar.github.io/java-stellar-sdk/org/stellar/sdk/CreateAccountOperation.Builder.html) | [Go](https://godoc.org/github.com/stellar/go/build#CreateAccountBuilder)
@@ -313,6 +313,7 @@ Possible errors:
313313
|ACCOUNT_MERGE_NO_ACCOUNT| -2| The `destination` account does not exist.|
314314
|ACCOUNT_MERGE_IMMUTABLE_SET| -3| The source account has `AUTH_IMMUTABLE` flag set.|
315315
|ACCOUNT_MERGE_HAS_SUB_ENTRIES | -4| The source account has trust lines/offers.|
316+
|ACCOUNT_MERGE_SEQNUM_TOO_FAR | -5| Source's account sequence number is too high. It must be less than `(ledgerSeq << 32) = (ledgerSeq * 0x100000000)`. *(protocol version 10 and above)*|
316317

317318
## Inflation
318319
[JavaScript](http://stellar.github.io/js-stellar-sdk/Operation.html#.inflation) | [Java](http://stellar.github.io/java-stellar-sdk/org/stellar/sdk/InflationOperation.html) | [Go](https://godoc.org/github.com/stellar/go/build#InflationBuilder)
@@ -355,3 +356,26 @@ Possible errors:
355356
|MANAGE_DATA_LOW_RESERVE| -3| Not enough lumens in the account to create a new Data Entry. Each additional Data Entry increases the minimum balance of the Account.|
356357
|MANAGE_DATA_INVALID_NAME| -4| Name not a valid string.|
357358

359+
## Bump Sequence
360+
[JavaScript](http://stellar.github.io/js-stellar-sdk/Operation.html#.bumpSequence) | [Java](http://stellar.github.io/java-stellar-sdk/org/stellar/sdk/BumpSequenceOperation.Builder.html) | [Go](https://godoc.org/github.com/stellar/go/build#BumpSequenceBuilder)
361+
362+
*Only available in protocol version 10 and above*
363+
364+
Bump sequence allows to bump forward the sequence number of the source account of the operation, allowing to invalidate any transactions with a smaller sequence number.
365+
366+
If the specified `bumpTo` sequence number is greater than the source account's sequence number,
367+
the account's sequence number is updated with that value, otherwise it's not modified.
368+
369+
Threshold: Low
370+
371+
Result: `BumpSequenceResult`
372+
373+
|Parameters| Type| Description|
374+
| --- | --- | --- |
375+
|bumpTo| SequenceNumber| desired value for the operation's source account sequence number.|
376+
377+
Possible errors:
378+
379+
| Error | Code | Description |
380+
| ----- | ---- | ------|
381+
|BUMP_SEQUENCE_BAD_SEQ| -1| The specified `bumpTo` sequence number is not a valid sequence number. It must be between 0 and `INT64_MAX` (9223372036854775807 or 0x7fffffffffffffff).|

guides/concepts/multi-sig.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@ Once the signature threshold is met if there are any leftover signatures then th
2525
Each account can set its own threshold values. By default all thresholds levels are set to 0, and the master key is set to weight 1. The [Set Options](./list-of-operations.md#set-options) operation allows you to change the weight of the master key and to add other signing keys with different weights.
2626

2727
Low Security:
28-
* [Transaction processing](./transactions.md)
28+
* [Transaction processing](./transactions.md)
2929
* Charging a fee or updating the sequence number for the source account
30-
* [Allow Trust](./list-of-operations.md#allow-trust) operation
31-
* Used to allow people to hold credit from this account without exposing the key that enables sending payments from this account.
30+
* [Allow Trust](./list-of-operations.md#allow-trust) operation
31+
* Used to allow people to hold credit from this account without exposing the key that enables sending payments from this account.
32+
* [Bump Sequence](./list-of-operations.md#bump-sequence)
33+
* Modify the account's sequence number directly
3234

3335
Medium Security:
3436
* All [other operations](./list-of-operations.md)

guides/concepts/operations.md

+8-4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Here are the possible operation types:
1717
- [Account Merge](./list-of-operations.md#account-merge)
1818
- [Inflation](./list-of-operations.md#inflation)
1919
- [Manage Data](./list-of-operations.md#manage-data)
20+
- [Bump Sequence](./list-of-operations.md#bump-sequence)
2021

2122
Operations are executed on behalf of the source account specified in the
2223
transaction, unless there is an override defined for the operation.
@@ -28,13 +29,16 @@ Thresholds define the level of privilege an operation needs in order to succeed.
2829

2930
* Low Security:
3031
* AllowTrustTx
31-
* Used to allow other signers to allow people to hold credit from this
32-
account but not issue credit.
32+
* Used to allow other signers to allow people to hold credit from this account but not issue credit.
33+
* BumpSequence
3334
* Medium Security:
3435
* All else
3536
* High Security:
37+
* AccountMerge
38+
* merge an account into another one
3639
* SetOptions for Signer and threshold
37-
* Used to change the Set of signers and the thresholds.
40+
* Used to change the Set of signers and the thresholds.
41+
3842

3943
## Validity of an operation
4044

@@ -44,7 +48,7 @@ The validity check only looks at the state of the source account. It ensures tha
4448
1) the outer transaction has enough signatures for the source account of the operation to meet the threshold for that operation.
4549
2) Operations-specific validity checks pass. These checks are ones that would stay true regardless of the ledger state—for example, are the parameters within the expected bounds? Checks that depend on ledger state don't happen until apply time—for example, a send operation won't check if you have enough balance to send until apply time.
4650

47-
Once a transaction passes this first validity check, it is propagated to the network and eventually included in a transaction set. As part of a transaction set, the transaction is applied to the ledger. At that point a fee is taken from the source account. Operations are attempted in the order they occur in the transaction. If any operation fails, the whole transaction fails and the effects of previous operations are rolled back.
51+
Once a transaction passes this first validity check, it is propagated to the network and eventually included in a transaction set. As part of a transaction set, the transaction is applied to the ledger. At that point a fee is taken from the source account regardless of success/failure. Later, the transaction is processed: sequence number and signatures are verified before operations are attempted in the order they occur in the transaction. If any operation fails, the whole transaction fails and the effects of previous operations are rolled back.
4852

4953

5054
## Result

0 commit comments

Comments
 (0)