polytope-labs / hyperbridge

Hyperbridge is a hyperscalable coprocessor for verifiable, cross-chain interoperability
https://docs.hyperbridge.network/
Apache License 2.0
107 stars 33 forks source link

tesseract messaging integration test fix #265

Closed MrishoLukamba closed 1 month ago

MrishoLukamba commented 1 month ago

refer to PR #251

seunlanlege commented 1 month ago

Get the request from the events in this call,

https://github.com/polytope-labs/hyperbridge/blob/02c2fab657dbf928ff07ea20f02297f971e0b637/tesseract/integration-test/src/lib.rs#L407

and pass it to this function

https://github.com/polytope-labs/hyperbridge/blob/02c2fab657dbf928ff07ea20f02297f971e0b637/tesseract/integration-test/src/lib.rs#L51-L56

so we can avoid this unnecessary search, which is the cause of the flakiness

https://github.com/polytope-labs/hyperbridge/blob/02c2fab657dbf928ff07ea20f02297f971e0b637/tesseract/integration-test/src/lib.rs#L67-L94

MrishoLukamba commented 1 month ago

Get the request from the events in this call,

https://github.com/polytope-labs/hyperbridge/blob/02c2fab657dbf928ff07ea20f02297f971e0b637/tesseract/integration-test/src/lib.rs#L407

and pass it to this function

https://github.com/polytope-labs/hyperbridge/blob/02c2fab657dbf928ff07ea20f02297f971e0b637/tesseract/integration-test/src/lib.rs#L51-L56

so we can avoid this unnecessary search, which is the cause of the flakiness

https://github.com/polytope-labs/hyperbridge/blob/02c2fab657dbf928ff07ea20f02297f971e0b637/tesseract/integration-test/src/lib.rs#L67-L94

The issue of getting the event from this function is I have to wait for tx to be executed ( wait for success) The issue for that is while tx is in block it sometimes yield invalid tx but at the same time the tx is valid and is executed ( hence leading to flakiness), Consider subxt docs belowScreenshot 2024-07-22 at 15 25 13

I will try to construct a Getrequest type and pass it, the issue is it is of different type ( subxt codegen type) and this yield error. But pushing commit soon

Wizdave97 commented 1 month ago

I suggest you look into why wait_for_success is flaky, there's also the option to use wait_for_finalized. It's a dev environment, transaction submission should be deterministic.

seunlanlege commented 1 month ago

I will try to construct a Getrequest type and pass it, the issue is it is of different type ( subxt codegen type) and this yield error. But pushing commit soon

You can write a From implementation

MrishoLukamba commented 1 month ago

I suggest you look into why wait_for_success is flaky, there's also the option to use wait_for_finalized. It's a dev environment, transaction submission should be deterministic.

should be deterministic yes, the issue is the tx do not fail but when you wait for finalization or sucess it returns tx status and among one status is Invalid, which when returned ( as it is probabilistic) based on their docs. the stream returns Err and breaks the test, meanwhile the tx is actually executed perfectly, So thats why i avoid using waiting for anything