ubiquity-os / permit-generation

A standalone module to generate permits.
1 stars 19 forks source link

feat: add the permit-generator github action #69

Closed hhio618 closed 1 week ago

hhio618 commented 1 month ago

Resolves #68

hhio618 commented 1 month ago

@0x4007 This task looks off to me. If there's no progress soon, I discontinue my work here on this PR.

0x4007 commented 1 month ago

Can you post QA to prove it's working

0x4007 commented 1 month ago

@whilefoo @rndquu @gentlementlegen I don't recall who worked on the NFT minting part but the tests are failing due to it, and it doesn't seem like any changes related to it were made in this pull.

hhio618 commented 1 month ago

@0x4007 QA

Workflow dispatch event: https://github.com/hhio618/permit-generation/actions/runs/11167533080/job/31043948081 Report: https://github.com/hhio618/permit-generation/issues/5

whilefoo commented 4 weeks ago

The purpose of this feature is to centralize permit generation so that we can enforce fees. All plugins should call this as an API with "permit requests."

But plugins can't call another plugin or do you mean having plugins return permit requests to the kernel and then the kernel calls permit-generation?

I think we discussed that this should be a Worker plugin because the problem Action plugin is that when we implement rollup rewards, the pay.ubq.fi backend can't call an Action plugin and get the result back, it can only call a Worker plugin but it needs the kernel's private key to sign the payload.

0x4007 commented 3 weeks ago

The purpose of this feature is to centralize permit generation so that we can enforce fees. All plugins should call this as an API with "permit requests."

But plugins can't call another plugin or do you mean having plugins return permit requests to the kernel and then the kernel calls permit-generation?

I think we discussed that this should be a Worker plugin because the problem Action plugin is that when we implement rollup rewards, the pay.ubq.fi backend can't call an Action plugin and get the result back, it can only call a Worker plugin but it needs the kernel's private key to sign the payload.

Got it that makes sense. In this case we can accept this pull and then make a new task for it to be a worker, because this pull achieves the task spec.

github-actions[bot] commented 3 weeks ago

Unlisted dependencies (1)

Filename unlisted
src/handlers/generate-erc20-permit.ts uuid
hhio618 commented 2 weeks ago

Latest QA

Github action run#11348946725

Generated output:

W3sidG9rZW5UeXBlIjoiRVJDMjAiLCJ0b2tlbkFkZHJlc3MiOiIweGU5MWQxNTNlMGI0MTUxOGEyY2U4ZGQzZDc5NDRmYTg2MzQ2M2E5N2QiLCJiZW5lZmljaWFyeSI6IjB4NjMyMTI4NkY5QjczZjQyN0M3MmUxZjlGMWJDNmIzZDI1ZUYwNjYwNSIsIm5vbmNlIjoiMTE3MTAxNzE4NTUwNjA4NTI0NzQyODgxNTg5NDQ3MzY3Mjc1ODc2MjY4Nzk0NDc5MDQwMjMwOTI5MDQzOTkyNjUxNDMzNjM4OTIyMDUiLCJkZWFkbGluZSI6IjExNTc5MjA4OTIzNzMxNjE5NTQyMzU3MDk4NTAwODY4NzkwNzg1MzI2OTk4NDY2NTY0MDU2NDAzOTQ1NzU4NDAwNzkxMzEyOTYzOTkzNSIsImFtb3VudCI6IjIwMDAwMDAwMDAwMDAwMDAwMDAwMCIsIm93bmVyIjoiMHhmMzlGZDZlNTFhYWQ4OEY2RjRjZTZhQjg4MjcyNzljZmZGYjkyMjY2Iiwic2lnbmF0dXJlIjoiMHhmM2MwNDViZTEzMTU4MTJkMmQyYmVlZDdmOGQ0YWZlOTQwODU4NTg4YTBiZTdjNjlkZWM4MWI0MThjMzkxOWExMmY2NDE5YTUxZTJkMzIyZDJhMGVjZmI2ZTkyMTdhYzBlMTcwM2RkNjhhZGE0N2ZhMzcxZTNlODQzYTRmNWQxNzFjIiwibmV0d29ya0lkIjoxMDB9XQ==
gentlementlegen commented 2 weeks ago

Technical question: I was reading the related spec and it states:

This should be the only way to generate permits in our system, so that we can enforce capturing value from plugin developers.

So it would mean that https://github.com/ubiquity-os-marketplace/text-conversation-rewards for example should be using this instead of generating permits on its own. It could eventually call this Action, but workers are not instantaneous and the end of the workflow should be awaited somewhere. In the case of a Worker that would eventually need to generate a permit, I don't see how this could be called either. Wouldn't it make more sense to have this as an endpoint? I understand this is a long running task which is why it was designed as an Action, but seems tricky to use in a real-case scenario.

0x4007 commented 2 weeks ago

I understand this is a long running task which is why it was designed as an Action, but seems tricky to use in a real-case scenario.

I dont think this needs to be long running. So it makes sense to make an API endpoint hosted on Cloudflare Workers.

hhio618 commented 2 weeks ago

Latest QA

Github action run#11379446214

Output:

W3sidG9rZW5UeXBlIjoiRVJDMjAiLCJ0b2tlbkFkZHJlc3MiOiIweGU5MWQxNTNlMGI0MTUxOGEyY2U4ZGQzZDc5NDRmYTg2MzQ2M2E5N2QiLCJiZW5lZmljaWFyeSI6IjB4NjMyMTI4NkY5QjczZjQyN0M3MmUxZjlGMWJDNmIzZDI1ZUYwNjYwNSIsIm5vbmNlIjoiNzY1OTI2OTEzNjcyMjY0NDcxNjk2NzA2NDQ1MTk2MDM0ODA3ODExMDY1Nzc2MzMxMjMwNjkyNjM5NzcyODk2NzQwMDk2MDA2Mjc0ODIiLCJkZWFkbGluZSI6IjExNTc5MjA4OTIzNzMxNjE5NTQyMzU3MDk4NTAwODY4NzkwNzg1MzI2OTk4NDY2NTY0MDU2NDAzOTQ1NzU4NDAwNzkxMzEyOTYzOTkzNSIsImFtb3VudCI6IjIwMDAwMDAwMDAwMDAwMDAwMDAwMCIsIm93bmVyIjoiMHhmMzlGZDZlNTFhYWQ4OEY2RjRjZTZhQjg4MjcyNzljZmZGYjkyMjY2Iiwic2lnbmF0dXJlIjoiMHhiNmY2NjA5YjRiOGI4ZjViMjYwZDRhODc4ZmIyY2FlYzk2MjMwZWJmNDlmZmVhZjVkNzZkNDRiMjYxYmZhZjM1MjUxYzIxM2RkNTdhNmFhMjU1MDlhMGUwZmQxYTcxNDBjOTcyOTVjM2U0MDk4YzYzZjE0ZWVlZjhjYjc3NzQ2YTFjIiwibmV0d29ya0lkIjoxMDB9XQ==
0x4007 commented 2 weeks ago

What about the footer config code?

rndquu commented 2 weeks ago

I think in order to save time we should:

  1. Close this PR (because many changes are incompatible with the cloudflare worker code)
  2. Close https://github.com/ubiquity-os/permit-generation/issues/68 as completed
  3. Proceed straight to https://github.com/ubiquity-os/permit-generation/issues/92
rndquu commented 2 weeks ago

What about the footer config code?

The actual comment is posted via https://github.com/ubiquity-os-marketplace/text-conversation-rewards, https://github.com/ubiquity-os/permit-generation is responsible solely for permits

hhio618 commented 1 week ago

What about the footer config code?

Could you please provide more details or specifications for this task?

0x4007 commented 1 week ago

It's in the middle of the spec. But maybe it makes sense to scope this for only the reward amounts to be returned