This repository has been archived by the owner on Jun 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 359
refactor(blockchain): Minor cleanup and add safety checks. #1266
Merged
Merged
Changes from 12 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
25f11a7
bing bong
itsdevbear 7fa7794
bing bong
itsdevbear c7a36fc
bing bong
itsdevbear f31c9dc
bing bong
itsdevbear 9544b60
remove unused cache
itsdevbear 5f24220
reee
itsdevbear 5f9a6af
Merge branch 'main' into safety-checks
itsdevbear 13594da
remove unused cache
itsdevbear cb37dfa
keep receipts cache
itsdevbear 4a1b524
remove unused cache
itsdevbear 57ff739
run begin blocker in miner
itsdevbear ed2fd90
run begin blocker in miner
itsdevbear 63229e6
bing bong
itsdevbear f981084
add preblock
itsdevbear 08e11ad
add preblock
itsdevbear a3b3d43
fix comment
itsdevbear File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,8 +121,8 @@ var _ = Describe("Distribution Precompile", func() { | |
Expect(err).ToNot(HaveOccurred()) | ||
ExpectSuccessReceipt(tf.EthClient(), tx) | ||
|
||
// Wait for 2 blocks to be produced, to make sure there are rewards. | ||
for i := 0; i < 2; i++ { | ||
// Wait for 5 blocks to be produced, to make sure there are rewards. | ||
for i := 0; i < 5; i++ { | ||
Expect(tf.WaitForNextBlock()).To(Succeed()) | ||
} | ||
Comment on lines
+124
to
127
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The change from waiting for 2 blocks to 5 blocks is reasonable if it ensures that there are enough blocks produced to have rewards. However, it might increase the test execution time. If the test suite has many tests that wait for blocks, this could significantly slow down the overall test execution. Consider if there's a more efficient way to ensure that enough blocks are produced, such as by mocking or simulating block production. |
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexanderbez is this safe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't dug into the specifics of each individual method call, but since
PrepareProposal
state is discarded upon round timeout, any state modifications should be safe assuming you use the providedctx
(which it looks like you are!).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you'd like, I can dive into the individual method calls for further analysis.