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

Rinkeby invoices when mainnet invoices are expected #2272

Closed
2 tasks
johny-b opened this issue Oct 26, 2022 · 8 comments
Closed
2 tasks

Rinkeby invoices when mainnet invoices are expected #2272

johny-b opened this issue Oct 26, 2022 · 8 comments
Labels
ray-request issue requested by Ray team

Comments

@johny-b
Copy link

johny-b commented Oct 26, 2022

WHAT HAPPENS

  1. I initialize both mainnet and rinkeby payments in yagna
  2. I create an erc20-mainnet-glm allocation
  3. I publish demand to the public-beta subnet
  4. I trade with providers who only accept mainnet payments
  5. Providers issue invoices for erc20-rinkeby-tglm payments (!)
  6. I accept the invoices using my erc20-mainnet-glm allocation (!)
  7. The amount of my mainnet GLMs stays the same. The amount of my rinkeby GLMs decreases.

HOW TO REPLICATE

  1. Install https://github.com/golemfactory/golem-api-python
  2. YAGNA_PAYMENT_NETWORK=mainnet YAGNA_SUBNET=public-beta python3 blender.py (wait for a successful finish, ctrl+c might break invoice acceptance).
  3. Observe how yagna payment status and yagna payment status --network=mainnet change

OR

Probably the same will happen in yapapi if we remove the line that sets demand_builder.properties["golem.com.payment.chosen-platform"] - although I didn't check this.

PROBLEMS

There are (at least) two separate problems here that probably should be separate issues, but I think there might be some general problem I'm missing here so they are together:

  • Why do providers send rinkeby invoices when demand specifies a mainnet allocation and also they only accept mainnet payments?
  • Why am I allowed to accept a rinkeby invoice using a mainnet allocation?
@nieznanysprawiciel
Copy link
Contributor

In https://github.com/golemfactory/yagna/blob/2f6efcd5e1e5959a05effa6192c9ae31f11d5f42/core/payment/src/models/agreement.rs line 42, yagna uses default platform if golem.com.payment.chosen-platform doesn't exist in Agreement
-> it is a bug

@johny-b
Copy link
Author

johny-b commented Nov 11, 2022

In https://github.com/golemfactory/yagna/blob/2f6efcd5e1e5959a05effa6192c9ae31f11d5f42/core/payment/src/models/agreement.rs line 42, yagna uses default platform if golem.com.payment.chosen-platform doesn't exist in Agreement -> it is a bug

Does this explain why I can accept a rinkeby invoice using a mainnet allocation?

@mateuszsrebrny
Copy link
Contributor

@nieznanysprawiciel decide please :)

@nieznanysprawiciel
Copy link
Contributor

This bug seems important.
We should do it this sprint or next.

Does this explain why I can accept a rinkeby invoice using a mainnet allocation?
Doesn't. It's separate bug

@evik42
Copy link
Contributor

evik42 commented Feb 27, 2023

might be related: #1753

@mateuszsrebrny
Copy link
Contributor

mateuszsrebrny commented Mar 22, 2023

the way I see it, there is a separate issue golemfactory/golem-core-python#18 that golem-core is not setting the property -> this is to be fixed by golem-core care takers.

but in yagna there is a bug that it sends rinkeby when the property is not set.
(and maybe that requestor accepts the invoice (not sure if this is still in yagna or in in golem-core)

@mateuszsrebrny mateuszsrebrny added the ray-request issue requested by Ray team label Mar 23, 2023
@golmek
Copy link
Contributor

golmek commented Jun 7, 2023

Summary:

When using Golem Core Python (https://github.com/golemfactory/golem-core-python) Rinkeby is used as a payment network even tough mainnet was explicitly chosen. This is due to lack of golem.com.payment.chosen-platform property in Golem Core Python and will be fixed in: golemfactory/golem-core-python#18

However, current behaviour of Yagna is prone to errors as we accept lack of golem.com.payment.chosen-platform parameter and then choose default -> Rinkeby. This results in hard to debug problems when testnets are not stable or getting deprecated (like Rinkeby). Those impact projects like Ray on Golem & Jupyter on Golem.

New approach should require this parameter and throw error when it is missing. No default path.

Acceptance Criteria:

  • Lack of golem.com.payment.chosen-platform should throw explicit error.
  • Disable default path for situation when there is no golem.com.payment.chosen-platform

@golmek
Copy link
Contributor

golmek commented Jun 27, 2023

Closing this ticket as it is not replicable anymore after Golem Core Python was fixed by @approxit .

Changes in Yagna will be performed in separate ticket: #2639

@golmek golmek closed this as not planned Won't fix, can't repro, duplicate, stale Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ray-request issue requested by Ray team
Projects
None yet
Development

No branches or pull requests

5 participants