Skip to content

Document Acceptance Criteria for Random Beacon v2 #2665

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

Open
wants to merge 43 commits into
base: main
Choose a base branch
from

Conversation

michalinacienciala
Copy link
Contributor

The document stores User Acceptance Criteria for Random Beacon v2
feature. It will be used to gain common understanding of how Random
Beacon v2 should act and will be utilised during the acceptance testing
of the feature.

The document stores User Acceptance Criteria for Random Beacon v2
feature. It will be used to gain common understanding of how Random
Beacon v2 should act and will be utilised during the acceptance testing
of the feature.
@michalinacienciala michalinacienciala changed the title Document Acceptance Criteria fo Random Beacon v2 Document Acceptance Criteria for Random Beacon v2 Oct 19, 2021
higher, the transaction should be reverted) +
- is there at least one active signing group?

| Relay request
Copy link
Contributor Author

Choose a reason for hiding this comment

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

What about the case when relay entry is being requested during group creation?

Copy link
Member

Choose a reason for hiding this comment

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

It is possible but there is a corner case we should consider. Once group creation starts, the sortition pool is locked and remains in that state until the challenge period passes. A relay request can happen and it can be fulfilled in that time. However, if some members miss their turn during entry submission, we need to remove them from the sortition pool. Removal is not possible when the pool is locked so there is a problem here. We are trying to develop a solution here. @pdyraga and @eth-r can shed more light here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated the UACs based on what was agreed upon: e9cdc51.

Copy link
Member

Choose a reason for hiding this comment

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

The latest version is that we are not going to remove anyone from sortition pool in case of misbehavior/inactivity but we will exclude them from future rewards for some governable period of time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, so that I think is mostly in line whit what I added in that e9cdc51 commit, but I missed a couple of places where I should have do the update. Fixed in c090c77.

Some new UACs has been added to the list. Bunch of UACs has been updated
to better reflect the expected behaviour.
| If the DKG timeout notification was deemed justified, then: +
- the pool should be unlocked +
- the fixed amount reward (in T) should be sent from the maintenance pool to
the notifier.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should the members of the candidate group be punished for not producing the DKG result with 2 weeks removal from the sortition pool?

Copy link
Member

Choose a reason for hiding this comment

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

In relay entry, we punish using slashing if the timeout has been violated. However, IIRC it's not the case here. We probably won't punish for DKG timeouts (RFC doesn't mention about that as well) as they are less harmful than relay entry timeouts. @pdyraga is that correct?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, let's not punish them for now. It could happen that some operators dropped from the pool and honest ones could not produce DKG result. Being in the group and not answering calls is a serious crime. Dropping and not cooperating in DKG is less harmful to the network.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, thanks for clarification, I don't change anything here then.

It was agreed that:
"In case of a challenge we will get number of blocks that was mined until
the challange happened and use it as an offset to:
1. determine new starting block for submissions, so members start
   submitting from the first member
2. calculate new DKG timeout to give all members a chance to submit
   a result"
Copy link
Member

@lukasz-zimnoch lukasz-zimnoch left a comment

Choose a reason for hiding this comment

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

The first part, related to the relay entry.

higher, the transaction should be reverted) +
- is there at least one active signing group?

| Relay request
Copy link
Member

Choose a reason for hiding this comment

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

It is possible but there is a corner case we should consider. Once group creation starts, the sortition pool is locked and remains in that state until the challenge period passes. A relay request can happen and it can be fulfilled in that time. However, if some members miss their turn during entry submission, we need to remove them from the sortition pool. Removal is not possible when the pool is locked so there is a problem here. We are trying to develop a solution here. @pdyraga and @eth-r can shed more light here.

Copy link
Member

@lukasz-zimnoch lukasz-zimnoch left a comment

Choose a reason for hiding this comment

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

An the next part

| If the DKG timeout notification was deemed justified, then: +
- the pool should be unlocked +
- the fixed amount reward (in T) should be sent from the maintenance pool to
the notifier.
Copy link
Member

Choose a reason for hiding this comment

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

In relay entry, we punish using slashing if the timeout has been violated. However, IIRC it's not the case here. We probably won't punish for DKG timeouts (RFC doesn't mention about that as well) as they are less harmful than relay entry timeouts. @pdyraga is that correct?

@michalinacienciala michalinacienciala marked this pull request as draft December 3, 2021 10:50
@michalinacienciala michalinacienciala marked this pull request as ready for review December 7, 2021 13:48
Comment on lines 528 to 530
| Governable parameters
| The slashing amount for submitting malicious DKG result
(`maliciousDkgResultSlashingAmount`) should be a governable parameter.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure if the slashing is for submitting the result or supporting. Asked in https://github.com/keep-network/keep-core/pull/2751/files#r761879103.

aspects should be taken into account: +
- does it reference the existing DKG request? (if not, then notification
invalid) +
- has the DKG timeout passed? (if not, then notification invalid) +
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure if that condition need to be always passing.

From the Random beacon README:

DKG timeout includes the situation when no new relay entry was produced and sortition could not be performed.

That means this situation:
Somebody requested a new entry, frequency of group creation was hit, and due to that the sortition pool got locked. Then nobody published the new relay entry and we now want to unlock the pool and will do that in the DGK timeout notification.

From RFC-1 we know that:

The [DKG timeout] timer starts at the moment when the first member becomes eligible [to submit DKG result]

My understanding is that in the case I described we never start the DKG, so we can't say whether the DKG timeout has passed or not...

@michalinacienciala
Copy link
Contributor Author

UACs list updated after recent changes to the Random Bacon v2. Ready for another round of reviews.

Now that we have a set of proposed values for governable parameters in
the RandomBeacon contract, we can update the UACs.
@michalinacienciala
Copy link
Contributor Author

@tomaszslabon, I applied your propositions, also updated a couple more of parameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📖 documentation People need to know things! ⛓️ solidity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants