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

feat: #225 add transaction pruning service #258

Merged
merged 3 commits into from
Apr 24, 2024
Merged

feat: #225 add transaction pruning service #258

merged 3 commits into from
Apr 24, 2024

Conversation

Sotatek-HuyLe3a
Copy link
Collaborator

@Sotatek-HuyLe3a Sotatek-HuyLe3a commented Apr 23, 2024

log.info("<< Transaction Pruning Service Enabled >>");
}

@Scheduled(fixedRateString = "${store.transaction.pruning-interval:86400}", timeUnit = TimeUnit.MINUTES)
Copy link
Collaborator

@matiwinnetou matiwinnetou Apr 23, 2024

Choose a reason for hiding this comment

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

My suggestion is to keep the default of around 40 hours -> 36 hours for finality and 4 hours extra buffer.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So you mean we should set default is 40 hours, right?

Copy link
Member

Choose a reason for hiding this comment

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

@matiwinnetou The current default 2160 (43200 slots) blocks is taken from the protocol parameter "securityParam" as no rollback possible after this duration. We are using the same value for other stores like utxo.

But I think, the application will set their own safe slots based on application requirement.

private boolean pruningEnabled = false;

@Builder.Default
private int pruningInterval = 144000;
Copy link
Member

Choose a reason for hiding this comment

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

@Sotatek-HuyLe3a Let's keep this interval to 24hrs. 86400 sec.

private int pruningInterval = 144000;

@Builder.Default
private int pruningSafeSlot = 43200; // 2160 blocks
Copy link
Member

Choose a reason for hiding this comment

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

I think @matiwinnetou was referring to this value.
But let's keep it as it is, as we are using similar value in other stores and it's configurable.

log.info("<< Transaction Pruning Service Enabled >>");
}

@Scheduled(fixedRateString = "${store.transaction.pruning-interval:144000}", timeUnit = TimeUnit.MINUTES)
Copy link
Member

Choose a reason for hiding this comment

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

Please change the time unit to second and the default value accordingly.

@satran004 satran004 merged commit ac52aa3 into main Apr 24, 2024
1 check passed
@satran004 satran004 deleted the issue_225 branch April 24, 2024 07:15
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