-
Notifications
You must be signed in to change notification settings - Fork 4
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
evm_tokens: fix potential nil-pointer dereference #430
Conversation
cd89a23
to
c139650
Compare
testnet, was this emerald? can we figure out the height and/or contract address? the ERC spec says the total supply is required. we're meant to treat the contract as not ERC-20 if the total supply is not supported |
Looking at the DB it looks like this is sapphire. (there is no stale emerald tokens found if running the Also, a lot of "ERC20 call failed" errors in the logs:
|
Are there any successful ones as well or do they all fail? |
It could be that all are failing, not sure how to check actually, I don't think there's anything logged for successful calls. Someone that understands the tokens analysis code should probably check. |
If all are failing this likely means that the client node is not configured correctly or is not whitelisted for key manager access. @gw0 do you know? |
Looks correct. The production |
Yeah some calls are working, since here e.g. simulate call works (but is reverted). @pro-wh This is sapphire, see the round and address in the log message below.
This happens here: https://github.com/oasisprotocol/oasis-indexer/blob/f33b4a9558b4d5736af5c137592ed951cf1c0fff/analyzer/runtime/evm/client.go#L210-L216 Which then causes the Which causes the nil pointer here: |
c139650
to
2a42365
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh right we're inserting the unsupported tokens now
2a42365
to
e9f7969
Compare
On Testnet Production:
Looking at the code, the
EVMDownloadNewToken
can returnEVMTokenTypeUnsupported
which will causetokenData.TotalSupply
to benil
(so shouldn't call.String()
on it without checking): https://github.com/oasisprotocol/oasis-indexer/blob/f33b4a9558b4d5736af5c137592ed951cf1c0fff/analyzer/runtime/evm/client.go#L243Don't have a lot of context about the code around here, so I just pushed a minimal change to avoid the nil pointer here.