eth_getCode returns error #57
Labels
No Label
bug
critical
documentation
duplicate
enhancement
Epic
good first issue
help wanted
Integration tests
invalid
question
v5
wontfix
Copied from Github
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cerc-io/ipld-eth-server#57
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
eth_getCode returns error when block number set to
nil
:ipldClient.CodeAt(ctx, common.HexToAddress(contractAddress), nil)
Return message:
What happens if you send
nil
to geth?You'll get an error of the form:
errors.New("invalid arguments; neither block nor hash specified")
, so it should be returning an error.Also the arg is
rpc.BlockNumberOrHash
It returns code without any errors
That doesn't seem right.
https://github.com/vulcanize/go-ethereum/blob/master/internal/ethapi/api.go#L729 =>
f26c19cbcd/eth/api_backend.go (L171)
If
blockNrOrHash
isnil
both thoseok
checks will fail and fall through to the errhttps://github.com/vulcanize/ipld-eth-server/pull/53/files#diff-8118e44ac15fb5ab2e2ece2ab52fd23062a10b5cc9c55ee5b3620a1242cff27cR186-R194
Thanks! I think the RPC server must be converting the
nil
arg torpc.LatestBlockNumber
(-1) behind the scenes, which is causing the issue.Fixed in commit
9b960a105f