-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider non-zero default nonce #248
Comments
Yeah sounds good. We can include it in 1.3.0. |
and once paritytech/polkadot-sdk#1557 is merged and release I suppose? |
We can do it without that actually. |
Ah so you are suggesting a newtype for nonce with custom |
This will confuse block explorer and indexer |
Why? I think the problem is bigger for wallets. |
Needed for: polkadot-fellows/runtimes#248 This PR introduces a new type `TypeWithDefault<T, D: Get<T>>` to be able to provide a custom default for any type. This can, then, be used to provide the nonce type that returns the current block number as the default, to avoid replay of immortal transactions. --------- Co-authored-by: Oliver Tale-Yazdi <[email protected]>
Needed for: polkadot-fellows/runtimes#248 This PR introduces a new type `TypeWithDefault<T, D: Get<T>>` to be able to provide a custom default for any type. This can, then, be used to provide the nonce type that returns the current block number as the default, to avoid replay of immortal transactions. --------- Co-authored-by: Oliver Tale-Yazdi <[email protected]>
@ggwpez do you still want to tackle this? |
Needed for: polkadot-fellows/runtimes#248 This PR introduces a new type `TypeWithDefault<T, D: Get<T>>` to be able to provide a custom default for any type. This can, then, be used to provide the nonce type that returns the current block number as the default, to avoid replay of immortal transactions. --------- Co-authored-by: Oliver Tale-Yazdi <[email protected]>
If it is a problem at all. Having this functionality will become more important when adding Ethereum compatibility: Eth transactions are immortal. |
We should do this. the Type added in https://github.com/paritytech/polkadot-sdk/pull/4034/files#r1829220430 has an issue that it derives the default |
What? We are going to inherit the ETH transaction format? Why? Please don't say "metamask". |
In order to support Ethereum wallets you need to accept their transactions. This what they sign. Of course we can build our own transaction format but that won't make existing Dapps compatible. See, I didn't even say the M word. |
But I thought for this snaps exists? So you can extend the big M? So, we will only support their tx? But will not have a ETH compatible state root etc or? |
Requirement is that it works without having the user to install anything. Also, it would be another thing to maintain. We might as well just support it as-is. Both frontier and Acala are doing that, too. We try to be as compatible as possible.
No. You can still call Theoretically, we could require a custom transaction format and have that signed by Metamask using
Yeah seems to be working for frontier and Acala. We just return our state root when somebody requests a block. Dapps just seem to be using this as identifiers if at all. https://docs.metamask.io/wallet/reference/json-rpc-methods/eth_getblockbyhash/ Its not like there are any EVM light clients in production that would try to use them to verify a proof. |
Proposed this ticket to @re-gius. My suggestion to him, as noted above, is to not use the |
See polkadot-fellows/runtimes#248 : using `TypeWithDefault` having derived `TypeInfo` for `Nonce` causes a breaking change in metadata for nonce type because it's no longer `u64`. Adding a default implementation of `TypeInfo` for `TypeWithDefault` to restore the original type info in metadata. --------- Co-authored-by: Kian Paimani <[email protected]>
paritytech/polkadot-sdk#6562 should have fixed the Type Info. Now we need to wait for the next release, and then update the fellowship repo. |
New or resurrected accounts use
Nonce::default()
that returns0
in the Polkadot runtime.We could change this to return the current block number, to avoid replay of immortal transactions.
Any downsides? Yea, its slower but nothing else i think.
The text was updated successfully, but these errors were encountered: