lotus/chain/actors/builtin
Steven Allen 46f5b62a76 Remove a misleading miner actor abstraction
We shouldn't implement CBOR functions on the "abstract" miner info. Otherwise,
we could end up trying to actually _use_ this "abstract" info when decoding
state (which won't work across version).

Also remove the use of these CBOR functions, and instead explicitly use miner0
types. We'll have to abstract over versions eventually, but we'll probably need
some form of abstract miner builder (or maybe even adding some "add sector",
etc. functions to the current miner abstraction?
2020-09-23 14:49:53 -07:00
..
account Add compile-time checks that actors interfaces are correctly implemented 2020-09-21 02:19:32 -04:00
init add init.State#Remove() for testing. 2020-09-23 17:42:01 +01:00
market Use actor state addresses 2020-09-23 02:32:40 -04:00
miner Remove a misleading miner actor abstraction 2020-09-23 14:49:53 -07:00
multisig Add an error return to all actor state interface methods 2020-09-23 01:51:38 -04:00
paych Add an error return to all actor state interface methods 2020-09-23 01:51:38 -04:00
power Add compile-time checks that actors interfaces are correctly implemented 2020-09-21 02:19:32 -04:00
reward Reward state interface only needs cbor.Marshaler 2020-09-23 01:42:10 -04:00
verifreg migrate lotus-shed verifreg to specs-actors abstractions 2020-09-21 15:04:39 -07:00
builtin.go API shouldn't depend on actors directly 2020-09-23 00:51:12 -04:00
README.md [WIP] Network upgrade support 2020-09-11 20:16:29 -07:00

Actors

This package contains shims for abstracting over different actor versions.

Design

Shims in this package follow a few common design principles.

Structure Agnostic

Shims interfaces defined in this package should (ideally) not change even if the structure of the underlying data changes. For example:

  • All shims store an internal "store" object. That way, state can be moved into a separate object without needing to add a store to the function signature.
  • All functions must return an error, even if unused for now.

Minimal

These interfaces should be expanded only as necessary to reduce maintenance burden.

Queries, not field assessors.

When possible, functions should query the state instead of simply acting as field assessors. These queries are more likely to remain stable across specs-actor upgrades than specific state fields.

Note: there is a trade-off here. Avoid implementing complicated query logic inside these shims, as it will need to be replicated in every shim.