You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is not a security-related bug/issue. If it is, please follow please follow the security policy.
I have searched on the issue tracker and the lotus forum, and there is no existing related issue or discussion.
I am running the Latest release, the most recent RC(release canadiate) for the upcoming release or the dev branch(master), or have an issue updating to any of these.
I did not make any code changes to lotus.
Lotus component
lotus daemon - chain sync
lotus fvm/fevm - Lotus FVM and FEVM interactions
lotus miner/worker - sealing
lotus miner - proving(WindowPoSt/WinningPoSt)
lotus JSON-RPC API
lotus message management (mpool)
Other
Lotus Version
Using lotus API:
`github.com/filecoin-project/lotus v1.26.1-0.20240408080634-e68b762b40cd`
Repro Steps
No response
Describe the Bug
When running simulations against FEVM smart contracts using the ExecuteMessage function
, the Timestamp field needs to be populated in order for block.timestamp to propagate with data. The result is that any smart contracts that rely on block.timestamp to compute their logic will likely fail, as block.timestamp is always zero.
A few (probably naive) ways to fix:
We treat the VM like mainnet (i.e. chainID 314) and we use the legitimate timestamp for the given epoch. This requires some extra work, as we need to know the genesis epoch or genesis timestamp in order to compute the timestamp at any future epoch. I couldn't see these values coded as constants anywhere, so not sure the best way to arrive at these values
We simply pass the current timestamp (i.e. time.Now()) and treat the passed epoch as "ChainHead".
The caller passes Timestamp through via the MessageParams struct. This is likely my favorite as its most flexible for the caller.
Logging Information
N/A
The text was updated successfully, but these errors were encountered:
Checklist
Latest release
, the most recent RC(release canadiate) for the upcoming release or the dev branch(master), or have an issue updating to any of these.Lotus component
Lotus Version
Repro Steps
No response
Describe the Bug
When running simulations against FEVM smart contracts using the
ExecuteMessage
functionlotus/conformance/driver.go
Line 216 in 1cdca19
Timestamp
field needs to be populated in order forblock.timestamp
to propagate with data. The result is that any smart contracts that rely onblock.timestamp
to compute their logic will likely fail, asblock.timestamp
is always zero.A few (probably naive) ways to fix:
time.Now()
) and treat the passed epoch as "ChainHead".Timestamp
through via theMessageParams
struct. This is likely my favorite as its most flexible for the caller.Logging Information
The text was updated successfully, but these errors were encountered: