-
Notifications
You must be signed in to change notification settings - Fork 44
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
feat: record multisig approvals #389
Conversation
Codecov Report
@@ Coverage Diff @@
## master #389 +/- ##
========================================
+ Coverage 42.9% 46.4% +3.5%
========================================
Files 25 24 -1
Lines 1940 1796 -144
========================================
+ Hits 833 835 +2
+ Misses 980 834 -146
Partials 127 127 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a comment about migrations that should be addressed before merging, otherwise looks good to me 🚢
"to" text not null, | ||
"value" numeric not null, | ||
"signers" jsonb not null, | ||
PRIMARY KEY ("height", "state_root", "multisig_id") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the definition of the MultisigApproval
model (which I believe to be correct) Approver
and Message
should be primary keys here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch
tasks/msapprovals/msapprovals.go
Outdated
default: | ||
} | ||
|
||
// ll.Infow("found message", "to", m.ToActorCode.String(), "addr", m.Message.To.String()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✂️
lens/lotus/api.go
Outdated
if err == nil && !found { | ||
return cid.Undef | ||
} | ||
if err != nil { | ||
return cid.Undef | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if err != nil || !found {
return cid.Undef
}
is a tad clearer imo.
Create and populate a new
multisig_approvals
table containing multisig transaction approvals derived from propose and approve messages sent to the multisig actor. Create a new task calledmsapprovals
to run the extraction.Refactored the message task and moved it under the tasks package and then created a msapprovals package as a sibling. Ideally I would like to see all the named tasks move in this way so the chain package just contains chain walking/watching logic.
Anecdotally the
msapprovals
task takes a few seconds to run per tipset, depending on the number of multisig messages.(apologies for the dozens of hacky commits which I needed for shipping code for intractive testing - will squash them anyway before merge)
Fixes #388