feat(dashmate): add Tenderdash 1.6 allowlistOnly option#3067
feat(dashmate): add Tenderdash 1.6 allowlistOnly option#3067
Conversation
📝 WalkthroughWalkthroughAdded a tenderdash p2p Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@packages/dashmate/src/config/configJsonSchema.js`:
- Around line 1076-1078: The schema defines tenderdash.p2p.allowlistOnly but it
is missing from the tenderdash.p2p.required array; update the JSON Schema by
adding "allowlistOnly" to the required array for tenderdash.p2p so the property
is treated consistently with other p2p fields (locate the tenderdash.p2p object
and its required array near the existing properties and include the string
"allowlistOnly" there).
🧹 Nitpick comments (2)
packages/dashmate/configs/defaults/getBaseConfigFactory.js (1)
344-348: Indentation:imageshould be nested insidedocker.Line 347's
imageproperty is at the same indentation level asdockeron Line 346, rather than being indented 2 spaces inside thedocker: { }block. While JavaScript doesn't enforce indentation in object literals, this inconsistency hurts readability and violates the 2-space indent guideline.🔧 Fix indentation
- tenderdash: { - mode: 'full', - docker: { - image: 'dashpay/tenderdash:1.6-dev', - }, + tenderdash: { + mode: 'full', + docker: { + image: 'dashpay/tenderdash:1.6-dev', + },As per coding guidelines,
**/*.{js,jsx,ts,tsx}: Use 2-space indent for JS/TS files.packages/dashmate/configs/getConfigFileMigrationsFactory.js (1)
1401-1420: Migration logic follows established patterns — LGTM.The optional chaining guards,
typeof === 'undefined'check, andgetDefaultConfigByNameOrGroupusage are all consistent with existing migrations in this file.One note: the migration key is
'3.1.0'(a release version), but the PR targetsv3.1-devand the Tenderdash image is1.6-dev. Other in-development migrations use a-dev.Nsuffix (e.g.,'2.1.0-dev.1'). If more migrations are expected before the 3.1.0 release, consider renaming this to'3.1.0-dev.1'to leave room for additional ordered migrations.
| allowlistOnly: { | ||
| type: 'boolean', | ||
| }, |
There was a problem hiding this comment.
allowlistOnly is not in the required array for p2p.
Every other property in tenderdash.p2p is listed in required (Line 1103), but allowlistOnly is missing. Since the 3.1.0 migration backfills this field and the base default config always includes it, all configs will have this property after migration. Consider adding it to required for consistency.
🔧 Proposed fix
- required: ['host', 'port', 'persistentPeers', 'seeds', 'flushThrottleTimeout', 'maxPacketMsgPayloadSize', 'sendRate', 'recvRate', 'maxConnections', 'maxOutgoingConnections'],
+ required: ['host', 'port', 'persistentPeers', 'seeds', 'allowlistOnly', 'flushThrottleTimeout', 'maxPacketMsgPayloadSize', 'sendRate', 'recvRate', 'maxConnections', 'maxOutgoingConnections'],Also applies to: 1103-1104
🤖 Prompt for AI Agents
In `@packages/dashmate/src/config/configJsonSchema.js` around lines 1076 - 1078,
The schema defines tenderdash.p2p.allowlistOnly but it is missing from the
tenderdash.p2p.required array; update the JSON Schema by adding "allowlistOnly"
to the required array for tenderdash.p2p so the property is treated consistently
with other p2p fields (locate the tenderdash.p2p object and its required array
near the existing properties and include the string "allowlistOnly" there).
Issue being fixed or feature implemented
Add dashmate support for Tenderdash PR #1248 (P2P allowlist-only mode) and update default Tenderdash image to
1.6-devso configs can use the new feature.What was done?
platform.drive.tenderdash.p2p.allowlistOnlyto base defaults and schema.allowlist-onlyin Tenderdashconfig.tomltemplate.allowlistOnlyand updateplatform.drive.tenderdash.docker.imageto the new default.dashpay/tenderdash:1.6-dev.How Has This Been Tested?
Not run locally.
Breaking Changes
None.
Checklist:
For repository code-owners and collaborators only
If you want, I can tailor the “Issue” section to a specific ticket or add test details if you run any.
Summary by CodeRabbit
New Features
Chores
Documentation