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

Discontinue the chain after the snapshot height finalizes #926

Conversation

sameersubudhi
Copy link
Member

@sameersubudhi sameersubudhi commented May 6, 2024

What was the problem?

This PR resolves #924

How was it solved?

  • Update dependencies
  • Implement the ShutdownNodePlugin
  • Bump Lisk Core version
  • Update documentation
  • Set system.backup.height and update rpc.allowedMethods for the default mainnet config

How was it tested?

  • Build the app: yarn build
  • Start node with the following custom-config.json: ./bin/run start -n mainnet -c ./custom-config.json
{
	"system": {
		"backup": {
			"height": 24694375
		}
	}
}
  • Expected result:
2024-05-06T13:37:30.694Z FATAL Sameers-MBP.koepi126 application 48715 [err=Triggering node shutdown from Shutdown plugin: current height: 24694765; reason: finalized height 24694615 is greater than the given shutdown height 24694478 (snapshot height: 24694375 + buffer: 103)] System error: unhandledRejection
2024-05-06T13:37:30.694Z INFO Sameers-MBP.koepi126 application 48715 [errorCode=1 message=Triggering node shutdown from Shutdown plugin: current height: 24694765; reason: finalized height 24694615 is greater than the given shutdown height 24694478 (snapshot height: 24694375 + buffer: 103)] Application shutdown started
2024-05-06T13:37:30.694Z INFO Sameers-MBP.koepi126 engine 48715 Engine cleanup started
2024-05-06T13:37:30.694Z INFO Sameers-MBP.koepi126 engine 48715 Network cleanup started
2024-05-06T13:37:30.697Z ERROR Sameers-MBP.koepi126 engine 48715 [peerId=162.19.248.21:8001 err=Event 'rpc-request' was aborted due to a bad connection] Fail to handle received block
2024-05-06T13:37:30.697Z INFO Sameers-MBP.koepi126 engine 48715 Network cleanup completed
2024-05-06T13:37:30.700Z INFO Sameers-MBP.koepi126 engine 48715 Engine cleanup completed
2024-05-06T13:37:30.700Z INFO Sameers-MBP.koepi126 application 48715 Stopping Controller
2024-05-06T13:37:30.700Z INFO Sameers-MBP.koepi126 application 48715 Controller cleanup completed
2024-05-06T13:37:30.702Z INFO Sameers-MBP.koepi126 application 48715 [errorCode=1 message=Triggering node shutdown from Shutdown plugin: current height: 24694765; reason: finalized height 24694615 is greater than the given shutdown height 24694478 (snapshot height: 24694375 + buffer: 103)] Application shutdown completed
sameer@Sameers-MBP lisk-core % echo $?                                                                        
1

Copy link

codecov bot commented May 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.89%. Comparing base (52dc9b3) to head (292a6d8).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##           development     #926   +/-   ##
============================================
  Coverage        96.89%   96.89%           
============================================
  Files               14       14           
  Lines              258      258           
  Branches            14       14           
============================================
  Hits               250      250           
  Misses               8        8           

@sameersubudhi sameersubudhi force-pushed the 924-discontinue-the-chain-after-the-snapshot-height-finalizes branch from 474606e to b18215c Compare May 6, 2024 07:10
@sameersubudhi sameersubudhi force-pushed the 924-discontinue-the-chain-after-the-snapshot-height-finalizes branch from b18215c to 76c1dcd Compare May 6, 2024 07:16
Copy link
Member

@nagdahimanshu nagdahimanshu left a comment

Choose a reason for hiding this comment

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

Looks good and works as expected 👍

Copy link
Member

@ishantiw ishantiw left a comment

Choose a reason for hiding this comment

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

I ran the node with the changes and it works as expected. Overall approach LGTM, just a few comments.

src/application/plugins/shutdown-node/plugin.ts Outdated Show resolved Hide resolved
src/application/plugins/shutdown-node/plugin.ts Outdated Show resolved Hide resolved
src/application/plugins/shutdown-node/plugin.ts Outdated Show resolved Hide resolved
@sameersubudhi sameersubudhi force-pushed the 924-discontinue-the-chain-after-the-snapshot-height-finalizes branch from b5a9bee to 292a6d8 Compare May 6, 2024 13:34
Copy link
Member

@ishantiw ishantiw left a comment

Choose a reason for hiding this comment

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

🚀

@sameersubudhi sameersubudhi merged commit 70ff52f into development May 7, 2024
11 checks passed
@sameersubudhi sameersubudhi deleted the 924-discontinue-the-chain-after-the-snapshot-height-finalizes branch May 7, 2024 09:50
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.

Discontinue the chain after the snapshot height finalizes
3 participants