madara icon indicating copy to clipboard operation
madara copied to clipboard

bug: read only finalised `LogMessageToL2` events

Open apoorvsadana opened this issue 11 months ago • 8 comments

Currently, if I understand it correctly, Madara reads events instantly from the L1 even if they arne't finalised. First, we need to confirm this is the case. If it yes, we need to change this so that only finalised events are read.

apoorvsadana avatar Mar 19 '24 10:03 apoorvsadana

@apoorvsadana Picking this up

prtk418 avatar Mar 19 '24 13:03 prtk418

Sure, assgined

apoorvsadana avatar Mar 19 '24 19:03 apoorvsadana

Yes, right now Madara starts processing immediately as it receives events. Confirmed by checking code and logging L1 current block number and block number at which event was dispatched, both are same - meaning waiting for block confirmations are not in place.

Approach we could take is - instead of streaming events, we can watch for new blocks. On every new block production we can iterate through events of latest_block - block_confirmation block and process them

@apoorvsadana what do you think?

prtk418 avatar Mar 21 '24 06:03 prtk418

How will you watch for new blocks @prtk418? @tdelabro, are you aware how many blocks does Starknet wait for currently before it reads a message, is it 2 epochs?

apoorvsadana avatar Mar 21 '24 10:03 apoorvsadana

How will you watch for new blocks @prtk418? @tdelabro, are you aware how many blocks does Starknet wait for currently before it reads a message, is it 2 epochs?

Similar to stream_with_meta for events we have watch_blocks in ethers that we can use for watching blocks. Ref - https://docs.rs/ethers/latest/ethers/middleware/trait.Middleware.html#method.watch_blocks

prtk418 avatar Mar 21 '24 10:03 prtk418

As discussed with @apoorvsadana , its better to rely on rpc to tell us finalized blocks to be 100% deterministic and efficient. Will come back to this once we migrate to alloy

prtk418 avatar Mar 22 '24 17:03 prtk418

There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a 👍 Because this issue is marked as stale, it will be closed and locked in 7 days if no further activity occurs. Thank you for your contributions!

github-actions[bot] avatar Apr 22 '24 00:04 github-actions[bot]

blocked by #1532 #1528

tdelabro avatar Apr 26 '24 19:04 tdelabro

There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a 👍 Because this issue is marked as stale, it will be closed and locked in 7 days if no further activity occurs. Thank you for your contributions!

github-actions[bot] avatar Jun 06 '24 00:06 github-actions[bot]

still blocked

tdelabro avatar Jun 06 '24 09:06 tdelabro

There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a 👍 Because this issue is marked as stale, it will be closed and locked in 7 days if no further activity occurs. Thank you for your contributions!

github-actions[bot] avatar Jul 07 '24 00:07 github-actions[bot]

repository archived in favor of https://github.com/madara-alliance/madara

tdelabro avatar Aug 02 '24 18:08 tdelabro