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

Add logic to remove a small number of tx hashes each block #2048

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

codchen
Copy link
Collaborator

@codchen codchen commented Jan 21, 2025

Describe your changes and provide context

Remove 10 tx hashes every block until all tx hashes are deleted.

Testing performed to validate your change

unit test

@@ -298,6 +298,9 @@
// EndBlock executes all ABCI EndBlock logic respective to the evm module. It
// returns no validator updates.
func (am AppModule) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.ValidatorUpdate {
// TODO: remove after all TxHashes have been removed
am.keeper.RemoveFirstNTxHashes(ctx, keeper.DefaultTxHashesToRemove)

Check warning

Code scanning / CodeQL

Panic in BeginBock or EndBlock consensus methods Warning

path flow from Begin/EndBlock to a panic call
Copy link

codecov bot commented Jan 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.49%. Comparing base (8095774) to head (fe92e36).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2048      +/-   ##
==========================================
+ Coverage   61.28%   61.49%   +0.21%     
==========================================
  Files         264      265       +1     
  Lines       24566    24581      +15     
==========================================
+ Hits        15056    15117      +61     
+ Misses       8384     8335      -49     
- Partials     1126     1129       +3     
Files with missing lines Coverage Δ
x/evm/keeper/tx.go 100.00% <100.00%> (ø)
x/evm/module.go 39.42% <100.00%> (+0.88%) ⬆️

... and 4 files with indirect coverage changes

@@ -298,6 +298,9 @@ func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) {
// EndBlock executes all ABCI EndBlock logic respective to the evm module. It
// returns no validator updates.
func (am AppModule) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.ValidatorUpdate {
// TODO: remove after all TxHashes have been removed
Copy link
Contributor

Choose a reason for hiding this comment

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

could we do this every 10 blocks? just so we spread it out and it doesn't look like block times are just degrading?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants