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 the genesis hash to Transaction<T> #796

Closed
dahlia opened this issue Feb 17, 2020 · 3 comments · Fixed by #878
Closed

Add the genesis hash to Transaction<T> #796

dahlia opened this issue Feb 17, 2020 · 3 comments · Fixed by #878
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed suggestion Suggestion or feature request

Comments

@dahlia
Copy link
Contributor

dahlia commented Feb 17, 2020

In order to prevent inapplicable transactions (made for a different network) polluting the network, I suggest to add Transaction<T>.GenesisHash property.

@dahlia dahlia added suggestion Suggestion or feature request good first issue Good for newcomers labels Feb 17, 2020
@stale
Copy link

stale bot commented Apr 17, 2020

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

@stale stale bot added the stale The issue is stale label Apr 17, 2020
@dahlia dahlia removed the stale The issue is stale label Apr 17, 2020
@longfin longfin added the help wanted Extra attention is needed label May 4, 2020
@dahlia
Copy link
Contributor Author

dahlia commented May 18, 2020

(See also the discussion from the Discord in Korean.)

There is a corner case where transactions belonging to a genesis block cannot determine its belonging genesis block hash. Two ways to solve this:

  1. Transaction<T>.GenesisHash be optional (i.e., HashDigest<SHA256>? instead of HashDigest<SHA256>), and if and only if a transaction belongs to a genesis block the field can be null.
  2. Disallow genesis blocks to have any transactions.

Personally I prefer the first way. Any ideas? /cc @planetarium/libplanet @limebell

@limebell
Copy link
Member

Since genesis block may contain initial data, first way looks better to me too. I'll try to work on this issue based on this idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed suggestion Suggestion or feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants