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

Much quieter replays #1713

Merged
merged 13 commits into from
Aug 3, 2023
Merged

Much quieter replays #1713

merged 13 commits into from
Aug 3, 2023

Conversation

edmundnoble
Copy link
Contributor

@edmundnoble edmundnoble commented Jul 29, 2023

Silences non-Error messages from Pact during replays and lets the module cache stop cleaning itself up when it's already clean.


@edmundnoble
Copy link
Contributor Author

Test failures on no-freeze-file builds are caused by new hashable, which changes the hash values. Updating the freeze file and --accepting the changes.

@edmundnoble
Copy link
Contributor Author

Reverting in case this causes a problem.

@larskuhtz
Copy link
Contributor

Arrg, updating hashable should not cause pact validation failures. With aeson-2 stuff merged, this should be a thing of the past. We should create an issue for investigating this.

@@ -1155,7 +1155,7 @@ fatal e = do
rk <- view txRequestKey

logError_ l
$! "critical transaction failure: "
$ "critical transaction failure: "
Copy link
Member

Choose a reason for hiding this comment

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

What's the reason for undoing the bangs

Copy link
Contributor Author

@edmundnoble edmundnoble Aug 1, 2023

Choose a reason for hiding this comment

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

Loggers are always strict, so the bangs aren't necessary... except that they're lazy when they're filtered such that the log message never makes it to the queue. I've seen some pretty big log messages here, so I'd like those not constructed in case that can raise throughput.

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, log messages are deep forced before added to the queue.

Avoiding construction when their log level is disabled is a good point.

Comment on lines 155 to 157
-- Validate hashes if not doing a replay. no need to re-validate hashes
-- during a replay, because these blocks have already been validated
view psReplaying >>= \x -> unless x $
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this correct? During replay we need to compare the payload hash from the pact validation with the payload hash that is stored in the block header.

I guess the best would be to always check. IIRC it means to do one additional rocksdb lookup (which most likely is cached already). During replay we have to do it anyways. And in normal consensus operation the overhead would be minimal. So, it should be fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm probably just confused here. I'll just make it always check.

withSilentLoggerForReplays f = do
replaying <- view psReplaying
logger <- view psLogger
if replaying then L.withLoggerLevel L.Error logger f
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if this is too broad. This would also suppress unrelated legitimate warnings logs -- assuming that those could exist.

Copy link
Contributor Author

@edmundnoble edmundnoble Aug 1, 2023

Choose a reason for hiding this comment

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

It's possible. Not sure. I think with replays we only end up actually caring about errors. We haven't even really seen warnings, if they are there, because they're buried by the Pact warnings.

Comment on lines +289 to +290
-- this can't go in Chainweb.Version.Guards because it causes an import cycle
-- it uses genesisHeight which is from BlockHeader which imports Guards
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to move genesisHeight to a different place instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably would cause a cycle. I tried it during recordification.

@edmundnoble
Copy link
Contributor Author

Tested on personal node and CI, it's much quieter.

Comment on lines +154 to +155
either throwM (void . return) $
validateHashes currHeader plData miner results
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@larskuhtz larskuhtz merged commit 14bc4e7 into master Aug 3, 2023
26 checks passed
@larskuhtz larskuhtz deleted the edmund/silent-replays branch August 3, 2023 21:31
imalsogreg pushed a commit that referenced this pull request Aug 24, 2023
* silent replays.... shhhhh

* Lazier logging

* Enable psReplaying flag when we replay, not when we don't

* hashable 1.4.3.0

* Revert "hashable 1.4.3.0"

This reverts commit 166adac.

* Always validate hashes

---------

Co-authored-by: chessai <[email protected]>
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.

4 participants