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

fields["logs"] incorrectly set #24368

Closed
nuliknol opened this issue Feb 10, 2022 · 1 comment · Fixed by #24372
Closed

fields["logs"] incorrectly set #24368

nuliknol opened this issue Feb 10, 2022 · 1 comment · Fixed by #24372

Comments

@nuliknol
Copy link

isn't this a bug?

internal/ethapi/api.go , line 1660

    if receipt.Logs == nil {
        fields["logs"] = [][]*types.Log{}
    }  

the fields["logs"] must be of type []*types.Log[], not [][]*types.Log , i.e. it must be single array, not double array:

as in receipt.go:

 type Receipt struct {
....
    Logs              []*Log `json:"logs"              gencodec:"required"`
....
}

this is in 1.10.15 (released code tarball)

@holiman
Copy link
Contributor

holiman commented Feb 10, 2022

Nice catch! It's indeed a bug, and it's been there at least 5 years. However, since the slice is empty, it doesn't matter what the type is, in this case. So it's wrong and we should fix it, but in practice it's of no consequence.

holiman added a commit that referenced this issue Feb 15, 2022
* Fixes #24368

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Update internal/ethapi/api.go

Co-authored-by: Martin Holst Swende <martin@swende.se>
sidhujag pushed a commit to syscoin/go-ethereum that referenced this issue Feb 15, 2022
* Fixes ethereum#24368

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Update internal/ethapi/api.go

Co-authored-by: Martin Holst Swende <martin@swende.se>
JacekGlen pushed a commit to JacekGlen/go-ethereum that referenced this issue May 26, 2022
* Fixes ethereum#24368

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Update internal/ethapi/api.go

Co-authored-by: Martin Holst Swende <martin@swende.se>
maoueh pushed a commit to streamingfast/go-ethereum that referenced this issue Sep 30, 2022
* Fixes ethereum#24368

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Update internal/ethapi/api.go

Co-authored-by: Martin Holst Swende <martin@swende.se>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants