Skip to content

Commit

Permalink
add LOG opcodes specification.
Browse files Browse the repository at this point in the history
  • Loading branch information
raulk committed Dec 27, 2022
1 parent f9fab73 commit 9b6e4b3
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions FIPS/fip-0054.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ We also introduce various changes to the Filecoin Virtual Machine and to client

The Filecoin EVM (FEVM) runtime actor runs EVM smart contracts compatible with the Ethereum Paris fork, supporting all relevant opcodes and Ethereum precompiles.
It does so by embedding an EVM interpreter, implementing the integration logic with the Filecoin environment, and translating all state I/O to the underlying IPLD model.
This FIP is dependent on FIP-0048 (f4 address class), FIP-0049 (actor events), and FIP-TODO.
This FIP is dependent on [FIP-0048] (f4 address class), [FIP-0049] (Actor events), and [FIP-0055] (Supporting Ethereum accounts, addresses, and transactions).

## Change Motivation

Expand Down Expand Up @@ -399,7 +399,26 @@ attoFIL (same precision as Ethereum).
**Hashing: KECCAK256.** Makes a syscall to `crypto::hash` with the supplied
preimage and the Keccak-256 multihash.

**Logging: LOG{0..4}.** TODO.
**Logging: LOG{0..4}.**

Logs in the Ethereum Virtual Machine are emitted through `LOG{0..4}` opcodes.
Each variant takes the specified number of topics (indexed).
All variants take a single memory slice referring to the data (non indexed).

We define `LOG{0..4}` opcodes to emit [FIP-0049] compliant actor events conforming to the following template:

```rust
// Values are encoded as DAG-CBOR byte strings.
ActorEvent {
entries: [
(0x03, "topic1", <first topic word>), // when LOG1, LOG2, LOG3, LOG4
(0x03, "topic2", <second topic word>), // when LOG2, LOG3, LOG4
(0x03, "topic3", <third topic word>), // when LOG3, LOG4
(0x03, "topic4", <fourth topic word>), // when LOG4
(0x02, "data", <data word>),
],
}
```

**Storage: SLOAD, SSTORE.** TODO.

Expand Down Expand Up @@ -850,7 +869,7 @@ Copyright and related rights waived via [CC0](https://creativecommons.org/public

[`filecoin-project/builtin-actors`]: https://github.com/filecoin-project/builtin-actors
[FRC42 calling convention]: https://github.com/filecoin-project/FIPs/blob/master/FRCs/frc-0042.md
[FIP-0048 (f4 Address Class)]: https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0048.md
[FIP-0048]: https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0048.md
[Contract ABI spec]: https://docs.soliditylang.org/en/v0.5.3/abi-spec.html
[Ethereum Paris hard fork]: https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/paris.md
[FIP-0049 (Actor events)]: https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0049.md
[Ethereum Paris hard fork]: https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/
[FIP-0049]: https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0049.md

0 comments on commit 9b6e4b3

Please sign in to comment.