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

More spec-compliant handling of unknown fields in REST json #3647

Merged
merged 2 commits into from May 20, 2022

Conversation

zah
Copy link
Member

@zah zah commented May 20, 2022

No description provided.

@zah zah requested review from arnetheduck and cheatfate May 20, 2022 11:23
@@ -694,7 +722,7 @@ proc readValue*[BlockType: Web3SignerForkedBeaconBlock|ForkedBeaconBlock](
"ForkedBeaconBlock")
data = some(reader.readValue(JsonString))
else:
reader.raiseUnexpectedField(fieldName, "ForkedBeaconBlock")
unrecognizedFieldWarning()
Copy link
Member

Choose a reason for hiding this comment

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

this will get noisy with lists - ie a list with 100k blocks during sync will result in 100k warning logs - the fact that an unrecognised field was hit should instead be passed up to the caller that can take appropriate action

Copy link
Member

@arnetheduck arnetheduck left a comment

Choose a reason for hiding this comment

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

lgtm, except that serializers must never log (it's not the right layer for it)

@zah
Copy link
Member Author

zah commented May 20, 2022

I can imagine an API for notifying the caller, but implementing something like this would be a larger development effort. For this hotfix, we can either disable this warning (silently ignoring the fields) or we can assume that these warnings won't be encountered in practice (they can arise only when using the REST API, so the potential excessive output shouldn't be a security concern).

@zah
Copy link
Member Author

zah commented May 20, 2022

I've changed the warning to debug for now and added some TODO comments:
a7f37ce

@arnetheduck
Copy link
Member

we can either disable this warning

I would tend towards complete disabling (or trace): we run debug on pretty much all servers and logging in serializers has a tendency to blow up - ie if an attestation gets logged, that's 128 logs per block etc - it's really bad if it happens.

@github-actions
Copy link

Unit Test Results

     12 files  ±0     842 suites  ±0   52m 2s ⏱️ + 3m 15s
1 693 tests ±0  1 645 ✔️ ±0    48 💤 ±0  0 ±0 
9 853 runs  ±0  9 741 ✔️ ±0  112 💤 ±0  0 ±0 

Results for commit a7f37ce. ± Comparison against base commit 50e8415.

@zah zah merged commit 68fb396 into stable May 20, 2022
@zah zah deleted the prysm-checkpoint-sync-hotfix branch May 20, 2022 15:25
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.

None yet

2 participants