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

Create a small proposal for a execution consensus #1703

Closed
wants to merge 1 commit into from

Conversation

krhubert
Copy link
Contributor

@krhubert krhubert commented Mar 5, 2020

An updated version of execution consensus.

To be honest I'm not sure how to test it with our e2e tests.

I find a need to write a directly inside a keeper, so we reduce the testing surface in e2e tests.

@krhubert krhubert added the enhancement New feature or request label Mar 5, 2020
@krhubert krhubert added this to the next milestone Mar 5, 2020
@krhubert krhubert self-assigned this Mar 5, 2020
@krhubert krhubert force-pushed the feature/execution-consensus branch 2 times, most recently from 6510dba to e3269c4 Compare March 5, 2020 21:03
Copy link
Member

@antho1404 antho1404 left a comment

Choose a reason for hiding this comment

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

But if we do that it means that we might have an issue with the following workflow:

  • the network has 3 runners registered
  • node A creates an execution with confirmations = 2*n/3 with n the number of runners > confirmations = 2
  • node B unregister
  • node C creates the execution with the same parameter but here, n is different so > confirmations = 1.333
  • 2 different executions will be created and none of them will ever be processed

With the solution proposed in #1705, the same workflow will look like

  • the network has 3 runners registered
  • node A creates an execution (signers < 2n/3 ==> 1 < 2) > still pending execution
  • node B unregister
  • node C creates the execution (same hash), (signers > 2n/3 ==> 2 > 1.333) > execution created

Here the execution is the same and can pass.

(this minimal confirmation could be another feature that can be added and optional later where users can "discard" execution if they don't reach a minimal number of confirmations but that's a different feature.)

@@ -75,6 +75,9 @@ message CreateExecutionRequest {
string price = 10 [
(gogoproto.moretags) = 'validate:"coins"'
];

// confs is the number of conrimations the exeuction needs to have before chaingin status to passed
int64 confs = 11;
Copy link
Member

Choose a reason for hiding this comment

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

let's call that "confirmations" and fix the typo in the comment

@@ -119,4 +122,9 @@ message Execution {
int64 blockHeight = 15 [
(gogoproto.moretags) = 'hash:"-"'
];

// confs is the number of conrimations the exeuction needs to have before chaingin status to passed
int64 confs = 16 [
Copy link
Member

Choose a reason for hiding this comment

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

same here, to rename and fix typo


// confs is the number of conrimations the exeuction needs to have before chaingin status to passed
int64 confs = 16 [
(gogoproto.moretags) = 'hash:"-"'
Copy link
Member

Choose a reason for hiding this comment

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

If we add this data in the execution, then I think the confirmations should be part of the hash, 2 executions should be different if they have 2 different consensuses.

if !ctx.IsCheckTx() {
M.InProgress.Add(1)
var count int64
if exec.Confs > 0 && execExist {
Copy link
Member

Choose a reason for hiding this comment

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

don't understand why we only add the signer if the execution already exists. What happens to the first signer who actually paid more than the other because he wrote more data. This one is not added to the list and will not be rewarded for leading this execution.

@krhubert
Copy link
Contributor Author

krhubert commented Mar 6, 2020

The point of skipping the confs on hash calculation is to disable modification of this value aftre exec creation. So the two workflow won't happen, because you can't edit confs.


The execution is created by the first signer na then the confs is upadted. The exec creator is not treated as a voter because we need a confirmation from others in network.


I need to know,

who and when pays for exeuction (in case of process/runner/user)

who and when gets reward after exeuction completed/failed (in case of process/runner/user)

So the execution can be created by process (orchestrator), inside runner, or just with cli (as I see it)

@NicolasMahe
Copy link
Member

closing in favor of #1705

@NicolasMahe NicolasMahe deleted the feature/execution-consensus branch March 11, 2020 12:15
@NicolasMahe NicolasMahe removed this from the v0.20 milestone Mar 16, 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants