filecoin-project / lotus

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

"lotus state compute-state --html" Broken after fvm upgrade #8636

Closed geoff-vball closed 2 years ago

geoff-vball commented 2 years ago

Checklist

Lotus component

Lotus Version

Daemon:  1.15.2-dev+interopnet+git.0295d2274.dirty+api1.5.0
Local: lotus version 1.15.2-dev+interopnet+git.0295d2274.dirty

Describe the Bug

When running lotus state compute-state --html, the output contains the error ERROR: template: message:3:24: executing "message" at <.Msg.To>: nil pointer evaluating *types.Message.To.

This error only occurs when looking at the state after the FVM upgrade (3000 on interopnet).

Logging Information

.

Repo Steps

lotus state compute-state --html

jennijuju commented 2 years ago

the message cannot be interpreted is from system actor to reward actor , seems like the getCode made be a bit off in https://github.com/filecoin-project/lotus/blob/27e99ff84faa29fe0060ecddb21b5af1e2dd7a78/cli/state.go#L1193

Stebalien commented 2 years ago

So, the issue is likely that execution tracing wasn't enabled for this message. Due to how execution tracing currently works in the FVM, we'll end up with an "empty" message.

The lotus VM would always include the root message, even when tracing was disabled.

jennijuju commented 2 years ago

@arajasek given what steb said - should we expect the issue shouldn't exist when setting LOTUS_VM_ENABLE_GAS_TRACING_VERY_SLOW to be 1?

arajasek commented 2 years ago

@jennijuju No, we expect the issue to exist in all cases (before this fix) -- the problem is that we were only trying to set the execution trace if we had an FVM execution trace (which we did when we had LOTUS_VM_ENABLE_GAS_TRACING_VERY_SLOW=1).

So in the LOTUS_VM_ENABLE_GAS_TRACING_VERY_SLOW=0 case, we would basically just set the execution trace to be nil (because et would be nil on this line https://github.com/filecoin-project/lotus/pull/8706/files#diff-9c51c6db9b9f6bea9717d162a7f80db6e0e144032849d83281750e3226d17ccaL359).