metamask-extension icon indicating copy to clipboard operation
metamask-extension copied to clipboard

Fixed eth_getTransactionCount pending to return hex

Open shanejonas opened this issue 2 years ago • 11 comments

Explanation

eth_getTransactionCount had an issue where only for "pending" it was returning our internal nonce which is fine, but it was returning it as a number not as hex as described in the spec

Fixes #5845

shanejonas avatar Jun 01 '22 18:06 shanejonas

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

github-actions[bot] avatar Jun 01 '22 19:06 github-actions[bot]

Builds ready [dc110cf]
Page Load Metrics (2109 ± 104 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint842071283316
domContentLoaded170925452060240115
load179825452109217104
domInteractive170925452060240115

metamaskbot avatar Jun 01 '22 20:06 metamaskbot

An annoying question: might existing dapps rely on it being a number?

danjm avatar Jun 02 '22 15:06 danjm

@danjm it only returns a number for "pending", not for "latest". which is odd behaviour. technically this would break dapps but im sure dapps are broken today because of it returning a number in certain cases.

shanejonas avatar Jun 02 '22 18:06 shanejonas

this is an example of https://www.hyrumslaw.com/

With a sufficient number of users of an API, it does not matter what you promise in the contract: all observable behaviors of your system will be depended on by somebody.

shanejonas avatar Jun 02 '22 18:06 shanejonas

@shanejonas Yes, that makes sense. Perhaps we should give some sort of deprecation warning though? Even just two weeks or something like that.

danjm avatar Jun 07 '22 09:06 danjm

@danjm can we use the "Whats new?" feature for this?

shanejonas avatar Jun 07 '22 12:06 shanejonas

We like can't use the What's New feature because that wouldn't go out ahead of time.

darkwing avatar Jun 08 '22 16:06 darkwing

I think we could add a page on docs.metamask.io that shows API changes for versions of MetaMask, similar to this page: https://docs.metamask.io/guide/provider-migration.html

shanejonas avatar Jul 12 '22 14:07 shanejonas

That makes sense @shanejonas

I think we just need to establish a standard communication process for when we make changes that could break dapps. We probably should start an active e-mail list and make it known that it should be monitored if you want to stay on top of breaking changes.

So in addition to adding notices to the page you linked, we should have some way of pushing updates to that page out to developers

danjm avatar Jul 19 '22 23:07 danjm

@danjm @shanejonas did the notice ever go out and can we move forward with this PR?

brad-decker avatar Sep 20 '22 15:09 brad-decker

Converted to draft until proper resources can be dedicated to dapp outreach and review.

brad-decker avatar Nov 16 '22 18:11 brad-decker