ref-fvm
ref-fvm copied to clipboard
Account Abstraction Tracking Issue
MVP
- [ ] Endpoint for FFI to call into FVM to start up a validator
- [ ] CGO FFI bindings
- [ ] Syscall access constraining TODO issue
- [ ] Add new syscalls
- [ ] validate_context()
- [ ] (and/or) origin() getter
Release
- [ ] Pass message payload's parameters into the actor
- [ ] Gas benchmarking of reasonable gas limit to prevent DOSing
- [ ] Re-write spec related things
- [ ] counterfactuals is a weird part
TODO: new FIP spec draft is in the works in collaboration with @Stebalien
Accounts should be
struct Account {
pubkey: [u8; 32],
representations: Vec<Multihash>
}
Lotus Support
Walk through of the 4 places account abstraction will touch in lotus.
- [ ] Message Validation (pubsub)
- [ ] Execute validate before forwarding the message.
- Don't care about "value spent" here, we check that on block creation.
- https://github.com/filecoin-project/lotus/blob/7663ec2bde2c4074c5a7cbdd8ce2ac4939cb3252/chain/messagepool/messagepool.go#L739-L759
- https://github.com/filecoin-project/lotus/blob/7663ec2bde2c4074c5a7cbdd8ce2ac4939cb3252/chain/sub/incoming.go#L327-L377
- [ ] Make validation async
- May require a new message propegation topic? ideally not...
- https://github.com/filecoin-project/lotus/blob/7663ec2bde2c4074c5a7cbdd8ce2ac4939cb3252/node/modules/services.go#L172-L199
- [ ] Prioritize non-abstract account messages over abstract account messages.
- A new topic would definitely make this easier.
- [ ] Limit the number of messages in a chain that we validate.
- Current proposal says one, we really want more than that.
- But we still need a limit.
- [ ] Execute validate before forwarding the message.
- [ ] Block Creation
- Unsolved:
- Requires a cached "gas limit" for the message unless we change the current account abstraction proposal to not return this from validate.
- https://github.com/filecoin-project/FIPs/discussions/388#discussioncomment-3808952
- Unclear what to do about checking "value spent" as value can also be spent by internal sends.
- https://github.com/filecoin-project/lotus/blob/7663ec2bde2c4074c5a7cbdd8ce2ac4939cb3252/chain/messagepool/selection.go#L794-L831
- Likely fix: disable spends from internal sends.
- Alternatively... 2 or 3 stage execution
- Requires a cached "gas limit" for the message unless we change the current account abstraction proposal to not return this from validate.
- Unsolved:
- [ ] Block Validation
- Basic semantic validation, doesn't need to execute validate.
- We don't need to change much here, just need to accept abstract account messages as "valid"
- https://github.com/filecoin-project/lotus/blob/7663ec2bde2c4074c5a7cbdd8ce2ac4939cb3252/chain/consensus/filcns/filecoin.go#L86-L346
- Specifically: https://github.com/filecoin-project/lotus/blob/7663ec2bde2c4074c5a7cbdd8ce2ac4939cb3252/chain/consensus/filcns/filecoin.go#L437-L606
- [ ] Block Execution
- Executes validate, charges gas, etc.
- Happens entirely within the FVM.
validation can be async, but it shouldnt take too long coz it blocks message propagation.
also it is fine for the validator to block for a little while.