paritytech / polkadot-sdk

The Parity Polkadot Blockchain SDK
https://polkadot.network/
1.8k stars 652 forks source link

Move contract emitted topics from being an actual topic to be just included into the event body #5629

Closed athei closed 2 weeks ago

athei commented 3 weeks ago

No longer forward the topics that a contract passes as substrate topics ( https://paritytech.github.io/polkadot-sdk/master/frame_system/pallet/struct.Pallet.html#method.deposit_event_indexed ). Those are super costly as each of them incurs a storage write. Instead, just move them into the event body itself by adding a field for the topics here: https://github.com/paritytech/polkadot-sdk/blob/b2089d88bd6ef40ca17ddfa097b05b257cdcdf13/substrate/frame/revive/src/lib.rs#L421-L427