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

Can't add restrictions to rune #8150

Open
pabpas opened this issue Mar 7, 2025 · 3 comments
Open

Can't add restrictions to rune #8150

pabpas opened this issue Mar 7, 2025 · 3 comments

Comments

@pabpas
Copy link

pabpas commented Mar 7, 2025

Adding restrictions to runes does not work although the response suggests it has been successful.

Steps to reproduce:

$ lightning-cli createrune
{  
   "rune": "rune0"
   "unique_id": "26"
}
$ lightning-cli createrune -k "rune"="run0" "restrictions"="readonly"
{  
   "rune": "rune0restricted"
   "unique_id": "26"
}
$ lightning-cli showrunes
      {  
         "rune": "rune0"
         "unique_id": "26",
         "restrictions": [],
         "restrictions_as_english": ""
      },

It does not matter if the restriction is other than "readonly" or it already had other restrictions, new restrictions will not apply.

Running 25.02 but I think it started before, I just noticed now.

@evansmj
Copy link
Contributor

evansmj commented Mar 23, 2025

I am able to reproduce this on my old v24.11 branch as well as the latest master 25.02.

i'll try and fix this bug

{
   "rune": "r8_OEyO68k12lDMB9rko4q_RLzdfPX0U84iSWPMdtj89MA==",
   "unique_id": "0",
   "warning_unrestricted_rune": "WARNING: This rune has no restrictions! Anyone who has access to this rune could drain funds from your node. Be careful when giving this to apps that you don't trust. Consider using the restrictions parameter to only allow access to specific rpc methods."
}
(cln-meta-project-py3.10) lightning % l1-cli createrune -k "rune"="r8_OEyO68k12lDMB9rko4q_RLzdfPX0U84iSWPMdtj89MA==" "restrictions"="readonly"
{
   "rune": "9i3_o6Sl8PsYBe0UPzQS4HxQR_v7nDBEylQUsugCmH89MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl",
   "unique_id": "0"
}
(cln-meta-project-py3.10) lightning % l1-cli showrunes
{
   "runes": [
      {
         "rune": "r8_OEyO68k12lDMB9rko4q_RLzdfPX0U84iSWPMdtj89MA==",
         "unique_id": "0",
         "restrictions": [],
         "restrictions_as_english": ""
      }
   ]
}

@evansmj
Copy link
Contributor

evansmj commented Mar 26, 2025

im close to solving it, looking like a memory issue

@evansmj
Copy link
Contributor

evansmj commented Mar 31, 2025

So after more investigation, it looks like this is intended behavior. showrunes is not meant to show any derived runes. The reasoning is that other people can add restrictions to your rune that your node can't know about. But I am taking up the task to add runes that you have created to your node's database so that they show up in showrunes. Your rune0restricted should be working as intended.

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

No branches or pull requests

2 participants