eth/tracers: extend tracers for CREATE2#17565
eth/tracers: extend tracers for CREATE2#17565YaoZengzeng wants to merge 1 commit intoethereum:masterfrom
CREATE2#17565Conversation
|
👍 |
|
If we just merge this, it will have no effect, the |
|
You just need to do |
beb141a to
f8d2fc1
Compare
There was a problem hiding this comment.
This is not correct. The code below uses toContract(from, db.getNonce(from)) to generate the contract address, but CREATE2 has a different contract address generation scheme. You'll need to implement a toContract2 similar to https://github.com/ethereum/go-ethereum/blob/master/eth/tracers/tracer.go#L354
f52a41c to
f10bb14
Compare
Signed-off-by: YaoZengzeng <yaozengzeng@zju.edu.cn>
f10bb14 to
c49e754
Compare
|
@karalabe Updated, actually I know nothing about js and I implement PTAL if it is correct :) |
| code := common.CopyBytes(makeSlice(ctx.GetBuffer(-1))) | ||
| ctx.Pop3() | ||
|
|
||
| contract := crypto.CreateAddress2(from, salt, code) |
There was a problem hiding this comment.
This is now wrong, CreateAddress2 now uses codeHash , not code.
|
@YaoZengzeng could you update it to use codehash instead? |
|
I am almost unfamiliar with the code base now. I will close this PR and maybe @holiman could make another PR to fix it. Sorry for that. |
ref: #17196