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

Generate unique beacon per each fake EC tipset #752

Merged
merged 1 commit into from
Nov 21, 2024

Conversation

masih
Copy link
Member

@masih masih commented Nov 21, 2024

Generate a unique bacon per each tipset created by fake ec for better testing.

@masih masih requested a review from Kubuxu November 21, 2024 17:25
Generate a unique bacon per each tipset created by fake ec for better
testing.
Copy link

codecov bot commented Nov 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.32%. Comparing base (473ad59) to head (6d150a3).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #752      +/-   ##
==========================================
- Coverage   69.58%   69.32%   -0.27%     
==========================================
  Files          74       74              
  Lines        7497     7494       -3     
==========================================
- Hits         5217     5195      -22     
- Misses       1868     1885      +17     
- Partials      412      414       +2     
Files with missing lines Coverage Δ
internal/consensus/fake_ec.go 88.88% <100.00%> (+1.13%) ⬆️

... and 3 files with indirect coverage changes

---- 🚨 Try these New Features:

@masih masih added this pull request to the merge queue Nov 21, 2024
Merged via the queue into main with commit c2f99cf Nov 21, 2024
13 checks passed
@masih masih deleted the masih/fake-ec-tipset-beacon branch November 21, 2024 20:43
@@ -159,15 +145,22 @@ func (ec *FakeEC) genTipset(epoch int64) *tipset {
tsk = append(tsk, cidPrefixBytes...)
tsk = append(tsk, digest...)
}

h.Reset()
h.Write([]byte(fmt.Sprintf("beacon %d", epoch)))
Copy link
Contributor

Choose a reason for hiding this comment

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

I would make it dependant on seed but not critical and for sure better than it was.

Copy link
Member Author

Choose a reason for hiding this comment

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

The hasher h is keyed by seed already. That should do it right?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ahh, you are probably right. I forgot that we have a keyed hasher.

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 this pull request may close these issues.

3 participants