-
Notifications
You must be signed in to change notification settings - Fork 20.2k
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
cmd/evm: implement input txs via rlp in t8n tool #23138
Conversation
I do send now tx as RLP to geth. works fine on this branch. |
@fjl can I haz a review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Name: "input.txs", | ||
Usage: "`stdin` or file name of where to find the transactions to apply.", | ||
Name: "input.txs", | ||
Usage: "`stdin` or file name of where to find the transactions to apply. " + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can add a comment that RLP list over stdin is not supported
echo signed_txs.rlp | ./evm t8n --state.fork=London --input.alloc=./testdata/13/alloc.json --input.txs=stdin --input.env=./testdata/13/env.json --output.result=alloc_rlptx.json
ERROR(10): failed unmarshaling stdin: invalid character 's' looking for beginning of value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heh. Try cat
instead of echo
:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm doofus, but the general point still stands. We can't read RLP from stdin, because L147 tries to decode into an input object
cat signed_txs.rlp | ./evm t8n --state.fork=London --input.alloc=./testdata/13/alloc.json --input.txs=stdin --input.env=./testdata/13/env.json --output.result=alloc_rlptx.json
ERROR(10): failed unmarshaling stdin: json: cannot unmarshal string into Go value of type t8ntool.input
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, good catch! Fixing...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed this in my last commit. One can't just take the output and feed to the input, since the input can contain many things. Therefore, you need to envelop the leaf json into an object, and call it txsRlp
:
[user@work evm]$ cat signed_txs.rlp.json| jq .
{
"txsRlp": "0xf8d2b86702f864010180820fa08284d09411111111111111111111111111111111111111118080c001a0b7dfab36232379bb3d1497a4f91c1966b1f932eae3ade107bf5d723b9cb474e0a06261c359a10f2132f126d250485b90cf20f30340801244a08ef6142ab33d1904b86702f864010280820fa08284d09411111111111111111111111111111111111111118080c080a0d4ec563b6568cd42d998fc4134b36933c6568d01533b5adf08769270243c6c7fa072bf7c21eac6bbeae5143371eef26d5e279637f3bd73482b55979d76d935b1e9"
}
[user@work evm]$ cat signed_txs.rlp.json| ./evm t8n --state.fork=London --input.alloc=./testdata/13/alloc.json --input.txs=stdin --input.env=./testdata/13/env.json --output.result=alloc_rlptx.json
INFO [07-28|09:56:08.806] Trie dumping started root=672261..31e1e5
INFO [07-28|09:56:08.806] Trie dumping complete accounts=3 elapsed="211.905µs"
INFO [07-28|09:56:08.806] Wrote file file=alloc.json
INFO [07-28|09:56:08.810] Wrote file file=alloc_rlptx.json
In many cases, it's desireable to use already-signed transactions as input to the state transition, instead of having the evm sign them internally (for example to use malformed or not-yet-valid transactions). This PR adds support + docs for that feature.
In many cases, it's desireable to use already-signed transactions as input to the state transition, instead of having the evm sign them internally (for example to use malformed or not-yet-valid transactions). This PR adds support + docs for that feature.
This PR supersedes #22963. In many cases, it's desireable to use already-signed transactions as input to the state transition, instead of having the evm sign them internally (for example to use malformed or not-yet-valid transactions).
This PR adds support + docs for that feature.
cc @winsvega