flow-go icon indicating copy to clipboard operation
flow-go copied to clipboard

[EVM] Bridged account creation event consolidation

Open devbugging opened this issue 1 year ago • 2 comments

Currently, the event emitted for COA account creation doesn't have a type that is consistent with other EVM events. The event type ID right now is: A.f8d6e0586b0a20c7.EVM.BridgedAccountCreated.

This is wrong for two reasons:

  • we renamed bridged accounts to COA
  • other EVM service events have the ID schema of: EVM.{name}

The event should probably be renamed to: EVM.COACreated or EVM.CreatedCOA.

devbugging avatar Feb 20 '24 15:02 devbugging

I think we ideally should do the reverse, emitting all the events with type A.f8d6e0586b0a20c7.X then we don't need any special handling on access nodes or flow go. thoughts?

ramtinms avatar Feb 20 '24 18:02 ramtinms

then if we shard multiple EVMs the events won't cause any issue.

ramtinms avatar Feb 20 '24 18:02 ramtinms

Consensus is to move back to generic event type ID A.{address}.EVM.{name}

cc @ramtinms @m-Peter

devbugging avatar Apr 22 '24 17:04 devbugging

Sounds good :+1: This will only require a small change in the EVM Gateway, for the indexer component.

m-Peter avatar Apr 22 '24 17:04 m-Peter

We should also include the event definitions in the EVM contract itself, for example:

access(all)
event BlockExecuted(
    height: UInt64,
    hash: String,
    totalSupply: Int,
    parentHash: String,
    receiptRoot: String,
    transactionHashes: [String]
)

access(all)
event TransactionExecuted(
    blockHeight: UInt64,
    blockHash: String,
    transactionHash: String,
    encodedTransaction: String,
    failed: Bool,
    vmError: String,
    transactionType: UInt8,
    gasConsumed: UInt64,
    deployedContractAddress: String,
    returnedValue: String,
    logs: String
)

This will be helpful for other tools (such as the Cadence testing framework), to make use of these types.

m-Peter avatar Apr 23 '24 07:04 m-Peter

The consensus was to just rollback special even type IDs for EVM, and use the generic type ID signature.

devbugging avatar Apr 25 '24 16:04 devbugging