feat(protocol): apply v2 first-contact PoW on NewOrder and take actions#91
Conversation
Use max(pow, pow_first_contact) for protocol DMs on v2 nodes when introducing a new trade key, mirroring the daemon spam gate. Parse optional pow_first_contact from kind 38385 and show it in the Mostro Info tab when advertised. Co-authored-by: Cursor <cursoragent@cursor.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
WalkthroughAdds Changespow_first_contact support for v2 first-contact actions
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
|
I did a strict pass on this PR and I do not currently see a correctness blocker. What I specifically checked:
This looks coherent to me. In particular, I like that the rule is not “always use So from my side this looks like a good step 8: small surface area, correct scope, and a clean mirror of the daemon’s effective PoW rule for first-contact v2 traffic. |
Summary
Protocol v2 step 8: Mostro daemons can require higher PoW for first contact from unseen trade keys (
NewOrder,TakeBuy,TakeSell). Mostrix now mirrors the daemon’smax(pow, pow_first_contact)rule on v2 outbound protocol DMs.Part of the protocol v2 NIP-44 migration (follows #90).
Changes
pow_first_contactfrom kind 38385 intoMostroInstanceInfoeffective_pow_first_contact_from_instance,is_v2_first_contact_protocol_action, andnostr_pow_for_protocol_dmsend_dmuses per-action PoW vianostr_pow_for_protocol_dminstead of basenostr_pow_from_instancePOW_AND_OUTBOUND_EVENTS.md,MESSAGE_FLOW_AND_PROTOCOL.mdSummary by CodeRabbit
New Features
Documentation