-
Notifications
You must be signed in to change notification settings - Fork 21
get-external-tx-optimisations #255
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
base: main
Are you sure you want to change the base?
get-external-tx-optimisations #255
Conversation
|
🤖 Claude Code Review Status: Complete Critical Issue Found: This PR introduces a breaking bug by removing the automatic field dependency logic from See inline comments for details: Recommendation: Restore the removed Positive aspects:
|
stores/utxo/aerospike/get.go
Outdated
| func parseInputReferencesOnly(reader io.Reader) ([]*bt.Input, error) { | ||
|
|
||
| // Parse version (4 bytes) | ||
| var version uint32 |
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.
Fixed - The code now correctly uses io.CopyN(io.Discard, reader, 4) to skip the version bytes without assigning to an unused variable.
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.
✅ Confirmed fixed in latest commit. The code now correctly uses io.CopyN(io.Discard, reader, 4) at line 1455.
…o stu/get-external-tx-optimisations
|
…d Extended needed if TxInpoints is specified
| } | ||
| } | ||
|
|
||
| if slices.Contains(newBins, fields.Tx) { |
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.
Critical Bug: The removed logic here (lines 456-459 in previous version) automatically added fields.Inputs and fields.External when TxInpoints was requested. Without this, callers using utxo.MetaFields will fail on external transactions because bins will not contain the required data. Fix: Restore the deleted TxInpoints check or remove TxInpoints from utxo.MetaFields.
| // Default fields - optimized for common use cases without scripts | ||
| // Services that need full transaction (persister, API) explicitly request fields.Tx | ||
| // TxInpoints requires Inputs and External fields to be fetched | ||
| bins := []fields.FieldName{fields.Fee, fields.SizeInBytes, fields.TxInpoints, fields.Inputs, fields.External, fields.BlockIDs, fields.IsCoinbase} |
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.
Inconsistency: This comment states "TxInpoints requires Inputs and External fields to be fetched" but the default bins list below manually includes these fields. The removed addAbstractedBins logic was supposed to add these automatically. Now callers who explicitly pass item.Fields (line 534-535) will bypass this default and miss the required dependencies.


No description provided.