Commit Graph

281 Commits

Author SHA1 Message Date
Łukasz Magiera
deb2b90b6a Fix lotus/miner build 2021-04-05 13:23:46 +02:00
Raúl Kripalani
87efc9d536 add godocs to miner objects. 2021-03-25 13:02:19 +01:00
Steven Allen
b8e3808c4f Make state tipset usage consistent in the API
_Always_ (almost) use the tipset's parent state, instead of computing.

Exceptions:

* MinerGetBaseInfo. Fixing this would break things so we need to be
careful (although we could bump the API version, fix it, then fix the call
sites).
* StateReplay. This is replaying a message on top of the given tipset.
* GasEstimateGasLimit. This executes the message on-top-of the tipset's
computed state (unlike call which executes it on the tipset's parent state).
  * Having this method and Call apply the message at different heights is really
  weird.
2020-12-09 11:29:40 -08:00
zgfzgf
178691e37f optimize code use existence var 2020-12-03 09:54:57 +08:00
Łukasz Magiera
f1948d54f0 miner: log winningPoSt duration separately 2020-11-25 11:05:06 +01:00
Łukasz Magiera
b92ce76a78 gofmt 2020-11-18 02:03:52 +01:00
刘林欣
b63687795d break loop when found warm up sector 2020-11-16 17:51:02 +08:00
Łukasz Magiera
fb05bb7f07 miner: Winning PoSt Warmup 2020-11-12 15:34:16 +01:00
Jakub Sztandera
16a911bc39
Fix random test failures
If block 1 was a null block then blockSet would include genesis which
would lead to us trying to load parent of a genesis block.

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-23 19:33:30 +02:00
Steven Allen
59cfabf8a4 don't resolve the worker key twice 2020-10-22 15:48:09 -07:00
Steven Allen
defeba5576 Fix lookback for worker key when computing ticket
We need to compute the ticket based on our worker key from the lookback epoch,
not the current epoch.
2020-10-22 09:26:58 -07:00
Steven Allen
4e730b5ec8 port to v2 imports 2020-10-21 12:16:23 -07:00
Steven Allen
748d2e82a7 unshare the journal
Motivation:

* Run lotus with the race detector enabled (primary motivation).
* Allow multiple lotus nodes in a process (not a high priority).

Previously, the journal was shared between all lotus instances, but it was
initialized for every new node. This caused safety problems in tests (at a
minimum).

This patch explicitly passes the journal to all services that need it.
2020-10-09 13:23:07 -07:00
刘林欣
a23ab123d7
fix GetBestMiningCandidate bug
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-08 23:39:33 +02:00
Aayush Rajasekaran
f8c886a611 Rename MiningBaseInfo.HasMinPower to EligibleForMining 2020-10-06 03:49:11 -04:00
zgfzgf
7a14455ac8 miner debug where injectNulls != 0 2020-09-27 15:01:42 +08:00
Łukasz Magiera
28b46ad08c Merge branch 'zgfzgf-miner-break' into master 2020-09-24 16:03:47 +02:00
Łukasz Magiera
43323b2188 Use continue instead of goto 2020-09-24 16:03:24 +02:00
zgfzgf
a4ade158f4 change minerStop to minerLoop 2020-09-23 20:24:19 +08:00
zgfzgf
001ba17d37 break error 2020-09-22 15:21:35 +08:00
Steven Allen
d33dd4f7bc more renames 2020-09-21 16:01:29 -07:00
Łukasz Magiera
a6b7791d32 lint 2020-09-16 22:56:04 +02:00
Travis Person
808051d34e break out of mining loop when stop is called during niceSleep 2020-09-16 02:06:40 +00:00
Raúl Kripalani
6d29d75724 Merge branch 'master' into inmem-journal 2020-09-14 12:17:45 +01:00
whyrusleeping
db6bd890d9 condition randomness changes on fork height
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-09-10 17:41:55 -04:00
Steven Allen
7a46c5ff31 [WIP] Fix ticket randomness
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-09-10 17:41:55 -04:00
Anton Evangelatov
1d67e38f78 add niceSleep 1 second when drand errors 2020-09-08 18:35:10 +02: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
Raúl Kripalani
3206f92063 Merge branch 'master' into inmem-journal 2020-09-02 19:50:52 +01:00
whyrusleeping
36ff37ba47 Wait until blocks show up full nodes 'head' before claiming block has been mined 2020-08-26 17:51:16 -07:00
Raúl Kripalani
efdfd3ee3e Merge branch 'master' into inmem-journal 2020-08-26 16:38:23 +01:00
Raúl Kripalani
4e1ef09751 make journal a global var. 2020-08-26 16:09:37 +01: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
Jakub Sztandera
f018e870dc
Address review
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-08-11 23:35:06 +02:00
Jakub Sztandera
b309e80e41
Wire in Ticket Quality to MpoolSelect
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-08-11 16:14:27 +02:00
Raúl Kripalani
b534ab9d3c panic recovery in MaybeRecordEvent; handle nil current tipsets in wdpost. 2020-08-11 14:28:00 +01:00
Raúl Kripalani
2ea5abdfb5 wire journal into miner. 2020-08-11 13:48:32 +01:00
whyrusleeping
d1d4ca65b2 add block timestamp to journal 2020-08-07 14:20:51 -07:00
whyrusleeping
e6c70c19d0 add a journal entry when miners mine a block 2020-08-07 13:51:41 -07:00
Łukasz Magiera
c62859e38b Unrevert #2832 with fixed code 2020-08-07 18:09:53 +02:00
Łukasz Magiera
c8cf8f3ee1 Revert #2832 fully 2020-08-07 17:51:03 +02:00
Łukasz Magiera
9b28be14cd Betting logs 2020-08-07 17:36:15 +02:00
Łukasz Magiera
d31d6e61d8 miner: Don't wait for beacon entries 2020-08-07 14:43:55 +02:00
whyrusleeping
41bc8f14a2 fix tests 2020-08-06 17:05:35 -07:00
whyrusleeping
5dbbf50f62 recheck best known tipset after waiting for random beacon entry to become available 2020-08-06 16:54:16 -04:00
Łukasz Magiera
e54a87f91b
Merge pull request #2838 from filecoin-project/feat/message-pool-selection
New message pool selection logic
2020-08-06 20:19:35 +02:00
Łukasz Magiera
73b8868046 gofmt 2020-08-06 03:32:59 +02:00
Łukasz Magiera
f8b8ecc0c3 Consensus filter 2020-08-06 03:16:39 +02:00
vyzo
1511644541 remove deprecated miner selection logic; it lives in the message pool now 2020-08-05 23:18:37 +03:00
vyzo
96b3295307 introduce and use MpoolSelect API 2020-08-05 23:17:14 +03:00
whyrusleeping
57b931b06a apply less nice but working fix 2020-08-03 18:26:55 -07:00
whyrusleeping
50ae04e6b7
add test to show that select messages isnt working as expected
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-08-04 03:03:28 +02:00
Jakub Sztandera
3e23b3653b
Correctly account for gas of included messages
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-08-04 03:03:14 +02:00
whyrusleeping
255777a4a9 implement dumb pruning 2020-08-01 15:54:21 -07:00
Jakub Sztandera
a8c6253fc7
Show it tests that it works even better
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-07-31 14:27:28 +02:00
Jakub Sztandera
fc0bd2cda5
Add gas guesstimation
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-07-31 14:27:28 +02:00
Jakub Sztandera
483b33acd1
Move SelectMessages to its own file
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-07-31 14:27:28 +02:00
whyrusleeping
4bbe5abf81 improve slow block production logs 2020-07-29 14:20:07 -07:00
Aayush Rajasekaran
b51e2a868b
Merge branch 'next' into feat/cid-builder 2020-07-28 21:02:30 -04:00
Aayush Rajasekaran
859168015a Use specs actor's MinerNominalPowerMeetsConsensusMinimum 2020-07-28 17:21:05 -04:00
Łukasz Magiera
fb59b40507 Fix some tests 2020-07-28 18:16:56 +02:00
whyrusleeping
cd00b0090b mitigate epoch boundary attacks by randomizing cutoff 2020-07-21 11:42:38 -07:00
Anton Evangelatov
69ebd2bb85 move mutex before select 2020-07-20 17:45:46 +02:00
Jakub Sztandera
399c171f03
Update gas limits, update storage-fsm
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-07-15 21:21:53 +02:00
Jakub Sztandera
7b14d445b4
Update message gas limits
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-07-15 20:01:57 +02:00
Raúl Kripalani
a44e80c829 Merge branch 'next' into mock-clock 2020-07-15 15:51:11 +01:00
Raúl Kripalani
86457e5201
fix flaky test (miner#TestMessageFiltering). (#2411) 2020-07-15 15:50:32 +01:00
Raúl Kripalani
55d88440eb refine block timing log statements. 2020-07-14 17:12:00 +01:00
Raúl Kripalani
13de81b3b2 introduce the ability to mock time. 2020-07-10 15:51:45 +01:00
Łukasz Magiera
18199ff323
Merge pull request #2223 from filecoin-project/feat/miner-msg-select-use-gas-price-is-more-better
miner: Use gas price when selecting messages
2020-07-09 21:53:16 +02:00
Yusef Napora
ea5dc461a1 pass error into waitFunc callback 2020-07-03 17:15:43 -04:00
Yusef Napora
d6d68b9096 call waitFunc callback on mining error 2020-07-03 09:56:40 -04:00
Łukasz Magiera
70cac6ce08 miner: Use gas price when selecting messages 2020-07-01 20:35:19 +02:00
Łukasz Magiera
e949a458ec miner: Fix mpool too-high-nonce-msgs log 2020-07-01 12:53:27 +02:00
Raúl Kripalani
1ef490feea rename build.PropagationDelay{=>Secs}. 2020-06-30 15:01:30 +01:00
Raúl Kripalani
4f9c907248 rename build.{BlockDelay=>BlockDelaySecs}.
Since this global is not typed as a time.Duration,
rather as an int, it makes sense to clarify the unit.
2020-06-30 14:26:49 +01:00
Raúl Kripalani
0fddf3e114 make system constants configurable as vars.
This configurability is unlocked through the `testground`
build tag, which Project Oni will uses.

Changes in the usage places of these relaxed constants
were required due to the fact that Golang constants are
untyped, but vars aren't.

Read https://blog.golang.org/constants for more info.
2020-06-30 14:18:26 +01:00
waynewyang
8d51a20143 fix: mining logic 2020-06-28 18:20:56 +08:00
Jakub Sztandera
008a2969b2
Fix two races in events
Also race fix: depends on https://github.com/ipfs/go-blockservice/pull/65
Resolves #2092, #2099, #2108, #1930, #2110

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-06-24 17:05:24 +02:00
Raúl Kripalani
c8104a03e6
some initial godocs. (#2118) 2020-06-23 18:51:25 -03:00
Jeromy
c7e3a5cff4 fix null incrementing 2020-06-12 02:28:17 +02:00
Jakub Sztandera
c90d35869b
Add gas tracing
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-06-11 21:59:39 +02:00
Jeromy
9d49c6861f don't update the mining base if mining fails for some reason 2020-06-08 09:51:47 -07:00
Łukasz Magiera
7003960fdd Merge remote-tracking branch 'origin/master' into next 2020-06-01 18:52:06 +02:00
Howard Yeh
1cabecedee Fix block production timing to avoid mining old tipset 2020-05-29 18:13:58 +08:00
Jakub Sztandera
4604b60fb1
Remove drand on miner side, MinerGetBaseInfo provides the same info
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-05-27 20:24:26 +02:00
Jeromy
eaf69b160c having power below the minimum means not having power 2020-05-18 14:51:42 -07:00
Łukasz Magiera
b90666b293 miner: optimize SelectMessages 2020-05-15 19:30:31 +02:00
Jeromy
88fa9726cc use chainmsg type instead of unsigned message for gas price checking 2020-05-14 12:44:26 -07:00
Jeromy
881b0517b1 reuse logic between message selection and validation 2020-05-14 12:29:11 -07:00
Jeromy
1d8c8b9a8e check gas limits on messages more places 2020-05-12 22:36:43 -07:00
Jeromy
368fff246b replace outdated comment 2020-05-05 12:39:43 -07:00
Jeromy
8b58f22c2e block producers should have only one address 2020-05-05 12:01:44 -07:00
Jeromy
be2a357102 winning post wants the actual epoch of the block, not the previous 2020-05-01 12:42:59 -07:00
Jeromy
bee25d221f fix mining base randomness 2020-04-30 15:11:14 -07:00
Jeromy
c4852e04c9 Use miner address in randomness mixing 2020-04-30 13:21:46 -07:00
Jeromy
4b3cc2ca7e fix winning post inputs 2020-04-30 11:27:22 -07:00
Jeromy
d73b369fa5 implement latest changes to randomness 2020-04-29 16:50:45 -07:00
Whyrusleeping
b2dda08368 respect shutdown signals when sleeping in miner code (#1617) 2020-04-27 15:54:41 -07:00