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

all: mv loggers to eth/tracers #23892

Merged
merged 8 commits into from Nov 25, 2021
Merged

all: mv loggers to eth/tracers #23892

merged 8 commits into from Nov 25, 2021

Conversation

s1na
Copy link
Contributor

@s1na s1na commented Nov 11, 2021

Mostly creating the PR so i can see the failures through CI xD

@s1na
Copy link
Contributor Author

s1na commented Nov 22, 2021

So most of the changes were trivial, only moving stuff around and changing some imports. Only thing was the struct logger's TestStoreCapture which was instantiating and using the stack directly. However stack is private so I had to work around that in this commit

@s1na s1na marked this pull request as ready for review November 22, 2021 17:28
Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor comment, otherwise generally LGTM

Comment on lines 60 to 66
contract.Code = []byte{byte(vm.PUSH32)}
one := uint256.NewInt(1).Bytes32()
zero := new(uint256.Int).Bytes32()
contract.Code = append(contract.Code, one[:]...)
contract.Code = append(contract.Code, byte(vm.PUSH32))
contract.Code = append(contract.Code, zero[:]...)
contract.Code = append(contract.Code, byte(vm.SSTORE))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
contract.Code = []byte{byte(vm.PUSH32)}
one := uint256.NewInt(1).Bytes32()
zero := new(uint256.Int).Bytes32()
contract.Code = append(contract.Code, one[:]...)
contract.Code = append(contract.Code, byte(vm.PUSH32))
contract.Code = append(contract.Code, zero[:]...)
contract.Code = append(contract.Code, byte(vm.SSTORE))
contract.Code = []byte{
byte(vm.PUSH1), 0x1,
byte(vm.PUSH1), 0x0,
byte(vm.SSTORE),
}

Copy link
Contributor

@holiman holiman Nov 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could even be further simplified by changing to sstore(1,1):

	contract.Code = []byte{
		byte(vm.PUSH1), 0x1, byte(vm.DUP1), byte(vm.SSTORE),
	}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right, that's what I had first but it was failing, as I later found out, for another reason. Fixed

Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@karalabe karalabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM

@karalabe karalabe added this to the 1.10.14 milestone Nov 25, 2021
@karalabe karalabe merged commit 1876cb4 into ethereum:master Nov 25, 2021
sidhujag pushed a commit to syscoin/go-ethereum that referenced this pull request Nov 25, 2021
* all: mv loggers to eth/tracers

* core/vm: minor

* eth/tracers: tmp comment out testStoreCapture

* eth/tracers: uncomment and fix logger test

* eth/tracers: simplify test

* core/vm: re-add license

* core/vm: minor

* rename LogConfig to Config
@s1na s1na deleted the mv-loggers branch November 30, 2021 10:17
JacekGlen pushed a commit to JacekGlen/go-ethereum that referenced this pull request May 26, 2022
* all: mv loggers to eth/tracers

* core/vm: minor

* eth/tracers: tmp comment out testStoreCapture

* eth/tracers: uncomment and fix logger test

* eth/tracers: simplify test

* core/vm: re-add license

* core/vm: minor

* rename LogConfig to Config
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.

None yet

3 participants