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

Type mismatch present in the ShelleyMA/Shelley formal specs when calculating the stake relation in the Rewards and the Epoch Boundary #2174

Closed
yellowtides opened this issue Mar 8, 2021 · 1 comment

Comments

@yellowtides
Copy link

Screenshot 2021-03-08 at 15 06 52

In figure 7 of the ShelleyMA formal spec, in the calculation of the stake relation, there seems to be a composition performed between stakeCred_r^{-1} and rewards.

Screenshot 2021-03-08 at 15 10 34

In figure 5 of the Shelley formal spec, we see that stakeCred_r is a map from Addr to Cred. This would imply that stakeCred_r^{-1} is a map from Cred to Addr.

Screenshot 2021-03-08 at 15 13 01

In figure 21 of the Shelley formal spec, we see that rewards is a map from Cred to Coin.

Since this is the case (and that we define the composition of two maps, one of type A -> B, and the other B -> C as a resulting map of type A -> C), it would not make sense to compose stakeCred_r^{-1} (which is of type Cred -> Addr) with rewards (which is of type Cred -> Coin). This composition (and mismatch) seems to also be present in the Shelley spec.

The executable spec seems to be implementing the stake relation calculation correctly, ignoring stakeCred_r^{-1} (and the composition) entirely, unionising the left side with just the rewards.

@yellowtides yellowtides changed the title Type mismatch present in the ShelleyMA/Shelley formal specs when calculating the stake relation for the reward distribution Type mismatch present in the ShelleyMA/Shelley formal specs when calculating the stake relation for the stake distribution Mar 8, 2021
@yellowtides yellowtides changed the title Type mismatch present in the ShelleyMA/Shelley formal specs when calculating the stake relation for the stake distribution Type mismatch present in the ShelleyMA/Shelley formal specs when calculating the stake relation in the Rewards and the Epoch Boundary Mar 8, 2021
JaredCorduan pushed a commit that referenced this issue Jun 16, 2021
The reward mapping does not have keys that are wrapped in the stake
address constructor.

See github issue #2174
@JaredCorduan
Copy link
Contributor

closed by #2341

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants