Skip to content

txnprovider/shutter: additional tests and fixes for pool cleanup and options handling + follow up - avoid using a 2nd copy and re-use signed copy#16558

Merged
taratorio merged 3 commits intorelease/3.1from
cp-r31-shutter-fixes-mem
Aug 11, 2025
Merged

txnprovider/shutter: additional tests and fixes for pool cleanup and options handling + follow up - avoid using a 2nd copy and re-use signed copy#16558
taratorio merged 3 commits intorelease/3.1from
cp-r31-shutter-fixes-mem

Conversation

@taratorio
Copy link
Copy Markdown
Member

cherry-pick #16505
cherry-pick #16554


closes #14287

adds tests in pool_test.go for:

  • pool cleanup - verify both encrypted and decrypted txn pools get cleaned up
  • blob txns are skipped from shutter pool - if accidentally ending up in the txn pool (matches nethermind)
  • pool taking into account WithGasTarget and WithTxnIdsFilter options for ProvideTxns

fixes for discovered issues:

  • we weren't updating the cleanup metrics for the encrypted txn pool (made it look like the pool isn't getting cleaned up and leaking mem)
  • found a bug in EncryptedTxnSubmissionLess which is used to traverse the submissions tree
  • we weren't calling txnParseCtx.ParseTransaction with correct input for hasEnvelope
  • we weren't taking into account gas target and txn ids filter options
  • we had incorrect logic for signing blob txns (there were no usages for it across the codebase before these new tests were added)
  • added a error log in case the pool unexpectedly stopped due to some err and ProvideTxns was called - makes it much easier to see that the background goroutines are no longer operational
  • simplified logic for MaxDecryptionKeysDelay (better protection for very long waits for unexpected future slot inputs)
  • fixes an issue that caused our validators to crash a month ago:
[EROR] [07-08|16:59:33.000] background component error               err="decryption keys processor issue: decryption keys processing loop: unexpected item txn index lt next txn index: 38275 < 38276"

note: im making use of experimental (go1.24) synctest - it will be added as stable in go1.25

…options handling (#16505)

closes #14283

adds tests in `pool_test.go` for:
- pool cleanup - verify both encrypted and decrypted txn pools get
cleaned up
- blob txns are skipped from shutter pool - if accidentally ending up in
the txn pool (matches nethermind)
- pool taking into account WithGasTarget and WithTxnIdsFilter options
for ProvideTxns

fixes for discovered issues:
- we weren't updating the cleanup metrics for the encrypted txn pool
(made it look like the pool isn't getting cleaned up and leaking mem)
- found a bug in `EncryptedTxnSubmissionLess` which is used to traverse
the submissions tree
- we weren't calling `txnParseCtx.ParseTransaction` with correct input
for `hasEnvelope`
- we weren't taking into account gas target and txn ids filter options
- we had incorrect logic for signing blob txns (there were no usages for
it across the codebase before these new tests were added)
- added a error log in case the pool unexpectedly stopped due to some
err and ProvideTxns was called - makes it much easier to see that the
background goroutines are no longer operational
- simplified logic for MaxDecryptionKeysDelay (better protection for
very long waits for unexpected future slot inputs)
- fixes an issue that caused our validators to crash a month ago: 
```
[EROR] [07-08|16:59:33.000] background component error               err="decryption keys processor issue: decryption keys processing loop: unexpected item txn index lt next txn index: 38275 < 38276"
```

note: im making use of experimental (go1.24)
[synctest](https://go.dev/blog/synctest) - it will be added as stable in
go1.25
…gned copy (#16554)

addresses comment
#16505 (comment)
in a follow up since the PR got merged before I pushed
@taratorio taratorio enabled auto-merge (squash) August 11, 2025 14:41
@taratorio taratorio merged commit 0695996 into release/3.1 Aug 11, 2025
9 checks passed
@taratorio taratorio deleted the cp-r31-shutter-fixes-mem branch August 11, 2025 15:00
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.

2 participants