Skip to content
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

eth/tracers: replace hardcoded txGas with actual #7

Conversation

s1na
Copy link

@s1na s1na commented Dec 17, 2020

So a few comments here:

  • I needed isHomestead and isIstanbul values and didn't store them in the ctx map because that would expose them to js. So stored them in the Tracer struct instead
  • My bindata output seems different. It might be because I'm using v3.1.2? which version do you use?
  • Also I still need to rebase master to fix the merge conflicts

* (mobile): Adds string representations for types

* mobile: better interfaces add stringer to types

Co-authored-by: sarath <sarath@melvault.com>
This change moves the RLPx protocol implementation into a separate package,
p2p/rlpx. The new package can be used to establish RLPx connections for
protocol testing purposes.

Co-authored-by: Felix Lange <fjl@twurst.com>
…thereum#21545)

This allows users to estimate gas on top of arbitrary blocks as well as pending and latest.
Tracing on pending is useful for most users as it takes into account the current txpool while
tracing on latest might be useful for users that have little to know knowledge of the current
transactions in the network.

If blockNrOrHash is not specified, estimateGas defaults to pending
* trie: support non-existent right proof

* trie: improve test

* trie: minor linter fix

Co-authored-by: Péter Szilágyi <peterke@gmail.com>
…hereum#21601)

* tried to fix

* fix for js api

* fix for nil pointer ex

* rev space

* rev space

* input call formatter
This change adds a test framework for the "eth" protocol and some basic
tests. The tests can be run using the './devp2p rlpx eth-test' command.
params: update CHTs for Geth v1.9.22
…terface (ethereum#21091)

* accounts/abi: refactored abi.Unpack

* accounts/abi/bind: fixed error

* accounts/abi/bind: modified template

* accounts/abi/bind: added ToStruct for conversion

* accounts/abi: reenabled tests

* accounts/abi: fixed tests

* accounts/abi: fixed tests for packing/unpacking

* accounts/abi: fixed tests

* accounts/abi: added more logic to ToStruct

* accounts/abi/bind: fixed template

* accounts/abi/bind: fixed ToStruct conversion

* accounts/abi/: removed unused code

* accounts/abi: updated template

* accounts/abi: refactored unused code

* contracts/checkpointoracle: updated contracts to sol ^0.6.0

* accounts/abi: refactored reflection logic

* accounts/abi: less code duplication in Unpack*

* accounts/abi: fixed rebasing bug

* fix a few typos in comments

* rebase on master

Co-authored-by: Guillaume Ballet <gballet@gmail.com>
* mobile: added constructor for big int

* mobile: tiny nitpick
…thereum#21572)

* Fix potential memory leak in price heap

* core: nil free pointer slice (alternative version)

Co-authored-by: Martin Holst Swende <martin@swende.se>
* ci: tooltips for javadoc for mobile app

* f space
core/types: use stacktrie for derivesha

trie: add stacktrie file

trie: fix linter

core/types: use stacktrie for derivesha

rebased: adapt stacktrie to the newer version of DeriveSha

Co-authored-by: Martin Holst Swende <martin@swende.se>

More linter fixes

review feedback: no key offset for nodes converted to hashes

trie: use EncodeRLP for full nodes

core/types: insert txs in order in derivesha

trie: tests for derivesha with stacktrie

trie: make stacktrie use pooled hashers

trie: make stacktrie reuse tmp slice space

trie: minor polishes on stacktrie

trie/stacktrie: less rlp dancing

core/types: explain the contorsions in DeriveSha

ci: fix goimport errors

trie: clear mem on subtrie hashing

squashme: linter fix

stracktrie: use pooling, less allocs (#3)

trie: in-place hex prefix, reduce allocs and add rawNode.EncodeRLP

Reintroduce the `[]node` method, add the missing `EncodeRLP` implementation for `rawNode` and calculate the hex prefix in place.

Co-authored-by: Martin Holst Swende <martin@swende.se>

Co-authored-by: Martin Holst Swende <martin@swende.se>
* accounts, signer: implement gnosis safe support

* common/math: add type for marshalling big to dec

* accounts, signer: properly sign gnosis requests

* signer, clef: implement account_signGnosisTx

* signer: fix auditlog print, change rpc-name (signGnosisTx to signGnosisSafeTx)

* signer: pass validation-messages/warnings to the UI for gnonsis-safe txs

* signer/core: minor change to validationmessages of typed data
* trie: update tests to check commit integrity

* trie: polish committer

* trie: fix typo

* trie: remove hasvalue notion

According to the benchmarks, type assertion between the pointer and
interface is extremely fast.

BenchmarkIntmethod-12           1000000000               1.91 ns/op
BenchmarkInterface-12           1000000000               2.13 ns/op
BenchmarkTypeSwitch-12          1000000000               1.81 ns/op
BenchmarkTypeAssertion-12       2000000000               1.78 ns/op

So the overhead for asserting whether the shortnode has "valuenode"
child is super tiny. No necessary to have another field.

* trie: linter nitpicks

Co-authored-by: Martin Holst Swende <martin@swende.se>
…hereum#21649)

* core/state/snapshot: exit Geth if generator hits missing trie nodes

* core/state/snapshot: error instead of hard die on generator fault

* core/state/snapshot: don't enable logging on the tests
connorwstein and others added 8 commits December 12, 2020 10:16
…rning structs (ethereum#22005)

Fixes the template used when generating code, which in some scenarios would lead to panic instead of returning an error.
* doc: clarify abigen alias flag usage

update the `abigen --alias` flag help info, give an example to make it more clear

related issue: ethereum#21846

* Update cmd/abigen/main.go

Co-authored-by: ligi <ligi@ligi.de>

Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: ligi <ligi@ligi.de>
This commit splits the eth package, separating the handling of eth and snap protocols. It also includes the capability to run snap sync (https://github.com/ethereum/devp2p/blob/master/caps/snap.md) , but does not enable it by default. 

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: Martin Holst Swende <martin@swende.se>
* les: allow tx unindexing in les/4 light server mode

* les: minor fixes

* les: more small fixes

* les: add meaningful constants for recentTxIndex handshake field
@holiman
Copy link
Collaborator

holiman commented Dec 17, 2020 via email

@s1na
Copy link
Author

s1na commented Dec 17, 2020

How about setting 'intrinsicGas' as another param on the ctx, instead of adding it to gasUsed.

Makes sense, I'll do that

So I'd pefert a second field personally

Just to clarify, you're saying we should compute intrinsicGas in evm.go and pass it to CaptureEnd (in addition to the current gasUsed)? I can do that

@holiman
Copy link
Collaborator

holiman commented Dec 17, 2020 via email

@s1na s1na requested a review from gballet as a code owner December 18, 2020 11:51
@s1na
Copy link
Author

s1na commented Dec 18, 2020

Actually I didn't mean that, I meant that the js thingy would calculate it, like you did, and set it inside the javascript-object. But the other way might work aswell, but have larger ramifications.

Sorry I had misunderstood and thought this is a different point from intrinsicGas in ctx.

Fixed that issue now, but I messed up the PR...I merged master into this branch to fix the conflicts but now it has a massive diff which makes it hard to review, sorry. Any ideas?

@holiman
Copy link
Collaborator

holiman commented Dec 18, 2020

Fixed that issue now, but I messed up the PR...I merged master into this branch to fix the conflicts but now it has a massive diff which makes it hard to review, sorry. Any ideas?

Yep, here's what we do

git rebase -i eth/master 

Well, depending on how you have it configured. I recommend having eth or upstream as go-ethereum, and origin be your own fork.
After that,

git push -f

To push it to your branch

@s1na s1na force-pushed the gasprice-available-to-vm-tracer branch from 7acf031 to 7b5bfae Compare December 18, 2020 12:56
eth/tracers: include tx gas in tracers usedGas

eth/tracers: fix prestate tracer's sender balance

eth/tracers: rm unnecessary import

eth/tracers: pass intrinsicGas separately to tracer

eth/tracers: fix tests broken by lack of txdata

eth, eth/tracers: minor fix
@s1na s1na force-pushed the gasprice-available-to-vm-tracer branch from 7b5bfae to c4e1371 Compare December 18, 2020 13:07
@s1na
Copy link
Author

s1na commented Dec 18, 2020

Thanks. I chose the easy way and used merge instead of rebase...I've now rebased but this PR still has the massive diff I think because it has a different history from Guillaume's branch. I created a fresh PR ethereum#22038 directly against master. Will close this afterwards.

@holiman holiman force-pushed the gasprice-available-to-vm-tracer branch from 18d89f5 to 87dffcf Compare December 21, 2020 14:30
@gballet gballet closed this Dec 25, 2020
gballet pushed a commit that referenced this pull request Jun 8, 2021
…er (#7) (ethereum#22989)

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Co-authored-by: Mikhail Kalinin <noblesse.knight@gmail.com>
@s1na s1na deleted the gasprice-available-to-vm-tracer branch September 14, 2021 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.