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: nightfall3 bec optimizations #1448

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

VishnuNarayanan3
Copy link
Collaborator

@VishnuNarayanan3 VishnuNarayanan3 commented Jul 1, 2024

What does this implement/fix? Explain your changes.

Change Filepath(s)  
Added a system to write keys to a backup file, and restore them on client bootup nightfall-client/src/services/keys.mjs , nightfall-client/src/index.mjs
CHECK_REGISTER_PROPOSER_SECOND inherited from environment variables instead of hard-coding apps/proposer/src/proposer.mjs  
checkAndChangeProposer can now be skipped by controlling an environment variable apps/proposer/src/proposer.mjs  
checkAndRegisterProposer no longer crashes the container if the call to optimist fails apps/proposer/src/proposer.mjs Added try-catch to method
Proposer container now supports hot reloading in local apps/proposer/package.jsondocker/docker-compose.apps.yml Added nodemon
Improved logging on /offchain-transaction route apps/proposer/src/proposer.mjs  
Added configuration for amoy and baseSepolia bin/config/default.js  
Infosec compliance - Forces the transitive dependency request-cookie to a version without vulnerabilities cli/package.jsoncommon-files/package.json "request": { "tough-cookie": "4.1.3" }
Infosec compliance - Removed the super user used in images docker/client.Dockerfiledocker/deployer.Dockerfile  
Client, worker and optimist now support start up on arbitrary ports that can be controlled via environment variables. This is because the loss of super-user prevents startup on protected port 80. worker/src/index.mjsnightfall-client/src/index.mjsnightfall-optimist/src/index.mjs  
Optimist container no longer crashes when mempool transactions build up over time. This is done by throttling the number of txs fetched from db at any given time, the amount can be controlled using the variable MEMPOOL_TXS_FETCH_LIMIT config/default.jsnightfall-optimist/src/services/block-assembler.mjsnightfall-optimist/src/services/database.mjs  
Logging change - The repeated “heartbeat” message in the block assembler can now be toggled via a new endpoint - /debug/toggle-heartbeat-loggingbug/toggle-heartbeat-logging nightfall-optimist/src/services/block-assembler.mjsnightfall-optimist/src/routes/debug.mjs This was primarily to simplify log anaylsis by minimizing log cluttering
Client container no longer syncs from the firstSeenBlock, but uses the lastProcessedBlock. This avoids an unnecessary delay in the bootup time of the client. nightfall-client/src/services/state-sync.mjs  
Client container no longer returns a “Bad Request” while syncing. It returns a “503 - Nf3 client is syncing” message instead. The healthcheck route has also been excluded from this to prevent k8s from considering the container unhealthy. nightfall-client/src/app.mjs  

Does this close any currently open issues?

No

What commands can I run to test the change?

curl for new debugging endpoint:

curl --location --request POST 'http://{optimistUrl}/debug/toggle-heartbeat-logging' \
--header 'Content-Type: application/json' \
--data-raw '{
    "heartBeatLogging": "false"
}'

Any other comments?

PR includes multiple changes centred around "unhappy paths" such as mempool buildup, container crashes etc. Also includes configuration changes to attempt deployment on polygon amoy and base sepolia.

@VishnuNarayanan3 VishnuNarayanan3 removed DNM Do not merge Blocked labels Jul 24, 2024
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