cmd/evm: add --prestate, --sender, --json flags for fuzzing#14476
Conversation
|
Thank you for your contribution! Your commits seem to not adhere to the repository coding standards
Please check the contribution guidelines for more details. This message was auto-generated by https://gitcop.com |
|
Added support for json output: |
81e07ab to
252a836
Compare
|
Rebased. This is pretty good-to-go, but as I'm waiting for Parity to build something similar, I may have to modify it a bit to behave the same way as theirs. So IMO it can be merged now or later, not time-critical |
|
I've looked at this PR 3 times now and I've been trying to make sense of this in my head. I still can't figure out why this is needed. Can you please explain? |
|
I've rebased it now and changed the flag name to |
|
@holiman I think the JSON output needs to be formatted using lower camel case, not upper camel. Please add |
|
I've done that, I just haven't committed the most recent code yet. |
|
👍 |
|
I've added ability for the |
129ac97 to
34ffdb3
Compare
aa4af37 to
21ac4dd
Compare
| Gas math.HexOrDecimal64 `json:"gas"` | ||
| GasCost math.HexOrDecimal64 `json:"gasCost"` | ||
| Memory string `json:"memory"` | ||
| Stack hexArray `json:"stack"` |
There was a problem hiding this comment.
You can use gencodec to avoid writing the conversion.
//go:generate gencodec -type StructLogJson -field-override structLogJsonMarshaling -out gen_structlog_json.go
type StructLogJson struct{
...
Stack []*big.Int
}
type structLogJsonMarshaling struct{
Stack []*math.HexOrDecimal256
}This would create a MarshalJSON method that converts Stack internally.
There was a problem hiding this comment.
Oh nice, thanks. I wasn't sure how to cast those kind of spells
|
|
||
| // captureState logs a new structured log message and pushes it out to the environment | ||
| // NewJSONLogger returns a new JSON logger | ||
| func NewJSONLogger(writer io.Writer) *JSONLogger { |
There was a problem hiding this comment.
IMHO this logger should be defined in cmd/evm.
|
Thank you for your contribution! Your commits seem to not adhere to the repository coding standards
Please check the contribution guidelines for more details. This message was auto-generated by https://gitcop.com |
|
Thank you for your contribution! Your commits seem to not adhere to the repository coding standards
Please check the contribution guidelines for more details. This message was auto-generated by https://gitcop.com |
This is work in progress, do not merge yet.
This adds support to execute
evmwith a custom genesis, primarily to be able to useallocsection andconfigto test various evm hardfork rule implementations.Example execution below
Execution with the specified genesis file, with frontier-rules, where
BALANCEcost20, and0x2a50613a76a4c2c58d052d5ebf3b03ed3227eae9has some ether allocated:Execution with defaults, ( latest HF rules), where
BALANCEcost400, and0x2a50613a76a4c2c58d052d5ebf3b03ed3227eae9is not prefunded: