-
Notifications
You must be signed in to change notification settings - Fork 10
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 decoding issues with previous formats #237
Conversation
WalkthroughThis update involves modifications across several files in the Flow EVM Gateway codebase, focusing on error handling, transaction processing, and receipt decoding. The changes aim to improve robustness and adapt to new data structures, ensuring more reliable operations and better error feedback in blockchain interactions. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 2
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- api/api.go (6 hunks)
- models/transaction.go (1 hunks)
- storage/pebble/receipts.go (2 hunks)
Additional comments not posted (2)
api/api.go (2)
285-290
: Ensure that theprepareBlockResponse
function correctly handles all cases as expected.
320-325
: Confirm that theprepareBlockResponse
function is used consistently and correctly across different scenarios.Verification successful
The
prepareBlockResponse
function is used consistently and correctly within theapi.go
file. It appears in two identical calls and is defined once in the same file. There are no other occurrences in the rest of the codebase, indicating that its usage is confined to specific scenarios within this file, which is typical for specialized functions.
- File:
api/api.go
- Usage: Called twice with identical parameters and context.
- Definition: Clearly defined in the same file.
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for consistent usage of `prepareBlockResponse` across different scenarios. # Test: Search for inconsistent usage patterns. rg --type go $'prepareBlockResponse' api/api.goLength of output: 214
Script:
#!/bin/bash # Description: Search for all occurrences of `prepareBlockResponse` across the entire repository to verify consistent usage. # Search for the function usage across all Go files. rg --type go 'prepareBlockResponse'Length of output: 236
// todo remove this after previewnet is reset | ||
// breaking change on transaction data, try without type | ||
if err := tx.UnmarshalBinary(value); err == nil { | ||
return TransactionCall{Transaction: tx}, nil | ||
} | ||
|
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.
Tip
Codebase Verification
The search results confirm that the temporary decoding logic, marked with a "todo" comment about removing it after the previewnet reset, is still present in the models/transaction.go
file. This indicates that the intended removal has not yet been executed.
Temporary Decoding Logic Still Present in models/transaction.go
- The temporary decoding logic that was supposed to be removed after the previewnet reset is still present in the codebase. This needs attention to ensure the code aligns with the intended changes post-reset.
Analysis chain
Temporary decoding logic added to handle breaking changes.
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify that the temporary decoding logic is removed after the previewnet reset.
# Test: Search for the temporary decoding logic. Expect: No occurrences after the reset.
rg --type go $'// todo remove this after previewnet is reset' models/transaction.go
Length of output: 132
storage/pebble/receipts.go
Outdated
if err = rlp.DecodeBytes(val, &storeReceipts); err != nil { | ||
// todo remove this after previewnet is reset | ||
// try to decode single receipt (breaking change migration) | ||
var storeReceipt models.StorageReceipt | ||
if err = rlp.DecodeBytes(val, &storeReceipt); err != nil { | ||
return nil, err | ||
} | ||
|
||
storeReceipts = []*models.StorageReceipt{&storeReceipt} |
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.
Tip
Codebase Verification
The search results confirm that the comment indicating the temporary logic for decoding single receipts due to breaking changes is still present in the storage/pebble/receipts.go
file. This suggests that the temporary logic has not been removed following the previewnet reset as initially planned.
Temporary Logic for Decoding Single Receipts Still Present
- The temporary logic intended for removal after the previewnet reset is still in the codebase. This needs attention to ensure the code aligns with the intended lifecycle of temporary fixes.
- Location:
storage/pebble/receipts.go
Analysis chain
Temporary logic added to decode single receipts due to breaking changes.
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify that the temporary logic for decoding single receipts is removed after the previewnet reset.
# Test: Search for the temporary logic. Expect: No occurrences after the reset.
rg --type go $'// todo remove this after previewnet is reset' storage/pebble/receipts.go
Length of output: 137
This PR addresses decoding of existing data in the index that was changed in meantime. This will all be reverted after we remove such an existing network (previewnet).
Summary by CodeRabbit