Skip to content

Conversation

@asdacap
Copy link
Contributor

@asdacap asdacap commented Sep 11, 2025

  • Fix the counter used to skip prewarming not working.
  • Removed the TransactionProcessed field and used a prewarmer specific decorator instead.

Types of changes

What types of changes does your code introduce?

  • Bugfix (a non-breaking change that fixes an issue)
  • Refactoring

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

Notes on testing

  • Verified to work with a custom metric and reversed tx order. No tx is skipped if not reversed.


public void OnBeforeTxExecution(Transaction transaction)
{
_currentBlockState?.IncrementTransactionCounter();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The IsToBeWarmedWorldState make sure that this is the main tx processing one. So it just need to increment the number.

private bool _isInScope = false;
private readonly ILogger _logger;
private PreBlockCaches? PreBlockCaches { get; }
public bool IsToBeWarmedWorldState { get; }
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
public bool IsToBeWarmedWorldState { get; }
public bool WarmWorldState { get; }

Or PopulateCaches
Or Enabled


public void OnBeforeTxExecution(Transaction transaction)
{
_currentBlockState?.IncrementTransactionCounter();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The IsToBeWarmedWorldState make sure that this is the main tx processing one. So it just need to increment the number.

}
}

public class PrewarmerTxAdapter(ITransactionProcessorAdapter baseAdapter, BlockCachePreWarmer preWarmer, IWorldState worldState) : ITransactionProcessorAdapter
Copy link
Member

Choose a reason for hiding this comment

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

Move to own file?

@asdacap asdacap merged commit 8f9f37e into master Sep 11, 2025
137 of 139 checks passed
@asdacap asdacap deleted the fix/transaction-processed-idx-not-working branch September 11, 2025 11:48
{
PreBlockCaches Caches { get; }
bool IsToBeWarmedWorldState { get; }
bool IsWarmWorldState { get; }
Copy link
Member

Choose a reason for hiding this comment

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

Not proper english? WarmWorldState would be better? But we are i IPreBlockCaches I would like the name not to contain WorldState if possible.

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