Skip to content

Conversation

taratorio
Copy link
Member

@taratorio taratorio commented Aug 7, 2025

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

@@ -178,12 +178,6 @@ func TestShutterBlockBuilding(t *testing.T) {
)
require.NoError(t, err)
})

t.Run("build shutter block without blob txns", func(t *testing.T) {
Copy link
Member Author

Choose a reason for hiding this comment

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

added in pool_test.go unit tests

}
v, r, s := signedBlobTxn.RawSignatureValues()
blobTxnWrapper := &BlobTxWrapper{
Tx: *txw.Tx.copy(),
Copy link
Contributor

Choose a reason for hiding this comment

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

WithSignature already makes a copy

@AskAlexSharov AskAlexSharov merged commit c87704b into main Aug 11, 2025
17 of 18 checks passed
@AskAlexSharov AskAlexSharov deleted the shutter-fixes-mem branch August 11, 2025 10:54
taratorio added a commit that referenced this pull request Aug 11, 2025
…gned copy (#16554)

addresses comment
#16505 (comment)
in a follow up since the PR got merged before I pushed
taratorio added a commit that referenced this pull request Aug 11, 2025
…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
taratorio added a commit that referenced this pull request Aug 11, 2025
…gned copy (#16554)

addresses comment
#16505 (comment)
in a follow up since the PR got merged before I pushed
taratorio added a commit that referenced this pull request Aug 11, 2025
…options handling + follow up - avoid using a 2nd copy and re-use signed copy (#16558)

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](https://go.dev/blog/synctest) - it will be added as stable in
go1.25
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.

[shutter] unit test for decryption key processor and fix for encrypted txn pool cleanup logic
3 participants