Add a config option and arg to set gas price for auto fees calculation #81

Merged
nabarun merged 9 commits from deep-stack/laconic-registry-cli:pm-support-auto-gas into main 2024-09-06 09:44:48 +00:00
Member

Part of Create a public laconicd testnet
Requires cerc-io/registry-sdk#22

Behaviour in different configuration scenarios:

  • Gas set, fees set to Xalnt:

    # Example
    gas: 500000
    fees: 500000alnt
    gasPrice:
    
    • gasPrice config ignored
    • tx rejected if given fees < gas * min-gas-price set by the node
    • tx fails mid-execution if it runs out of given gas
  • Fees not set, gas price set to Xalnt:

    # Example
    gas:
    fees:
    gasPrice: 1alnt
    
    • gas config ignored
    • uses auto fee calculation using gas estimation with default multiplier (2) value from registry-sdk
    • tx rejected if given gasPrice < min-gas-price set by the node
    • tx fails mid-execution if it runs out of calculated gas
  • Fees set to a X (without alnt suffix), gas price set to Yalnt:

    # Example
    gas:
    fees: 1.8
    gasPrice: 1alnt
    
    • gas config ignored
    • uses auto fee calculation using gas estimation with fees as the multiplier
    • tx rejected if given gasPrice < min-gas-price set by the node
    • tx fails mid-execution if it runs out of calculated gas, can be retried with a higher gas estimation multiplier (fees)
  • Fees and gas price both not set:

    # Example
    gas:
    fees:
    gasPrice:
    
    • gas config ignored
    • uses auto fee calculation using gas estimation
    • throws error:
      Gas price must be set in the client options when auto gas is used.
      

The provided config can be overridden with CLI args if required.

Part of [Create a public laconicd testnet](https://www.notion.so/Create-a-public-laconicd-testnet-896a11bdd8094eff8f1b49c0be0ca3b8) Requires https://git.vdb.to/cerc-io/registry-sdk/pulls/22 Behaviour in different configuration scenarios: - Gas set, fees set to `Xalnt`: ```bash # Example gas: 500000 fees: 500000alnt gasPrice: ``` - `gasPrice` config ignored - tx rejected if given `fees` < `gas` * `min-gas-price` set by the node - tx fails mid-execution if it runs out of given `gas` - Fees not set, gas price set to `Xalnt`: ```bash # Example gas: fees: gasPrice: 1alnt ``` - `gas` config ignored - uses `auto` fee calculation using gas estimation with [default multiplier](https://git.vdb.to/cerc-io/registry-sdk/src/branch/main/src/constants.ts) (`2`) value from `registry-sdk` - tx rejected if given `gasPrice` < `min-gas-price` set by the node - tx fails mid-execution if it runs out of calculated gas - Fees set to a `X` (without `alnt` suffix), gas price set to `Yalnt`: ```bash # Example gas: fees: 1.8 gasPrice: 1alnt ``` - `gas` config ignored - uses `auto` fee calculation using gas estimation with `fees` as the multiplier - tx rejected if given `gasPrice` < `min-gas-price` set by the node - tx fails mid-execution if it runs out of calculated gas, can be retried with a higher gas estimation multiplier (`fees`) - Fees and gas price both not set: ```bash # Example gas: fees: gasPrice: ``` - `gas` config ignored - uses `auto` fee calculation using gas estimation - throws error: ```bash Gas price must be set in the client options when auto gas is used. ``` The provided config can be overridden with CLI args if required.
prathamesh added 2 commits 2024-08-26 12:15:32 +00:00
Update all CLI commands
Some checks failed
Lint / lint (18.x) (pull_request) Successful in 1m8s
Tests / cli_tests (18.x) (pull_request) Failing after 1m11s
f99f222162
prathamesh changed title from [WIP] Add a config option and arg to set gas price for auto gas estimation to [WIP] Add a config option and arg to set gas price for auto fees calculation 2024-08-27 11:00:30 +00:00
prathamesh changed title from [WIP] Add a config option and arg to set gas price for auto fees calculation to [WIP] Add a config option and arg to set gas price for `auto` fees calculation 2024-08-27 11:02:10 +00:00
prathamesh added 1 commit 2024-08-27 11:15:32 +00:00
Add explanation for with examples for gas and fees config
Some checks failed
Lint / lint (18.x) (pull_request) Successful in 1m12s
Tests / cli_tests (18.x) (pull_request) Failing after 1m12s
426515a9a1
prathamesh added 1 commit 2024-08-27 11:46:11 +00:00
Add short help alias
Some checks failed
Tests / cli_tests (18.x) (pull_request) Failing after 1m14s
Lint / lint (18.x) (pull_request) Successful in 1m14s
705bf0257a
prathamesh added 1 commit 2024-08-27 12:32:19 +00:00
Update bond list CLI for owner filter
Some checks failed
Lint / lint (18.x) (pull_request) Successful in 1m12s
Tests / cli_tests (18.x) (pull_request) Failing after 1m13s
743f5ebc3c
prathamesh added 1 commit 2024-08-30 09:24:40 +00:00
Add tests for gas and fees config combinations
Some checks failed
Lint / lint (18.x) (pull_request) Successful in 1m18s
Tests / cli_tests (18.x) (pull_request) Failing after 1m18s
d441c04443
prathamesh added 1 commit 2024-09-05 06:13:55 +00:00
Update fees parsing
Some checks failed
Lint / lint (18.x) (pull_request) Successful in 1m13s
Tests / cli_tests (18.x) (pull_request) Failing after 1m14s
8d49de05f2
ishavenikar added 1 commit 2024-09-05 11:59:16 +00:00
Update readme instructions
Some checks failed
Lint / lint (18.x) (pull_request) Has been cancelled
Tests / cli_tests (18.x) (pull_request) Has been cancelled
2775bf7bb0
prathamesh force-pushed pm-support-auto-gas from 2775bf7bb0 to 60b29e047d 2024-09-06 08:37:29 +00:00 Compare
prathamesh added 1 commit 2024-09-06 09:11:51 +00:00
Increment package version
All checks were successful
Lint / lint (18.x) (pull_request) Successful in 1m12s
Tests / cli_tests (18.x) (pull_request) Successful in 9m16s
b50c59c99f
prathamesh changed title from [WIP] Add a config option and arg to set gas price for `auto` fees calculation to Add a config option and arg to set gas price for `auto` fees calculation 2024-09-06 09:20:42 +00:00
nabarun merged commit 86259b35a6 into main 2024-09-06 09:44:48 +00:00
nabarun deleted branch pm-support-auto-gas 2024-09-06 09:44:49 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cerc-io/laconic-registry-cli#81
No description provided.