Open cryptoAtwill opened 2 days ago
Because of https://github.com/consensus-shipyard/ipc/issues/1225, the current approach of scanning events emitted from postbox will not work. There will be missing events.
The nonce handling is incorrect. Only the first xnet message will work, subsequent ones will fail.
The scenario is sending TWO cross network message from L1 to L3. This is the first ever L1 topdown message, so for the cross message itself, the nonce is 0.
On L2, topdown finality will have the message applied. It gets committed with appliedNonce increase by 1. Then the committed message in postbox is propagated. Internally it calls commitValidatedCrossMessage and appliedNonce is incremented again by 1.
The overall effect is one xnet message from L1 to L3 will increase the applied nonce by 2. This is observed when testing in calibration.
The second cross network message from L1 to L3 will have nonce == 1, the nonce will not match.
After an initial round of testing with L2+ feature, here is a list of todos to consider:
subnet.circSupply
. Not sure if this variable is tracked correctly. This value is deducted byIPCEnvelop.value
regardless message type? But only increased (after bootstrap) when message is Transfer.ret
bytes. The way that encodes the error is using encodeWithSelector, but for L2+ error is just encode, it's kind of confusing for debugging to tell which decode method to use.