Skip to content

Poc/simd 0160 static instruction limit feature gated#8162

Closed
tao-stones wants to merge 3 commits into
anza-xyz:masterfrom
tao-stones:poc/simd-0160-static-instruction-limit-feautre-gated
Closed

Poc/simd 0160 static instruction limit feature gated#8162
tao-stones wants to merge 3 commits into
anza-xyz:masterfrom
tao-stones:poc/simd-0160-static-instruction-limit-feautre-gated

Conversation

@tao-stones
Copy link
Copy Markdown

Problem

draft for simd-160 for discussion

Summary of Changes

Fixes #

Comment thread runtime/src/bank.rs
}
let message_hash = if verification_mode == TransactionVerificationMode::FullVerification
{
// SIMD-0160, check instruction limit before signature verificaton
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

originally did this in solana-sdk, but not love the additional dependencies. Maybe having bank to enforce the limit for Replay is better?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think here is fine for replay verification.

Either after activation, or just now(?), we should make sdk throw an unconditional error for creating >64 ixs. It will fail no matter what so there's no use-case for it even before activation of the feature.

^creating, but not deserializing. So the "builder" fns for adding ixs.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

a separate change to SDK to not to build TX with more than 64 ix sounds good to me.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.56522% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 83.1%. Comparing base (ca8e32e) to head (bb6b046).
⚠️ Report is 168 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #8162    +/-   ##
========================================
  Coverage    83.1%    83.1%            
========================================
  Files         810      810            
  Lines      357480   357644   +164     
========================================
+ Hits       297163   297355   +192     
+ Misses      60317    60289    -28     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

c.iter(|| {
for bytes in serialized_transactions.iter() {
let _ = TransactionView::try_new_sanitized(black_box(bytes.as_ref())).unwrap();
let _ =
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

can't comment, but I think there's a benchmark case in here that has >64 txs. We should probably change it, otherwise they will fail.

let Some(priority) = SanitizedTransactionView::try_new_sanitized(packet_data)
let Some(priority) = SanitizedTransactionView::try_new_sanitized(
packet_data,
bank.feature_set
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

let's move this out of the loop, otherwise it looks it up everytime

Comment thread perf/src/sigverify.rs
.ok_or(PacketError::InvalidLen)?;

// SIMD-0160: skip if has more than 64 top instructions
if instruction_len > 64 {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

this is unconditional. i'm like 99% sure this fn is only run for BP, where that would be fine, but we should verify that's the case.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

BP == "block producer/packer"? sigverify only feed to leaders, it does not impact consensus, if that is what you mean. I'm thinking changes to sigverify can be o nits own PR without feature gate.

Comment thread runtime/src/bank.rs
}
let message_hash = if verification_mode == TransactionVerificationMode::FullVerification
{
// SIMD-0160, check instruction limit before signature verificaton
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think here is fine for replay verification.

Either after activation, or just now(?), we should make sdk throw an unconditional error for creating >64 ixs. It will fail no matter what so there's no use-case for it even before activation of the feature.

^creating, but not deserializing. So the "builder" fns for adding ixs.

@tao-stones
Copy link
Copy Markdown
Author

tao-stones commented Sep 24, 2025

@apfitzge to confirm: SIMD mentioned runtime has internal limit of 64 chained ixs, that is this code, is it? (context: need a const of 64 defined somewhere accessible by all parts)

@tao-stones
Copy link
Copy Markdown
Author

filed #8182 and #8183, comments above addressed in those PRs

@tao-stones tao-stones closed this Sep 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants