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

Add min price for execution #1691

Merged
merged 11 commits into from
Mar 2, 2020
Merged

Add min price for execution #1691

merged 11 commits into from
Mar 2, 2020

Conversation

antho1404
Copy link
Member

Right now an execution can be created with 0 tokens.

I added the support of a minimum that is set for now to 10000atto. This parameter is part of the module and present in the genesis.
I also added a config to have a default price from the clients (api/orchestrator)

The good thing of having this parameter in the genesis is that we could do some vote to change this limit and we can play with proposal/votes.

@antho1404 antho1404 added the enhancement New feature or request label Feb 28, 2020
@antho1404 antho1404 requested review from NicolasMahe and krhubert and removed request for NicolasMahe February 28, 2020 06:29
@antho1404 antho1404 self-assigned this Feb 28, 2020
@krhubert
Copy link
Contributor

Why this should be set globally? I think that value should be set by service creator (or even voting by service creator and runners). What do you think?

@antho1404
Copy link
Member Author

Totally agree that the service creator/runner should set the price, this is just a min value that can later be set to 0 if necessary but the main goal here is to be able to actually see this economy. For now, everything is ready for it but we still accept free executions.

Copy link
Member

@NicolasMahe NicolasMahe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you test to change the parameter on a running blockchain?

x/execution/internal/types/params.go Outdated Show resolved Hide resolved
x/execution/internal/keeper/params.go Outdated Show resolved Hide resolved
Copy link
Member

@NicolasMahe NicolasMahe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about also putting the var runnerShare = sdk.NewDecWithPrec(9, 1) in params?

@NicolasMahe NicolasMahe added this to the next milestone Feb 28, 2020
@NicolasMahe NicolasMahe added the release:add Pull requests that add something label Feb 28, 2020
@antho1404
Copy link
Member Author

what about also putting the var runnerShare = sdk.NewDecWithPrec(9, 1) in params?

Didn't want to change this on this PR but yes definitely something that we could add later.

@NicolasMahe
Copy link
Member

NicolasMahe commented Mar 2, 2020

The errors are pretty bad:
from the cli:

➜  engine git:(feature/default-exec-price) ✗ mesg-cli service:execute 9pifx2Hxq9sbJdhDRMKy2hevt9d7d2JbLiyJ6zsSSYEM task1 --data msg=Hello
 ›   Error: 2 UNKNOWN: transaction returned with invalid code 11

from the engine's logs

INFO[0140] Rejected bad transaction                      err="<nil>" module=mempool peerID= res="&{code:11 log:\"out of gas: out of gas in location: ReadFlat; gasWanted: 22261, gasUsed: 23058\" gas_wanted:22261 gas_used:23058 codespace:\"sdk\" }" tx=8D9DC7D6633960456FC0D71A3B131B5D68CC566574D2289D1E32F77F9A5EE4BC
ERRO[0140] finished unary call with code Unknown         error="transaction returned with invalid code 11" grpc.code=Unknown grpc.method=Create grpc.service=mesg.api.Execution grpc.start_time="2020-03-02T05:11:26Z" grpc.time_ms=2.777 module=grpc span.kind=server system=grpc

we really need to improve the returned error but not blocking for this PR

@NicolasMahe NicolasMahe merged commit 593c4cd into dev Mar 2, 2020
@NicolasMahe NicolasMahe deleted the feature/default-exec-price branch March 2, 2020 10:35
@NicolasMahe NicolasMahe mentioned this pull request Mar 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request release:add Pull requests that add something
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants