Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(evm-precompile): Emit ABCI events as EVM events #2121

Closed
Unique-Divine opened this issue Dec 11, 2024 · 0 comments · Fixed by #2125
Closed

feat(evm-precompile): Emit ABCI events as EVM events #2121

Unique-Divine opened this issue Dec 11, 2024 · 0 comments · Fixed by #2125
Labels
S-triage Status: This issue is waiting on initial triage. More Info: https://tinyurl.com/25uty9w5

Comments

@Unique-Divine
Copy link
Member

Emitting EVM Events

Ethereum logs are emitted at the end of an EVM transaction by reading the logs
stored in the StateDB during transaction execution.

This happens in the applyTransaction function from
"go-ethereum/core/state_processor.go":

	receipt.Logs = statedb.GetLogs(tx.Hash(), blockHash)

During execution, these logs are built up when LOG opcodes (LOG0, LOG1, ...) are executed.

Logs are incldued as part of the tx receipt in the block and stored off-chain but
indexed and retrievable by EVM nodes and APIs via "eth_getLogs" and
"eth_getTransactionReceipt".

Problem / Abstract

Precompile contracts are a bit opaque in that they can execute loads of
operations across Nibiru modules without revealing the underlying behavior in EVM
explorers. It is however possible to emit events like normal smart contracts
would using the "go-ethereum/accounts/abi" types directly.

The goal of this ticket is to emit useful ABCI events on the EVM side during
state-changing precompiled contract calls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-triage Status: This issue is waiting on initial triage. More Info: https://tinyurl.com/25uty9w5
Projects
Status: ✅ Completed
1 participant