Skip to content

Conversation

@StephenButtolph
Copy link
Contributor

@StephenButtolph StephenButtolph commented Aug 15, 2025

Why this should be merged

This PR slims down the public API exposed by the predicate package for handling predicates. Now only []common.Hash and []byte are exposed publicly.

How this works

Mainly just deleted code that wasn't needed and simplified a couple implementations.

This PR doesn't touch any result handling logic.

How this was tested

Unit tests.

Need to be documented in RELEASES.md?


if trim[len(trim)-1] != delimiter {
return nil, errWrongEndDelimiter
predicates[el.Address] = append(predicates[el.Address], el.StorageKeys)
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 removed the copy here... If we want to keep the copy to avoid mutating the predicates if StorageKeys is later modified, then we can do that... But I didn't see a need.

{
name: "non-zero padding",
input: append(append([]byte{0x42, 0xff}, bytes.Repeat([]byte{0}, 29)...), 0x01, 0x00),
name: "wrong_delimiter",
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we add underscoring between words? My guess was that tooling doesn't like the white space.... on my IDE it replaces whitespace with _ so I wasn't sure what the rationale was here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The rationale behind replacing " " with "_" is that if a test fails it is printed with the spaces replaced with underscores, so searching for the test is nicer if the name uses underscores rather than spaces.

Choose a reason for hiding this comment

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

if that's the case, results_test also needs to be modified

@StephenButtolph StephenButtolph merged commit 1f80e66 into uplift-evm-predicate Aug 15, 2025
29 checks passed
@StephenButtolph StephenButtolph deleted the simplify-predicate-handling branch August 15, 2025 17:58
@github-project-automation github-project-automation bot moved this to Done 🎉 in avalanchego Aug 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants