Skip to content

Commit 32bcc07

Browse files
authored
Merge pull request #2378 from Stebalien/steb/explain-blockhash-diff
FEVM: document the differences in the Filecoin BLOCKHASH instruction
2 parents fa0fe3f + adbf6a6 commit 32bcc07

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

smart-contracts/filecoin-evm-runtime/difference-with-ethereum.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ Filecoin EVM runtime emulates EVM self-destruct behavior but isn’t able to ent
3636

3737
The `CALLCODE` opcode has not been implemented. Use the newer `DELEGATECALL` opcode.
3838

39+
## BLOCKHASH
40+
41+
Ethereum has one block at every height while Filecoin can have none, one, or many (usually around 4-5). This means that the `BLOCKHASH` instruction behaves a bit differently in the Filecoin EVM:
42+
43+
- Because there can be multiple blocks at any given height, `BLOCKHASH` returns the hash of all the concatenation of the CIDs of all the blocks at the requested height.
44+
- Because there can be no blocks at any given height, if `BLOCKHASH` is called on a height with _no blocks_, it returns the `BLOCKHASH` of the first preceding height with blocks.
45+
3946
## Bare-value sends
4047

4148
In Ethereum, `SELFDESTRUCT` is the only way to send funds to a smart contract without giving the target smart contract a chance to execute code.

0 commit comments

Comments
 (0)