-
Notifications
You must be signed in to change notification settings - Fork 8
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 getLog
API to use log_cids
table
#92
Changes from 1 commit
d8a5358
b3e4fbf
c0a4600
3d1b308
a28892f
d0c3241
71837c4
967c148
121c75c
4d9edd2
458aae1
04a0f9a
7f0c8fb
ed4171a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -524,12 +524,18 @@ func (pea *PublicEthAPI) localGetTransactionReceipt(ctx context.Context, hash co | |
"logsBloom": receipt.Bloom, | ||
} | ||
|
||
// Assign receipt status or post state. | ||
if len(receipt.PostState) > 0 { | ||
if blockNumber <= pea.B.Config.ChainConfig.ByzantiumBlock.Uint64() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A problem with this is that this deviates from the normal, expected behavior of this eth json-rpc endpoint. The regular endpoint only fills in the status if it is explicitly known: https://github.com/ethereum/go-ethereum/blob/master/internal/ethapi/api.go#L1650. So this breaks compatibility with the regular endpoint. |
||
if receipt.GasUsed > tx.Gas() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm missing something. When will receipt.GasUsed ever be more than tx.Gas()? When a tx fails for whatever reason is it's receipt.GasUsed simply set to something above the tx.Gas() to indicate it failed? Seems odd but I'm not super familiar with this pre-byzantium behavior- wouldn't it need to track/report how much gas was actually used during the failed execution/reversion (because the tx sender still has to pay for whatever execution was performed prior to it reverting/failing)? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added an issue to track this #102 |
||
fields["status"] = hexutil.Uint(types.ReceiptStatusFailed) | ||
} else { | ||
fields["status"] = hexutil.Uint(types.ReceiptStatusSuccessful) | ||
} | ||
} else if len(receipt.PostState) > 0 { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We still want to fill in the |
||
fields["root"] = hexutil.Bytes(receipt.PostState) | ||
} else { | ||
fields["status"] = hexutil.Uint(receipt.Status) | ||
} | ||
|
||
if receipt.Logs == nil { | ||
fields["logs"] = []*types.Log{} | ||
} | ||
|
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.
Let's call this gas_limit, it's more accurate to how things are defined in EIPs/specs and more explicit about what it is/how it is used.