-
Notifications
You must be signed in to change notification settings - Fork 5
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
BLUE-276 Restrict first node selection based on the specified node ip and port #85
Conversation
PR Reviewer Guide 🔍(Review updated until commit 84deacd)
|
src/Config.ts
Outdated
restrictFirstNodeSelection: true, | ||
firstNodeInfo: { | ||
IP: '127.0.0.1', | ||
PORT: 4000, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldnt the default port be 9001? 4000 is the port of the archiver
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@urnotsam good catch on that. changed it to 9001 now.
@@ -93,16 +94,22 @@ export function registerRoutes(server: FastifyInstance<Server, IncomingMessage, | |||
reply.send({ success: false, error: 'Signature verification failed' }) | |||
return | |||
} | |||
const ip = signedFirstNodeInfo.nodeInfo.externalIp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if ip in payload will be different from actual ip of the sender ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The IP and Port are not even being checked in here are they? The title of this PR says restricted based off IP and Port, but I only see the public key being checked.
@mhanson-github @jairajdev
… node based on public key
return | ||
} | ||
if (signedFirstNodeInfo.nodeInfo.publicKey !== signedFirstNodeInfo.sign.owner) { | ||
Logger.mainLogger.error('nodeInfo.publicKey does not match signature owner', signedFirstNodeInfo) |
Check warning
Code scanning / CodeQL
Log injection Medium
user-provided value
} | ||
if (config.restrictFirstNodeSelectionByPublicKey) { | ||
if (config.firstNodeInfo.PUBLIC_KEY !== '' && publicKey !== config.firstNodeInfo.PUBLIC_KEY) { | ||
Logger.mainLogger.error('Invalid publicKey of first node info', signedFirstNodeInfo) |
Check warning
Code scanning / CodeQL
Log injection Medium
user-provided value
84deacd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I approve my own .patch file changes.
@CodiumAI-Agent /describe |
/review |
Title(Describe updated until commit 84deacd)BLUE-276 Restrict first node selection based on the specified node ip and port PR Typeenhancement, bug fix Description
Changes walkthrough 📝
|
Persistent review updated to latest commit 84deacd |
@@ -184,6 +186,8 @@ let config: Config = { | |||
txCronSchedule: '*/5 * * * *', | |||
}, | |||
workerProcessesDebugLog: false, | |||
restrictFirstNodeSelectionByPublicKey: false, | |||
firstNodePublicKey: '', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be an environment variable? When and how does this get set?
No description provided.