Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Better error message for rpc gas price errors #10931

Merged
merged 5 commits into from
Aug 15, 2019
Merged

Better error message for rpc gas price errors #10931

merged 5 commits into from
Aug 15, 2019

Conversation

seunlanlege
Copy link
Member

Previously if you were trying to replace a transaction in the transaction pool, (i.e same nonce) but you don't supply a higher gas price; you get this error telling you that your "transaction's gas price does satisfy node's minimal gas price"

Transaction gas price is too low. It does not satisfy your node's minimal gas price (minimal: 0, got: 5000000000). Try increasing the gas price.

This error message has been changed to:

Transaction gas price 38856828wei is too low. There is another transaction with the same nonce in the queue with a gas price: 5000000000wei. Try increasing the gas price or incrementing the nonce.

closes #10348

@seunlanlege seunlanlege added the M6-rpcapi 📣 RPC API. label Aug 1, 2019
@parity-cla-bot
Copy link

It looks like @seunlanlege signed our Contributor License Agreement. 👍

Many thanks,

Parity Technologies CLA Bot

rpc/src/v1/helpers/errors.rs Outdated Show resolved Hide resolved
@ordian ordian added this to the 2.7 milestone Aug 1, 2019
@ordian ordian added B0-patch-stable 🕷 Pull request should also be back-ported to the stable branch. B1-patch-beta 🕷🕷 labels Aug 1, 2019
rpc/src/v1/helpers/errors.rs Outdated Show resolved Hide resolved
@ordian ordian added the A6-mustntgrumble 💦 Pull request has areas for improvement. The author need not address them before merging. label Aug 1, 2019
@codecov-io
Copy link

codecov-io commented Aug 1, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@ef47426). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #10931   +/-   ##
=========================================
  Coverage          ?     5.2%           
=========================================
  Files             ?      659           
  Lines             ?    94849           
  Branches          ?    19472           
=========================================
  Hits              ?     4936           
  Misses            ?    87884           
  Partials          ?     2029

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ef47426...50cb305. Read the comment docs.

Copy link
Collaborator

@dvdplm dvdplm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but we need better docs (or unification of the errors as andronik suggests).

@@ -42,6 +42,14 @@ pub enum Error {
/// Transaction gas price
got: U256,
},
/// Transaction has too low fee
/// (there is already a transaction with the same sender-nonce but higher gas price)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to document this better: what is the difference between TooCheapToReplace and TxTooCheapToReplace – it is not clear to when we return the one or the other.

@dvdplm
Copy link
Collaborator

dvdplm commented Aug 8, 2019

test failures seem legit

miner/src/pool/tests/mod.rs Outdated Show resolved Hide resolved
rpc/src/v1/helpers/errors.rs Outdated Show resolved Hide resolved
@ordian ordian added A8-looksgood 🦄 Pull request is reviewed well. and removed A6-mustntgrumble 💦 Pull request has areas for improvement. The author need not address them before merging. labels Aug 8, 2019
* master:
  [evmbin] fix compilation (#10976)
  Update to latest trie version. (#10972)
  [blooms-db] Fix benchmarks (#10974)
  Fix ethcore/benches build. (#10964)
  tx-pool: accept local tx with higher gas price when pool full (#10901)
  Disable unsyncable expanse chain (#10926)
  Extract Machine from ethcore (#10949)
  removed redundant state_root function from spec, improve spec error types (#10955)
  Add support for Energy Web Foundation's new chains (#10957)
  [evmbin] add more tests to main.rs (#10956)
  Fix compiler warnings in util/io and upgrade to edition 2018 Upgrade mio to latest (#10953)
  unify loading spec && further spec cleanups (#10948)
  refactor: Refactor evmbin CLI (#10742)
  journaldb changes (#10929)
  Allow default block parameter to be blockHash (#10932)
  Enable sealing when engine is ready (#10938)
  Fix some warnings and typos. (#10941)
  Updated [email protected] key (#10939)
  Change the return type of step_inner function. (#10940)
@ordian ordian merged commit 1ba4df0 into master Aug 15, 2019
@ordian ordian deleted the rpc-txpool-error branch August 15, 2019 14:48
dvdplm added a commit that referenced this pull request Aug 15, 2019
* master:
  Extract the Engine trait (#10958)
  Better error message for rpc gas price errors (#10931)
  [.gitlab.yml] cargo check ethcore benches (#10965)
  Verify transaction against its block during import (#10954)
  [evmbin] fix compilation (#10976)
  Update to latest trie version. (#10972)
  [blooms-db] Fix benchmarks (#10974)
  Fix ethcore/benches build. (#10964)
  tx-pool: accept local tx with higher gas price when pool full (#10901)
  Disable unsyncable expanse chain (#10926)
s3krit pushed a commit that referenced this pull request Sep 11, 2019
* Better error message for rpc gas price errors

* correct tests

* dedupe error variants

* fixed tests, removed spacing
s3krit pushed a commit that referenced this pull request Sep 11, 2019
* Better error message for rpc gas price errors

* correct tests

* dedupe error variants

* fixed tests, removed spacing
This was referenced Sep 12, 2019
s3krit added a commit that referenced this pull request Sep 12, 2019
* add more tx tests (#11038)
* Fix parallel transactions race-condition (#10995)
* Add blake2_f precompile (#11017)
* [trace] introduce trace failed to Ext (#11019)
* Edit publish-onchain.sh to use https (#11016)
* Fix deadlock in network-devp2p (#11013)
* EIP 1108: Reduce alt_bn128 precompile gas costs (#11008)
* xDai chain support and nodes list update (#10989)
* EIP 2028: transaction gas lowered from 68 to 16 (#10987)
* EIP-1344 Add CHAINID op-code (#10983)
* manual publish jobs for releases, no changes for nightlies (#10977)
* [blooms-db] Fix benchmarks (#10974)
* Verify transaction against its block during import (#10954)
* Better error message for rpc gas price errors (#10931)
* Fix fork choice (#10837)
* Fix compilation on recent nightlies (#10991)
s3krit added a commit that referenced this pull request Sep 12, 2019
* add more tx tests (#11038)
* Fix parallel transactions race-condition (#10995)
* Add blake2_f precompile (#11017)
* [trace] introduce trace failed to Ext (#11019)
* Edit publish-onchain.sh to use https (#11016)
* Fix deadlock in network-devp2p (#11013)
* EIP 1108: Reduce alt_bn128 precompile gas costs (#11008)
* xDai chain support and nodes list update (#10989)
* EIP 2028: transaction gas lowered from 68 to 16 (#10987)
* EIP-1344 Add CHAINID op-code (#10983)
* manual publish jobs for releases, no changes for nightlies (#10977)
* [blooms-db] Fix benchmarks (#10974)
* Verify transaction against its block during import (#10954)
* Better error message for rpc gas price errors (#10931)
* tx-pool: accept local tx with higher gas price when pool full (#10901)
* Fix fork choice (#10837)
* Cleanup unused vm dependencies (#10787)
* Fix compilation on recent nightlies (#10991)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. B0-patch-stable 🕷 Pull request should also be back-ported to the stable branch. M6-rpcapi 📣 RPC API.
Projects
None yet
5 participants