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

Fuzz testing on all binary decoding for LLO #15476

Merged
merged 4 commits into from
Dec 2, 2024
Merged

Fuzz testing on all binary decoding for LLO #15476

merged 4 commits into from
Dec 2, 2024

Conversation

samsondav
Copy link
Collaborator

  • Fuzz testing on ReportCodecPremiumLegacy.Decode
  • Fuzz on PluginScopedRetirementReportCache_CheckAttestedRetirementReport

Requires

Supports

@samsondav samsondav requested review from a team as code owners December 2, 2024 15:19
Copy link
Contributor

github-actions bot commented Dec 2, 2024

AER Report: CI Core ran successfully ✅

aer_workflow , commit

AER Report: Operator UI CI ran successfully ✅

aer_workflow , commit

@samsondav samsondav requested a review from a team as a code owner December 2, 2024 15:36
Copy link
Contributor

github-actions bot commented Dec 2, 2024

I see you updated files related to core. Please run pnpm changeset in the root directory to add a changeset as well as in the text include at least one of the following tags:

  • #added For any new functionality added.
  • #breaking_change For any functionality that requires manual action for the node to boot.
  • #bugfix For bug fixes.
  • #changed For any change to the existing functionality.
  • #db_update For any feature that introduces updates to database schema.
  • #deprecation_notice For any upcoming deprecation functionality.
  • #internal For changesets that need to be excluded from the final changelog.
  • #nops For any feature that is NOP facing and needs to be in the official Release Notes for the release.
  • #removed For any functionality/config that is removed.
  • #updated For any functionality that is updated.
  • #wip For any change that is not ready yet and external communication about it should be held off till it is feature complete.

jmank88
jmank88 previously approved these changes Dec 2, 2024
f.Add(validEncodedReport)

f.Fuzz(func(t *testing.T, data []byte) {
codec.Decode(data) //nolint:errcheck // test that it doesn't panic, don't care about errors
Copy link
Contributor

@jmank88 jmank88 Dec 2, 2024

Choose a reason for hiding this comment

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

Another angle that could be fuzzed is whether the decoded data re-encodes, and as the same bytes:

Suggested change
codec.Decode(data) //nolint:errcheck // test that it doesn't panic, don't care about errors
decoded, err := codec.Decode(data) //nolint:errcheck // test that it doesn't panic, don't care about errors
if err != nil {
reEncoded, err := codec.Encode(decoded)
require.NoError(f, err)
require.Equals(f, data, reEncoded)
}

@samsondav samsondav added this pull request to the merge queue Dec 2, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 2, 2024
@samsondav samsondav added this pull request to the merge queue Dec 2, 2024
Merged via the queue into develop with commit d0226d3 Dec 2, 2024
161 of 163 checks passed
@samsondav samsondav deleted the MERC-6522 branch December 2, 2024 18:46
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.

7 participants