ChainSafe / ChainBridge

🌉 Modular Multi-Directional Blockchain Bridge to interact with Multiple Networks; Ethereum, Ethereum Classic, Substrate, based chains. Stay tuned for ChainBridge Hub!
GNU Lesser General Public License v3.0
474 stars 300 forks source link

Confuse about processing deposit event in listener #730

Closed chzyer closed 2 years ago

chzyer commented 2 years ago

Hi, guys.

I'm reading the sourcecode from getDepositEventsForBlock in listener.go

I found that after it parsed the event, it still needed to initial a contract call to get the msg.Message back. Maybe there is a way, for example, encoding the message and wrote it to event as the latest argument, to avoid the RPC call.

Maybe there are some restrictions stoping us to make it real ? Thanks for sharing why we don't write the message into event ..

P1sar commented 2 years ago

Hey @chzyer! You mean this call https://github.com/ChainSafe/ChainBridge/blob/8cee3ff157224d18ccc214002548aa5bd75f52ef/chains/ethereum/events.go#L14 ?

chzyer commented 2 years ago

yes

P1sar commented 2 years ago

This was done so long time ago so it is difficult to remember why. But we already have changed this approach in our new chainbridge relayers and smart contracts
https://github.com/ChainSafe/chainbridge-core https://github.com/ChainSafe/chainbridge-solidity

chzyer commented 2 years ago

Thanks a lot.