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

Derive Block from Hare Output Set #2906

Closed
Tracked by #100
noamnelke opened this issue Oct 31, 2021 · 0 comments
Closed
Tracked by #100

Derive Block from Hare Output Set #2906

noamnelke opened this issue Oct 31, 2021 · 0 comments

Comments

@noamnelke
Copy link
Member

When the Hare completes we'll now want to generate a Block and store it in a separate database.

We'll use the same mechanism we use today to create a list of ordered transactions (mesh.extractUniqueOrderedTransactions()), to generate a Block. In addition to an ordered list of transactions, a block should contain a list of rewards. This should be derived from the list of smeshers that authored the proposals that the Hare agreed on. For each smesher we'll find the coinbase address in the relevant ATX and add a reward proportional to the number of proposals/ballots authored by them and included in the Hare output set.

Blocks should be persisted to a BlockDB. When the node calculates a block from Hare results, it should also store a value in a layer -> block index in the same database. To be explicit - we should NOT store a value in this index if we add a block to the database because we've synced it or fetched it from a peer, only when we've created it ourselves based on Hare results.

bors bot pushed a commit that referenced this issue Dec 23, 2021
## Motivation
<!-- Please mention the issue fixed by this PR or detailed motivation -->
1st PR for #2906
<!-- `Closes #XXXX, closes #XXXX, ...` links mentioned issues to this PR and automatically closes them when this it's merged -->

## Changes
<!-- Please describe in detail the changes made -->
- add a temporary struct UCBlock. this will be renamed to Block in a later PR
- add block data handler when fetching from peers
- add block generator that generate a block from a list of proposals

## Test Plan
<!-- Please specify how these changes were tested 
(e.g. unit tests, manual testing, etc.) -->
unit tests

## DevOps Notes
<!-- Please uncheck these items as applicable to make DevOps aware of changes that may affect releases -->
- [x] This PR does not require configuration changes (e.g., environment variables, GitHub secrets, VM resources)
- [x] This PR does not affect public APIs
- [x] This PR does not rely on a new version of external services (PoET, elasticsearch, etc.)
- [x] This PR does not make changes to log messages (which monitoring infrastructure may rely on)
bors bot pushed a commit that referenced this issue Dec 23, 2021
## Motivation
<!-- Please mention the issue fixed by this PR or detailed motivation -->
1st PR for #2906
<!-- `Closes #XXXX, closes #XXXX, ...` links mentioned issues to this PR and automatically closes them when this it's merged -->

## Changes
<!-- Please describe in detail the changes made -->
- add a temporary struct UCBlock. this will be renamed to Block in a later PR
- add block data handler when fetching from peers
- add block generator that generate a block from a list of proposals

## Test Plan
<!-- Please specify how these changes were tested 
(e.g. unit tests, manual testing, etc.) -->
unit tests

## DevOps Notes
<!-- Please uncheck these items as applicable to make DevOps aware of changes that may affect releases -->
- [x] This PR does not require configuration changes (e.g., environment variables, GitHub secrets, VM resources)
- [x] This PR does not affect public APIs
- [x] This PR does not rely on a new version of external services (PoET, elasticsearch, etc.)
- [x] This PR does not make changes to log messages (which monitoring infrastructure may rely on)
bors bot pushed a commit that referenced this issue Dec 28, 2021
## Motivation
<!-- Please mention the issue fixed by this PR or detailed motivation -->
2nd PR for #2906
Closes #2669
<!-- `Closes #XXXX, closes #XXXX, ...` links mentioned issues to this PR and automatically closes them when this it's merged -->

## Changes
<!-- Please describe in detail the changes made -->
- add proposal db outside of mesh to prepare for next PR
- update some mesh method names to reflect recent code change 

## Test Plan
<!-- Please specify how these changes were tested 
(e.g. unit tests, manual testing, etc.) -->
unit test

## DevOps Notes
<!-- Please uncheck these items as applicable to make DevOps aware of changes that may affect releases -->
- [x] This PR does not require configuration changes (e.g., environment variables, GitHub secrets, VM resources)
- [x] This PR does not affect public APIs
- [x] This PR does not rely on a new version of external services (PoET, elasticsearch, etc.)
- [x] This PR does not make changes to log messages (which monitoring infrastructure may rely on)
bors bot pushed a commit that referenced this issue Dec 29, 2021
## Motivation
<!-- Please mention the issue fixed by this PR or detailed motivation -->
2nd PR for #2906
Closes #2669
<!-- `Closes #XXXX, closes #XXXX, ...` links mentioned issues to this PR and automatically closes them when this it's merged -->

## Changes
<!-- Please describe in detail the changes made -->
- add proposal db outside of mesh to prepare for next PR
- update some mesh method names to reflect recent code change 

## Test Plan
<!-- Please specify how these changes were tested 
(e.g. unit tests, manual testing, etc.) -->
unit test

## DevOps Notes
<!-- Please uncheck these items as applicable to make DevOps aware of changes that may affect releases -->
- [x] This PR does not require configuration changes (e.g., environment variables, GitHub secrets, VM resources)
- [x] This PR does not affect public APIs
- [x] This PR does not rely on a new version of external services (PoET, elasticsearch, etc.)
- [x] This PR does not make changes to log messages (which monitoring infrastructure may rely on)
bors bot pushed a commit that referenced this issue Dec 29, 2021
## Motivation
<!-- Please mention the issue fixed by this PR or detailed motivation -->
2nd PR for #2906
Closes #2669
<!-- `Closes #XXXX, closes #XXXX, ...` links mentioned issues to this PR and automatically closes them when this it's merged -->

## Changes
<!-- Please describe in detail the changes made -->
- add proposal db outside of mesh to prepare for next PR
- update some mesh method names to reflect recent code change 

## Test Plan
<!-- Please specify how these changes were tested 
(e.g. unit tests, manual testing, etc.) -->
unit test

## DevOps Notes
<!-- Please uncheck these items as applicable to make DevOps aware of changes that may affect releases -->
- [x] This PR does not require configuration changes (e.g., environment variables, GitHub secrets, VM resources)
- [x] This PR does not affect public APIs
- [x] This PR does not rely on a new version of external services (PoET, elasticsearch, etc.)
- [x] This PR does not make changes to log messages (which monitoring infrastructure may rely on)
bors bot pushed a commit that referenced this issue Dec 29, 2021
## Motivation
<!-- Please mention the issue fixed by this PR or detailed motivation -->
2nd PR for #2906
Closes #2669
<!-- `Closes #XXXX, closes #XXXX, ...` links mentioned issues to this PR and automatically closes them when this it's merged -->

## Changes
<!-- Please describe in detail the changes made -->
- add proposal db outside of mesh to prepare for next PR
- update some mesh method names to reflect recent code change 

## Test Plan
<!-- Please specify how these changes were tested 
(e.g. unit tests, manual testing, etc.) -->
unit test

## DevOps Notes
<!-- Please uncheck these items as applicable to make DevOps aware of changes that may affect releases -->
- [x] This PR does not require configuration changes (e.g., environment variables, GitHub secrets, VM resources)
- [x] This PR does not affect public APIs
- [x] This PR does not rely on a new version of external services (PoET, elasticsearch, etc.)
- [x] This PR does not make changes to log messages (which monitoring infrastructure may rely on)
bors bot pushed a commit that referenced this issue Dec 29, 2021
## Motivation
<!-- Please mention the issue fixed by this PR or detailed motivation -->
2nd PR for #2906
Closes #2669
<!-- `Closes #XXXX, closes #XXXX, ...` links mentioned issues to this PR and automatically closes them when this it's merged -->

## Changes
<!-- Please describe in detail the changes made -->
- add proposal db outside of mesh to prepare for next PR
- update some mesh method names to reflect recent code change 

## Test Plan
<!-- Please specify how these changes were tested 
(e.g. unit tests, manual testing, etc.) -->
unit test

## DevOps Notes
<!-- Please uncheck these items as applicable to make DevOps aware of changes that may affect releases -->
- [x] This PR does not require configuration changes (e.g., environment variables, GitHub secrets, VM resources)
- [x] This PR does not affect public APIs
- [x] This PR does not rely on a new version of external services (PoET, elasticsearch, etc.)
- [x] This PR does not make changes to log messages (which monitoring infrastructure may rely on)
@bors bors bot closed this as completed in 6e6c802 Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant