filecoin-project / lotus

Reference implementation of the Filecoin protocol, written in Go
https://lotus.filecoin.io/
Other
2.81k stars 1.25k forks source link

Error message enhancement: "actor not found" (aka Insufficient FIL) #8817

Closed wesfloyd closed 2 years ago

wesfloyd commented 2 years ago

Checklist

Lotus component

Lotus Version

v1.15.3

Describe the Bug

To reproduce: Attempting to create a Lotus deal with no FIL in my wallet I encountered the error "resolve address f1qim...jjy: actor not found"

Expected result: Error message would inform the user they have insufficient FIL in their wallet. E.g. "Insufficient funds in wallet for this transaction"

Actual result: Error message does not communicate the user's issue (mistake) "ERROR: resolve address f1qim...jjy: actor not found"

wfmb14:launchpad wes$ lotus client deal
Data CID (from lotus client import): bafykbzacebp52galmm6yb5kqr46s7n3hglgv43wyos7zvywlrdvmlom4ficb6
.. calculating data size
Deal duration (days): 180
ERROR: resolve address f1qim6rnkdnqk5mgo6b2675jxvw3xaefhrwozljjy: actor not found

Logging Information

messagepool
disputer
bitswap
bs:sprmgr
fsm
peerstore/ds
blockservice
cmds/http
dagstore/upgrader
dht/RtRefreshManager
fsjournal
engine
graphsync_allocator
badger
chainxchg
rpcenc
relay
preseal
gs-queryexecutor
miner
market_adapter
go-legs/head
pubsub
dht.pb
retrievaladapter
client
idxprov
retrieval
incrt
p2p-holepunch
rcmgr
upgrader
mocknet
filestore
bs:peermgr
retrieval_network
partialfile
repo
fil-consensus
metrics-prometheus
swarm2
peerstore
data-transfer
gs-reconciledlaoder
fsutil
bitswap_network
sub
provider/engine
cli
markets-rtvl-reval
build
statetree
chainstore
advmgr
actors
gs-notifications
payment-channel-settler
basichost
blankhost
boguskey
fullnode
bs:sess
retrieval-discovery
drand
builder
metrics
tarutil
rand
connmgr
p2p-config
events
storageadapter
discovery
routing/record
pathresolv
hello
ffi-wrapper
autonat
system
storageminer
go-legs-httpsync
data_transfer_network
backupds
ipns
wallet
retrievalmarket_impl
chunk
stores
diversityFilter
nat
gen
go-legs
paych
storagemarket_network
providers
gs_request_executor
go-legs-dtsync
lock
table
autorelay
sectoraccessor
chain
evtsm
wallet-ledger
retrieval-fsm
storagemarket_impl
go-legs-gpubsub
watchdog
test-logger
alerting
vm
reuseport-transport
main
cmds
beacon
cliutil
dagstore
dt_graphsync
graphsync
piecestore
importmgr
ffiwrapper
messagesigner
genesis
unixfs
ulimit
tcp-tpt
conngater
dt-impl
blockstore
amt
quic-transport
eventlog
auth
statemgr
tracing
paramfetch
pstoremanager
ping
p2pnode
splitstore
chunker/cached-entries-chunker
types
badgerbs
markets
sectors
net/identify
markets-rtvl
graphsync_network
rpc
storagemrkt
panic-reporter
dht
providerstates
routedhost
peermgr
net/conngater
storedask
modules
cborrrpc
p2p-circuit
dt-chanmon
indexer/schema
node

Repo Steps

  1. Run '...'

  2. Do '...'

  3. See error '...' ...

  4. Run: attempt to create a Lotus deal with no FIL in the wallet: "lotus client deal"

  5. See "ERROR: resolve address f1qim...jjy: actor not found"

rjan90 commented 2 years ago

Hey @wesfloyd! Thanks for the issue report. I agree that the error message could be more describing in this context, and that we could describe better that a fresh wallet needs to have some funds (or DataCap) sent to it to be initialized/recognized by the chain.

I also think this error should be caught a bit earlier, instead of halfway through the lotus client deal flow. It seems like we do not check if the actor (address in this case) is on chain before starting the uiLoop: https://github.com/filecoin-project/lotus/blob/e3f1eb29a14c7acb198e21b86aba1ada74c2cbb1/cli/client.go#L547-L565

So it only errors out when we get to this part in the uiLoop when checking if the given address has a datacap: https://github.com/filecoin-project/lotus/blob/e3f1eb29a14c7acb198e21b86aba1ada74c2cbb1/cli/client.go#L640-L642