Commit Graph

480 Commits

Author SHA1 Message Date
Jakub Sztandera
55c6b88537
Add toggle for badger, flag out gas tracing
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-09-29 14:49:46 +02:00
Jakub Sztandera
b7f18b4601
Disable callers
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-09-29 14:49:18 +02:00
Aayush Rajasekaran
be9d23b329 Centralize some params in builtin 2020-09-29 02:25:43 -04:00
Steven Allen
ca9448bc11 rename actors v1 -> actors v2
The actual actors version is v2, not v1. Using Version1 internally was really confusing.
2020-09-28 13:13:18 -07:00
Steven Allen
5f3160cf5b continue expanding vm abstraction layer 2020-09-28 12:48:08 -07:00
Steven Allen
b8d9d7894f fix vm version 2020-09-25 12:52:16 -07:00
Steven Allen
8b35f480c4 initial vm conversion
We're probably going to want to change some of these design decisions down the
road, but this is a good starting point.

* We may want to use a more general test for "is actor valid at epoch". Maybe
just a function?
* I'd like to push some of the actor metadata down into the actor types
themselves. Ideally, we'd be able to register actors with a simple
`Register(validation, manyActors...)` call.
2020-09-25 12:49:39 -07:00
Steven Allen
8806f27220 fix runtime reflection for upgrade 2020-09-25 12:49:39 -07:00
Aayush Rajasekaran
ebad0ded3d Introduce v1 actors 2020-09-25 12:49:39 -07:00
Łukasz Magiera
15eddf0c96 Make sync wait nicer 2020-09-24 13:39:49 +02:00
Łukasz Magiera
ded3a30f55 fix lint 2020-09-24 11:56:54 +02:00
whyrusleeping
38e256cece add some tracing to the vm's blockstore copy 2020-09-23 20:19:20 -07:00
Aayush Rajasekaran
a876a0ba44 Use actor state addresses 2020-09-23 02:32:40 -04:00
Steven Allen
2967c4ec10 use abstract actor type methods 2020-09-22 12:02:29 -07:00
Steven Allen
1bf3b4989d rename imports to match actors code
`sed -i 's/\bv0\(\w\)\(\w*\)/\L\1\E\20/g' **/*.go`
2020-09-18 14:59:27 -07:00
Steven Allen
4a7055c328 fix state loading in vm 2020-09-18 14:46:55 -07:00
Steven Allen
24df873498 rename imports 2020-09-18 14:21:05 -07:00
Steven Allen
8747c6083e abstract over account actor 2020-09-18 14:20:53 -07:00
Łukasz Magiera
70faa36b7f Merge remote-tracking branch 'origin/master' into refactor/net-upgrade 2020-09-18 19:29:06 +02:00
Aayush Rajasekaran
053cfc1cc7 Migrate verifreg actor 2020-09-17 03:55:23 -04:00
Aayush Rajasekaran
e2295c372a Migrate multisig actor 2020-09-17 02:57:45 -04:00
Aayush Rajasekaran
b60614982e Migrate reward actor 2020-09-17 02:42:39 -04:00
Aayush Rajasekaran
b5ba7a0fad Miner migration 2020-09-17 02:21:16 -04:00
Raúl Kripalani
362fc180ec fix a regression caused by #3800. 2020-09-16 10:54:26 +01:00
Aayush Rajasekaran
b4ee519282 Partial progress towards switching to miner and power interfaces 2020-09-16 01:37:49 -04:00
Łukasz Magiera
d4a7732d0a
Merge pull request #3800 from filecoin-project/asr/gascost
Add an API to get detailed gas costs for a message
2020-09-15 19:13:20 +02:00
Steven Allen
cc4d5306eb Progress 2020-09-14 15:43:12 -07:00
Steven Allen
02dcb5e182 Merge branch 'master' into refactor/net-upgrade 2020-09-14 14:53:57 -07:00
Steven Allen
32eeb96ce7 Update to specs-actors 0.9.9
This patch changes the runtime interfaces, to make it possible to abstract over them.
2020-09-14 12:47:39 -07:00
Aayush Rajasekaran
d1850ea27d Add an API to get detailed gas costs for a message 2020-09-14 14:40:13 -04:00
Łukasz Magiera
06ec571c20 Merge remote-tracking branch 'origin/master' into refactor/net-upgrade 2020-09-14 15:09:52 +02:00
Łukasz Magiera
683a58195e More terraforming in chain/ 2020-09-14 14:46:38 +02:00
Łukasz Magiera
68097132fe Fix vm build 2020-09-14 13:45:20 +02:00
Steven Allen
d3594835c4 [WIP] Network upgrade support
This patch starts adding support for network upgrades.

* It adds an actors abstraction layer for loading abstract (cross-version) actors.
* It starts switching over to a shared deadline type.
* It adds an abstraction for ADTs (hamt/amt).
* It removes the callback-based API in the StateManager (difficult to abstract
across actor versions).
* It _does not_ actually add support for actors v2. We can do that in a followup
patch but that should be relatively easy.

This patch is heavily WIP and does not compile. Feel free to push changes
directly to this branch.

Notes:

* State tree access now needs a network version, because the HAMT type will change.
* I haven't figured out a nice way to abstract over changes to the _message_
types. However, many of them will be type aliased to actors v0 in actors v2 so
we can likely continue using the v0 versions (or use the v2 versions
everywhere). I've been renaming imports to `v0*` to make it clear that we're
importing types from a _specific_ actors version.

TODO:

* Consider merging incremental improvements? We'd have to get this compiling
again first but we could merge in the new abstractions, and slowly switch over.
* Finish migrating to the new abstractions.
* Remove all actor state types from the public API. See `miner.State.Info()` for
the planned approach here.
* Fix the tests. This is likely going to be a massive pain.
2020-09-11 20:16:29 -07:00
Aayush Rajasekaran
774e068436 Update to specs-actors v0.9.8 2020-09-10 17:41:55 -04:00
Aayush Rajasekaran
86ba21029d Update to go state types 001afaca718c 2020-09-10 17:41:55 -04:00
Aayush Rajasekaran
316ac61875 Update to go state types 3ca0d2890090 2020-09-10 17:41:55 -04:00
Aayush Rajasekaran
6eea5dd109 Update to specs 0.9.7 and markets 0.6.0 2020-09-07 17:11:32 -04:00
Aayush Rajasekaran
d678fe4bfa Fix tests 2020-09-07 15:48:42 -04:00
Aayush Rajasekaran
39755a294a Update to specs v0.9.6 2020-09-07 15:48:41 -04:00
anorth
a8dcea1422 Remove use of exitcode.SysErrInvalidParameters 2020-09-07 15:48:41 -04:00
Łukasz Magiera
551ff6a6fb
Merge pull request #3608 from filecoin-project/fix/second-argument-error-message
fix: second argument error message
2020-09-07 18:06:22 +02:00
Alan Shaw
9d9d2a2a98
fix: second argument error message
Second argument should be a pointer, not runtime.
2020-09-07 12:29:40 +01:00
Raúl Kripalani
798061506e decommission chain validation. 2020-09-07 11:34:36 +01:00
Steven Allen
30fdff17b5 Skip nil exports
The actors may skip previously used but no longer defined method numbers.
2020-09-04 12:26:55 -07:00
austinabell
39ef3a701b
Remove unsigned message pointer from Runtime 2020-08-27 17:34:45 -04:00
Steven Allen
5733c71c50 Lint everything
We were ignoring quite a few error cases, and had one case where we weren't
actually updating state where we wanted to. Unfortunately, if the linter doesn't
pass, nobody has any reason to actually check lint failures in CI.

There are three remaining XXXs marked in the code for lint.
2020-08-20 20:46:36 -07:00
Raúl Kripalani
efdc428d5d keep storage-fsm (renamed to storage-sealing) and sector-storage in extern. 2020-08-17 14:26:18 +01:00
Raúl Kripalani
3c17cd655e integrate extern/sector-storage into lotus proper. 2020-08-16 11:09:58 +01:00
Aayush Rajasekaran
fe2da35a45 Move GetCircSupply out of the vm, and into stmgr 2020-08-12 15:32:07 -04:00
Aayush Rajasekaran
5933e64de1 Include premined actors in vested funds calculation 2020-08-12 15:19:48 -04:00
Whyrusleeping
ed72aa1307 implement randomness distinction 2020-08-12 10:32:39 -07:00
Steven Allen
9248e5a572 Update specs-actors, cbor-gen, and go-address 2020-08-12 10:32:39 -07:00
Jakub Sztandera
ed2778f785
Make MpoolPushMessage message wait for the first message to be done
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-08-09 00:29:59 +02:00
Łukasz Magiera
cad59b045b More pond-related fixes 2020-08-07 16:07:48 +02:00
Jakub Sztandera
884d03f7f1
address feedback
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-08-07 04:09:01 +02:00
Jakub Sztandera
aa17d2bdf3
Add tests
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-08-07 01:57:21 +02:00
Łukasz Magiera
07bf155295 Merge remote-tracking branch 'origin/next' into feat/dyn-base-fee 2020-08-06 23:41:54 +02:00
Jakub Sztandera
5f826a2147
Update gas numbers
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-08-06 23:27:09 +02:00
Jakub Sztandera
c29dd72174
add check for feecap and premium to vm.checkMessage
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-08-06 21:45:03 +02:00
Jakub Sztandera
b384ac6943
Compute correct base burns, miner tip and so on
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-08-06 21:14:38 +02:00
Jakub Sztandera
722d6e8ffb
Introduce base fee
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-08-06 21:14:38 +02:00
Dirk McCormick
aea1b0e293 fix: lint fixes 2020-08-06 12:04:10 -04:00
Dirk McCormick
4abc7416f6 fix: make DeleteActor(beneficiary) transfer funds to beneficiary (instead of burning funds) 2020-08-06 12:04:10 -04:00
Łukasz Magiera
f8b8ecc0c3 Consensus filter 2020-08-06 03:16:39 +02:00
Jakub Sztandera
d9ba8d3671
Change to scaling overestimation burn algorithm
Change the treshold to 1.1

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-08-05 02:12:11 +02:00
Jakub Sztandera
3058f280d9
Fix bad error message
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-08-05 02:10:25 +02:00
Jakub Sztandera
5405a5adc3
Sepearate ComputeGasOutputs into sepearate function, add tests
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-08-05 02:10:25 +02:00
Jakub Sztandera
5ff12a5d2d
Burn remainder of GasLimit over 1.3*gasUsed
GasToBurn = max(0, GasLimit - GasUsed + (3*GasUsed)/10)

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-08-05 02:10:25 +02:00
Jakub Sztandera
ae29d132ed
Make VerifyPost cheaper
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-07-31 21:38:23 +02:00
Aayush Rajasekaran
c881f287ad Update specs-actors and chain-val...again 2020-07-31 00:29:44 -04:00
Jakub Sztandera
7f722623ca
Allow messages with not enough funds for transfer to apply
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-07-30 16:23:30 +02:00
Aayush Rajasekaran
5e485a085a
Merge pull request #2637 from filecoin-project/gas/tag-verify-post
Use scaling VerifyPost cost
2020-07-28 21:22:23 -04:00
Aayush Rajasekaran
b51e2a868b
Merge branch 'next' into feat/cid-builder 2020-07-28 21:02:30 -04:00
Aayush Rajasekaran
890f56ac38 Lock before setting up genesis msigs 2020-07-28 20:35:40 -04:00
Aayush Rajasekaran
0b1d80d3e3 Rename constants to match CE spec 2020-07-28 17:26:55 -04:00
Aayush Rajasekaran
7153bda0be Correct MiningRewardTotal and calculation of filMined 2020-07-28 17:26:55 -04:00
Aayush Rajasekaran
de867d7a9a Correct calculation of TotalCircSupply 2020-07-28 17:26:55 -04:00
Jakub Sztandera
0d169dd947
Use scaling VerifyPost costs
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-07-28 22:31:43 +02:00
Jakub Sztandera
5d9c6cd02c
Add proof info to gas trace
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-07-28 22:31:43 +02:00
Steven Allen
bb54dc97b6 Fix incorrect ID CID optimization
Blocks inlined into CIDs can technically contain CIDs themselves. I'm guessing
this check was trying to skip "actor" CIDs (inline cids with raw blocks).
2020-07-23 23:22:44 -07:00
Steven Allen
b7a4dbb07f Support inline CIDs
And use the new CidBuilder from the spec actors.

This patch does not switch over to inline CIDs by default, but paves the way.
2020-07-23 23:12:32 -07:00
Jakub Sztandera
4abff16783
Update storage gas prices
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-07-23 22:56:32 +02:00
Łukasz Magiera
637ec168df
Merge pull request #2550 from filecoin-project/fix/runtime-logs
fix: correctly pass variadic args from runtime log
2020-07-23 20:42:52 +02:00
frrist
bd2363178d fix: correctly pass variadic args from runtime log 2020-07-23 10:13:16 -07:00
Steven Allen
5fc83f4d05 Refactor to use actor adt types instead of directly using HAMTs and AMTs
This way there's a single source of truth. Preparation for fixing
https://github.com/filecoin-project/specs-actors/issues/517 (requires changing
HAMT parameters).
2020-07-23 09:34:57 -07:00
Łukasz Magiera
d70edbcb7c Set things on syscallShim 2020-07-22 13:35:10 -04:00
Jakub Sztandera
7d83349507
Format FIL as FIL
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-07-22 17:50:34 +02:00
Jakub Sztandera
b3bac0c9e8
Add better error messages for message pre-execution errors
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-07-22 17:50:34 +02:00
Jakub Sztandera
e1c9c4297b
use cid for cmp
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-07-20 15:29:07 +02:00
Łukasz Magiera
0ded061037 Get math to work 2020-07-18 00:15:21 +02:00
Jakub Sztandera
1b5797be9d
Merge pull request #2456 from filecoin-project/feat/increase-cron-gas
Increase cron gas
2020-07-17 20:11:21 +02:00
Jakub Sztandera
aafafce083
Increase cron gas
Make gas check overflow safe
2020-07-17 19:49:55 +02:00
Łukasz Magiera
cb6767a02b Merge remote-tracking branch 'origin/next' into feat/actors-miner-refactor 2020-07-17 15:18:11 +02:00
Peter Rabbitson
e266f3b955 Bump fil-commcid and filecoin-ffi deps
Propagates correct on-chain commX CIDs
2020-07-17 00:38:42 +02:00
Jakub Sztandera
610ed0dc13
Change OnIpldGet
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-07-15 21:40:49 +02:00
Jakub Sztandera
4dd6f6400c
Make virtual gas real
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-07-15 20:01:57 +02:00
Jakub Sztandera
c0eb4b39ac
Reorg some gas charges
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-07-15 20:01:56 +02:00
Raúl Kripalani
0484496d92 Merge branch 'next' into mock-clock 2020-07-14 18:08:26 +01:00
Łukasz Magiera
faebc4c948 WIP Integrating specs-actors with refactored miner state 2020-07-14 13:45:45 +02:00