internal/ethapi: disable sending of non eip155 replay protected tx#22339
internal/ethapi: disable sending of non eip155 replay protected tx#22339holiman merged 9 commits intoethereum:masterfrom
Conversation
|
Do we want to add a flag to disable this protection? |
I suggest |
holiman
left a comment
There was a problem hiding this comment.
$ geth --dev --rpc.allow-unprotected-txs console 2>&1 | tail -n2
flag provided but not defined: -rpc.allow-unprotected-txs
You forgot to add it to the enabled flags, I think
| cfg.HTTPPathPrefix = ctx.GlobalString(HTTPPathPrefixFlag.Name) | ||
| } | ||
|
|
||
| if ctx.GlobalIsSet(AllowUnprotectedTxs.Name) { |
There was a problem hiding this comment.
There is no reason to check if it's set or not. That's only needed if the default has some special meaning. We only care about the actual value of the flag, so pls just use cfg.UnprotectedAllowed = ctx.GlobalBool(AllowUnprotectedTxs.Name)
There was a problem hiding this comment.
Yes there is, when we simply override it here, then we will always overwrite the value we read out of the config.
See martins comments below
|
@holiman Duh, I enabled it now and tested it |
|
Almost, but not quite :) And Stored to config? Yes. However: |
| } | ||
|
|
||
| cfg.UnprotectedAllowed = ctx.GlobalBool(AllowUnprotectedTxs.Name) | ||
| if ctx.GlobalIsSet(HTTPPathPrefixFlag.Name) { |
There was a problem hiding this comment.
Why is this tied to the http flag?
|
|
||
| eth.APIBackend = &EthAPIBackend{stack.Config().ExtRPCEnabled(), stack.Config().UnprotectedAllowed, eth, nil} | ||
| eth.APIBackend = &EthAPIBackend{stack.Config().ExtRPCEnabled(), stack.Config().AllowUnprotectedTxs, eth, nil} | ||
| log.Info("Unprotected TXs allowed", "value", eth.APIBackend.allowUnprotectedTxs) |
There was a problem hiding this comment.
please type it out, transactions :P
|
Oh, that log line, I just usee it for testing, didn't mean it had to be incorporated.... But actually it might be good to have somewhere
|
|
when I send tx,I still got error:"Cannot submit unprotected transaction". |
|
Don't use non-eip155 replay protected transactions. They are unsafe as they can be replayed on a different chain. |
|
but seng tx as I usually do,usually I successsend tx.
This time just to metis mannet.what should I do ?
mars
***@***.***
…------------------ 原始邮件 ------------------
发件人: "ethereum/go-ethereum" ***@***.***>;
发送时间: 2022年5月27日(星期五) 凌晨0:39
***@***.***>;
***@***.******@***.***>;
主题: Re: [ethereum/go-ethereum] internal/ethapi: disable sending of non eip155 replay protected tx (#22339)
Don't use non-eip155 replay protected transactions. They are unsafe as they can be replayed on a different chain.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
…hereum#22339 (#971) * internal/ethapi: disable sending of non eip155 replay protected tx ethereum#22339 * eth: optimize the initialization logic of EthAPIBackend * fix
This PR prevents users from submitting transactions without EIP-155 enabled.
Replay protection is important so we should gently force our users to use it.
It changes the JSON-RPC API quite significantly, so if you see the "only replay-protected (EIP-155) transactions allowed over RPC" error, you know that you need to update your signer.
To test: