-
Notifications
You must be signed in to change notification settings - Fork 491
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 state sync hash #1207
Fix state sync hash #1207
Conversation
3e7023a
to
53db521
Compare
@@ -1092,7 +1092,7 @@ func (s *BlockChainAPI) GetBlockReceipts(ctx context.Context, blockNrOrHash rpc. | |||
|
|||
result := make([]map[string]interface{}, len(receipts)) | |||
for i, receipt := range receipts { | |||
result[i] = marshalReceipt(receipt, block.Hash(), block.NumberU64(), signer, txs[i], i) | |||
result[i] = marshalReceipt(receipt, block.Hash(), block.NumberU64(), signer, txs[i], i, false) |
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.
Can't remember but why aren't we filling state sync receipts here ?
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v1.3.0-beta-candidate #1207 +/- ##
=========================================================
- Coverage 51.44% 51.41% -0.04%
=========================================================
Files 794 794
Lines 131304 131310 +6
=========================================================
- Hits 67549 67512 -37
- Misses 59576 59619 +43
Partials 4179 4179 ☔ View full report in Codecov by Sentry. |
Is it possible to add a unit test for this fix? |
This PR is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
internal/ethapi/api.go
Outdated
result := make([]map[string]interface{}, len(receipts)) | ||
for i, receipt := range receipts { | ||
result[i] = marshalReceipt(receipt, block.Hash(), block.NumberU64(), signer, txs[i], i) | ||
result[i] = marshalReceipt(receipt, block.Hash(), block.NumberU64(), signer, txs[i], i, false) | ||
} |
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.
Hi! Should we append state sync receipt after the expected receipts?
result := make([]map[string]interface{}, len(receipts)) | |
for i, receipt := range receipts { | |
result[i] = marshalReceipt(receipt, block.Hash(), block.NumberU64(), signer, txs[i], i) | |
result[i] = marshalReceipt(receipt, block.Hash(), block.NumberU64(), signer, txs[i], i, false) | |
} | |
result := make([]map[string]interface{}, len(receipts+1)) | |
for i, receipt := range receipts { | |
result[i] = marshalReceipt(receipt, block.Hash(), block.NumberU64(), signer, txs[i], i, false) | |
} | |
receipt := rawdb.ReadBorReceipt(s.b.ChainDb(), block.Hash(), block.NumberU64(), s.b.ChainConfig()) | |
if receipt != nil { | |
tx, _, _, _ := rawdb.ReadBorTransaction(s.b,ChainDb(), receipt.TxHash) | |
fields := ethapi.MarshalReceipt(receipt, block.Hash(), block.NumberU64(), signer, tx, int(receipt.TransactionIndex), true) | |
txReceipts = append(txReceipts, fields) | |
} |
Hi, what's the status of this PR? |
… state sync txn in GetTransactonReceiptsByBlock
Description
Fixes hashing of state sync transactions in RPC calls.
Changes
Checklist
Cross repository changes
Testing
Manual tests
Please complete this section with the steps you performed if you ran manual tests for this functionality, otherwise delete it
Additional comments
Please post additional comments in this section if you have them, otherwise delete it