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

WiP: Add Malfeasance V2 Handler and Publisher #6184

Closed
wants to merge 28 commits into from

Conversation

fasmat
Copy link
Member

@fasmat fasmat commented Jul 29, 2024

Motivation

This adds the a malfeasance handler that will be used when ATX v2 goes live.

Description

This PR simplifies the existing malfeasance handler to only handle V1 proofs (which will eventually be retired in a future release) and adds a handler for V2 proofs.

Additionally publishers for V1 and V2 proofs have been added. Shifting the responsibility for publishing proofs from the components (activation, etc.) to a dedicated service. This also allows to simplify handling of proof publication since the components now don't need to keep track any more if they are in sync or not before publishing a proof (the publisher now keeps track of this instead).

The new DB table malfeasance requires foreign key constraints so these have now been enabled using PRAGMA foreign_keys = ON;. The new table will keep track of malicious identities and their proofs. The existing identities table will in future only be used to keep track of which identities belong to which marriage set and the proofs in them will be dropped with the V1 publisher / handler of malfeasance proofs. (Proofs will be migrated to V2)

Test Plan

  • Existing tests were updated
  • new tests were added for the new components

TODO

  • Explain motivation or link existing issue(s)
  • Test changes and document test plan
  • Update documentation as needed
  • Update changelog as needed

@fasmat fasmat self-assigned this Jul 29, 2024
@mathcrypto mathcrypto self-requested a review July 29, 2024 16:49
malfeasance/handler.go Show resolved Hide resolved
malfeasance2/handler.go Show resolved Hide resolved
malfeasance2/handler.go Show resolved Hide resolved
malfeasance2/handler.go Show resolved Hide resolved
malfeasance2/handler.go Show resolved Hide resolved
malfeasance2/handler.go Show resolved Hide resolved
malfeasance2/handler.go Show resolved Hide resolved
malfeasance2/handler.go Show resolved Hide resolved
sql/migrations/state/0022_malfeasance.sql Outdated Show resolved Hide resolved
Copy link

codecov bot commented Aug 20, 2024

Codecov Report

Attention: Patch coverage is 76.49573% with 55 lines in your changes missing coverage. Please review.

Project coverage is 81.7%. Comparing base (5b44c29) to head (4bcfcdf).
Report is 7 commits behind head on develop.

Files with missing lines Patch % Lines
sql/malfeasance/malfeasance.go 81.1% 12 Missing and 8 partials ⚠️
malfeasance/publisher.go 0.0% 18 Missing ⚠️
malfeasance2/handler.go 83.8% 9 Missing and 2 partials ⚠️
malfeasance/handler.go 84.2% 1 Missing and 2 partials ⚠️
sql/database.go 0.0% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #6184    +/-   ##
========================================
  Coverage     81.7%   81.7%            
========================================
  Files          312     315     +3     
  Lines        34613   34794   +181     
========================================
+ Hits         28297   28458   +161     
- Misses        4479    4496    +17     
- Partials      1837    1840     +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fasmat
Copy link
Member Author

fasmat commented Aug 29, 2024

The contents of this PR have been integrated into #6307

@fasmat fasmat closed this Aug 29, 2024
@fasmat fasmat deleted the refactor-publisher-wip branch August 29, 2024 19:34
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.

2 participants