Skip to content

Commit

Permalink
feat: tweak default expiration time for tx-pool
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangsoledad committed Mar 22, 2023
1 parent e78a6ec commit 3061dcf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions rpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4986,6 +4986,10 @@ For example, a cellbase transaction is not allowed in `send_transaction` RPC.

(-1109): The transaction is expired from tx-pool after `expiry_hours`.

### Error `PoolRejectedTransactionBySizeLimit`

(-1110): The transaction exceeded maximum size limit.

### Error `Indexer`

(-1200): The indexer error.
Expand Down Expand Up @@ -6329,14 +6333,15 @@ TX reject message

`PoolTransactionReject` is a JSON object with following fields.

* `type`: `"LowFeeRate" | "ExceededMaximumAncestorsCount" | "Full" | "Duplicated" | "Malformed" | "DeclaredWrongCycles" | "Resolve" | "Verification" | "Expiry"` - Reject type.
* `type`: `"LowFeeRate" | "ExceededMaximumAncestorsCount" | "ExceededTransactionSizeLimit" | "Full" | "Duplicated" | "Malformed" | "DeclaredWrongCycles" | "Resolve" | "Verification" | "Expiry"` - Reject type.
* `description`: `string` - Detailed description about why the transaction is rejected.

Different reject types:

* `LowFeeRate`: Transaction fee lower than config
* `ExceededMaximumAncestorsCount`: Transaction exceeded maximum ancestors count limit
* `Full`: Transaction pool exceeded maximum size or cycles limit,
* `ExceededTransactionSizeLimit`: Transaction exceeded maximum size limit
* `Full`: Transaction are replaced because the pool is full
* `Duplicated`: Transaction already exist in transaction_pool
* `Malformed`: Malformed transaction
* `DeclaredWrongCycles`: Declared wrong cycles
Expand Down
2 changes: 1 addition & 1 deletion util/app-config/src/legacy/tx_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const DEFAULT_MAX_TX_VERIFY_CYCLES: Cycle = TWO_IN_TWO_OUT_CYCLES * 20;
// default max ancestors count
const DEFAULT_MAX_ANCESTORS_COUNT: usize = 125;
// Default expiration time for pool transactions in hours
const DEFAULT_EXPIRY_HOURS: u8 = 24;
const DEFAULT_EXPIRY_HOURS: u8 = 12;
// Default max_tx_pool_size 180mb
const DEFAULT_MAX_TX_POOL_SIZE: usize = 180_000_000;

Expand Down

0 comments on commit 3061dcf

Please sign in to comment.