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

verify single predicate #960

Merged
merged 23 commits into from
Dec 5, 2023
Merged

verify single predicate #960

merged 23 commits into from
Dec 5, 2023

Conversation

ceyonur
Copy link
Collaborator

@ceyonur ceyonur commented Oct 18, 2023

Why this should be merged

VerifyPredicate is aPredicater interface function which can be implemented by precompiles to start using predicates and verify them. This means external developers are exposed to this interface. This PR simplifies returned type of VerifyPredicate and predicateBytes param. It also cleans up/reduces multiple access list loops.

Closes: #844

How this works

It moves bitset construction to the CheckPredicates function and changes VerifyPredicate signature.

How this was tested

Added UTs and existing tests should cover this.

I put up another PR to add a comparison test between old code vs new to ensure they return same results:
#1006

How is this documented

@ceyonur ceyonur added this to the v0.5.8 milestone Oct 18, 2023
@ceyonur ceyonur self-assigned this Oct 18, 2023
anusha-ctrl
anusha-ctrl previously approved these changes Oct 19, 2023
Copy link
Contributor

@anusha-ctrl anusha-ctrl left a comment

Choose a reason for hiding this comment

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

lgtm

Signed-off-by: Ceyhun Onur <ceyhun.onur@avalabs.org>
core/predicate_check.go Outdated Show resolved Hide resolved
core/predicate_check.go Outdated Show resolved Hide resolved
core/predicate_check.go Outdated Show resolved Hide resolved
core/predicate_check.go Show resolved Hide resolved
core/predicate_check_test.go Outdated Show resolved Hide resolved
core/predicate_check_test.go Show resolved Hide resolved
@ceyonur ceyonur marked this pull request as draft November 23, 2023 18:22
@ceyonur ceyonur marked this pull request as ready for review November 23, 2023 20:04
@ceyonur
Copy link
Collaborator Author

ceyonur commented Nov 23, 2023

I put up another PR to add a comparison test between old code vs new to ensure they return same results:
#1006

@ceyonur ceyonur removed the Need Test label Nov 24, 2023
core/predicate_check.go Outdated Show resolved Hide resolved
marun
marun previously approved these changes Nov 29, 2023
@darioush
Copy link
Collaborator

Nits: #1012

darioush
darioush previously approved these changes Dec 1, 2023
@ceyonur ceyonur requested a review from marun December 1, 2023 19:10
marun
marun previously approved these changes Dec 1, 2023
precompile/testutils/test_predicate.go Outdated Show resolved Hide resolved
x/warp/predicate_test.go Outdated Show resolved Hide resolved
x/warp/predicate_test.go Outdated Show resolved Hide resolved
x/warp/predicate_test.go Outdated Show resolved Hide resolved
x/warp/predicate_test.go Outdated Show resolved Hide resolved
core/predicate_check_test.go Outdated Show resolved Hide resolved
core/predicate_check_test.go Show resolved Hide resolved
core/predicate_check_test.go Outdated Show resolved Hide resolved
@ceyonur ceyonur dismissed stale reviews from marun and darioush via b894adc December 4, 2023 16:16
ceyonur and others added 5 commits December 4, 2023 19:16
Co-authored-by: aaronbuchwald <aaron.buchwald56@gmail.com>
Signed-off-by: Ceyhun Onur <ceyhunonur54@gmail.com>
Co-authored-by: aaronbuchwald <aaron.buchwald56@gmail.com>
Signed-off-by: Ceyhun Onur <ceyhunonur54@gmail.com>
aaronbuchwald
aaronbuchwald previously approved these changes Dec 4, 2023
@ceyonur ceyonur merged commit 58eb7ef into master Dec 5, 2023
8 checks passed
@ceyonur ceyonur deleted the single-predicate-verify branch December 5, 2023 15:28
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
Status: Backlog 🗄
Development

Successfully merging this pull request may close these issues.

Take single predicate in VerifyPredicates
5 participants