-
Notifications
You must be signed in to change notification settings - Fork 5
Conversation
@@ -0,0 +1 @@ | |||
../tvx/schema.go |
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.
is this some Go magic trick I don't know about? 😮
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.
a git symbolic link :)
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.
I can't claim I understand everything that's going on here ;-) I'm gonna take it out for a spin now and will report more back.
One proposal I'd like to make is to follow the standard golang packaging, as far as possible. I would move the contents of lib
to the root, and move the command to a main package in cmd/statediff
.
This makes it easy to import as (in the future):
import "github.com/filecoin-project/lotus/statediff"
Instead of the more awkward import (that also requires an import alias):
import statediff "github.com/filecoin-project/lotus/statediff/lib"
It also paves the way for integration in Lotus, where you'll want the command to live inside lotus/cmd/statediff
, and call out to github.com/filecoin-project/lotus/statediff
.
|
||
replace github.com/filecoin-project/filecoin-ffi => ../extra/filecoin-ffi | ||
|
||
replace github.com/filecoin-project/sector-storage => github.com/filecoin-project/lotus/extern/sector-storage v0.0.0-20200814115354-002e972f7535 |
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.
After filecoin-project/lotus#3089, we should no longer require this.
|
||
type Option func(c *config) | ||
|
||
func ExpandActors(c *config) { |
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.
Godocs, please?
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.
An example of the same diff with and without this option would be 🔝
c.ExpandActors = true | ||
} | ||
|
||
func ExpandActorByCid(cids []cid.Cid) Option { |
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.
Godocs, please?
} | ||
} | ||
|
||
// Parse a user entered fuzzy definition for actor expansion. |
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.
I have no clue what this sentence means :-)
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.
Examples of well-formed arguments would be welcome.
return m | ||
} | ||
|
||
initHampTransformer := func(n *hamtNode) map[string]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.
hamppt? Or is there something I'm missing?
cidMap[".*\\(miner\\.State\\).*Partitions$"] = reflect.TypeOf(make([]*storageMinerActor.Partition, 0)) | ||
cidMap["miner\\.Deadline\\)\\.ExpirationsEpochs$"] = reflect.TypeOf(make([]*bitfield.BitField, 0)) | ||
cidMap[".*\\(miner\\.State\\).*Partitions.*ExpirationsEpochs$"] = reflect.TypeOf(make([]*storageMinerActor.ExpirationSet, 0)) | ||
cidMap[".*\\(miner\\.State\\).*EarlyTerminated$"] = reflect.TypeOf(make([]*bitfield.BitField, 0)) |
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.
Can we use backticks to avoid the escaping within the regex?
} | ||
|
||
func cidTransformer(ctx context.Context, store blockstore.Blockstore, cborStore cbor.IpldStore, atlas map[string]reflect.Type) []cmp.Option { | ||
options := make([]cmp.Option, 0) |
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.
options := make([]cmp.Option, 0) | |
var options []cmp.Option |
"verifiedRegistry": builtin.VerifiedRegistryActorCodeID, | ||
} | ||
|
||
func Diff(ctx context.Context, store blockstore.Blockstore, a, b cid.Cid, opts ...Option) { |
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.
Having this print straight to stdout is a bit inconvenient. Can we make it return a string? Or provide an alternate Sdiff
that returns a string
?
Previous work in filecoin-project/oni#227
ported to github.com/filecoin-project/statediff |
Standalone tool for visualization of diff's between state trees.
Two subcommands:
By default, expands to the actor level (balances, which actors change), as full expansion/retrieval is quite slow. Full actor expansion is enabled with
--expand-actors all
. Specific actors can be expanded with--expand-actors reward,cron
or--expand-actors bafkqaetgnfwc6mjpon2g64tbm5sw22lomvza
(either the class of the builtin actor, the code Cids, or actor head Cids)