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

Fix bad geth log decoding #2476

Merged
merged 2 commits into from
Mar 12, 2020

Conversation

spooktheducks
Copy link
Contributor

No description provided.

require.Equal(t, common.HexToAddress("f17f52151ebef6c7334fad080c5704d77216b732"), newRoundLog.StartedBy)
require.Equal(t, int64(15), newRoundLog.StartedAt.Int64())

type BadLogNewRound struct {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is it bad ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In Solidity, the round ID field is roundId. Geth's Go code expects this to translate to RoundId, not RoundID, and fails to find the field if it doesn't.

Copy link
Contributor

@felder-cl felder-cl Mar 12, 2020

Choose a reason for hiding this comment

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

ethereum/go-ethereum#16648 <- does go-eth support these 'abi' tags?

i.e.

type MyEventParameters struct {
     Value1 *big.Int `abi:"value"`
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only on non-indexed fields. I plan to rework their decoding logic in a subsequent PR to add this feature for indexed fields.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok as long as it was considered

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we pls have a comment explaining this. Not obvious.

core/eth/geth_copied.go Show resolved Hide resolved
@felder-cl
Copy link
Contributor

Might be good to have a PR description and/or comment to help introduce context

Address common.Address
}

type LogAnswerUpdated struct {
Current *big.Int
RoundID *big.Int
RoundId *big.Int
Timestamp *big.Int
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, that was the whole issue in the first place -- Geth's code expected a lowercase final d

RyanRHall
RyanRHall previously approved these changes Mar 12, 2020
@spooktheducks spooktheducks dismissed samsondav’s stale review March 12, 2020 18:06

Changes made and this is urgent

Copy link
Collaborator

@samsondav samsondav left a comment

Choose a reason for hiding this comment

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

LGTM just one tiny comment request

@spooktheducks spooktheducks merged commit 8b543fb into develop Mar 12, 2020
@spooktheducks spooktheducks deleted the 171761388-bug/fix-bad-geth-log-decoding branch March 12, 2020 18:29
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.

4 participants