Skip to content
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

feature: transaction's input truncate function #12236

Merged
merged 1 commit into from
Nov 1, 2024

Conversation

nadtech-hub
Copy link
Contributor

This one should close 11163

Signed-off-by: nadtech-hub <taberlick@gmail.com>
@@ -102,7 +102,9 @@ impl TransactionCompat for () {
WithOtherFields::default()
}

fn otterscan_api_truncate_input(_tx: &mut Self::Transaction) {}
fn otterscan_api_truncate_input(tx: &mut Self::Transaction) {
tx.input = tx.input.slice(..4);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is actually dangerous and incorrect in the other implementations as well, we need to check that the input slice actually as at least 4 items

Copy link
Contributor Author

@nadtech-hub nadtech-hub Nov 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is double-check in case of otterscan. input may contain arbitrary data so truncating will return smth nonse

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, but this check should be in the impl instead, can do that separately, though

@mattsse mattsse added the A-rpc Related to the RPC implementation label Nov 1, 2024
@mattsse mattsse merged commit f6bd11c into paradigmxyz:main Nov 1, 2024
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rpc Related to the RPC implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove trait method TransactionCompat::otterscan_api_truncate_input
2 participants