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: stop events listener when postage contract is paused #4748

Merged
merged 4 commits into from
Aug 4, 2024

Conversation

martinconic
Copy link
Contributor

Checklist

  • I have read the coding guide.
  • My change requires a documentation update, and I have done it.
  • I have added tests to cover my changes.
  • I have filled out the description and linked the related issues.

Description

Stop events listener when staking contract is paused

@martinconic martinconic requested a review from istae August 2, 2024 07:08
pkg/node/node.go Outdated

paused, err := stakingContract.Paused(ctx)
if paused && err == nil {
logger.Info("Staking contract is paused.")
Copy link
Member

Choose a reason for hiding this comment

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

Missing err handling from the Paused() call
Also if the contract is paused, then the node should not start, so an error must be returned here

@istae
Copy link
Member

istae commented Aug 2, 2024

title should be postage contract

@martinconic martinconic changed the title feat: stop events listener when staking contract is paused feat: stop events listener when postage contract is paused Aug 2, 2024
@martinconic martinconic marked this pull request as ready for review August 2, 2024 14:22
@martinconic martinconic requested review from istae and acha-bill August 2, 2024 14:22
@@ -172,6 +174,9 @@ func (l *listener) processEvent(e types.Log, updater postage.EventUpdater) error
c.Price,
e.TxHash,
)
case l.pausedTopic:
l.logger.Warning("Staking contract is paused.")
Copy link
Member

Choose a reason for hiding this comment

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

Wrong log

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch

@martinconic martinconic requested a review from istae August 3, 2024 11:17
@martinconic martinconic requested a review from janos August 4, 2024 19:50
@martinconic martinconic merged commit 6744499 into master Aug 4, 2024
14 checks passed
@martinconic martinconic deleted the feat/pause-events-listener branch August 4, 2024 21:21
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