Conversation
7696425 to
463ee74
Compare
|
@karlem Another question I have is regarding nonce. Say a bottom up message is created in L3, the nonce will be set by the local network. Then in L2, will the cross network message nonce change? If so, then the id ( |
Hmm that's a good point. I will think about how to mitigate this. |
0d896a7 to
ff75e79
Compare
|
@cryptoAtwill should be ready for another review :) |
cryptoAtwill
left a comment
There was a problem hiding this comment.
LGTM. But I do have a few follow up questions though:
- Does it work in calibration with a live 3 level network? Is there a testnet we can try or planned?
propagateAllis called in the parent as part of bottom up checkpoint. Bottom up checkpoint is already quite gas costly, not sure if this will burst the gas even more.
|
|
||
| /// @notice Returns a deterministic hash for the given cross message. The hash remains the same accross different networks | ||
| /// because it doesn't include the network-specific nonce. | ||
| function toDeterministicHash(IpcEnvelope memory crossMsg) internal pure returns (bytes32) { |
There was a problem hiding this comment.
I guess most of the time this is ok, but will this cause conflict if say someone sends the same message twice?
There was a problem hiding this comment.
It might collide, but it is only for logging so it should not matter.
There was a problem hiding this comment.
Hm, this is not great; I'd rather have the protocol generate a message ID at origin and propagate that even inside the IpcEnvelope, even if it costs a few little more gas for the extra bytes.
Also, if this is only used for tracing, it's best to signal that by calling this method: toTracingId?
It should. Whether is Calibration or not.
We don't really have any other option here. I don't think we really optimise for gas efficiency at this stage. Moving forward we might re-write the contracts L2+ as native actors to make it cheaper. |
e28e275 to
ff75e79
Compare
There was a problem hiding this comment.
I think this is no longer correct: https://github.com/consensus-shipyard/ipc/pull/1157/files#diff-71559bfe927afaf1a3980c01ffe9f4d15c77d58650b2d850bbae821de9c009d0R49.
This implicitly assumes the token behind envelop.value is the native token in the origin subnet. If say I want to trigger transfer from address A to address B in L1 and I'm sending from L3, why should I attach that amount in msg.value?
It comes back to the definition of envelop.value, is it just the native token transfer in the target subnet. If this is the case, it does not make sense to have this check.
a7c17ee to
e514fdb
Compare
|
@cryptoAtwill The issue was resolved by not using or supporting native token transfers in the Call message. |
17344aa to
28209f8
Compare
|
This looks good to me. Just one more thing regarding the tests, shall we also add nonce check to bottom up, just make sure it's correct? |
raulk
left a comment
There was a problem hiding this comment.
Some initial feedback. Removing the ability to send value in calls is a no-go. See inline comments for more context. It will be very common for subnets denominated in the same asset to want to interact with one another sending value and calling some logic in an atomic manner.
@karlem can you please detail the rationale for having removed this? Was it due to the risk of supply source mismatches across the hierarchy during a multi-hop? We had logic to prevent this here:
ipc/contracts/contracts/lib/LibGateway.sol
Lines 499 to 513 in 4243ff9
So curious to hear why that was insufficient, or why strengthening the validation to detect supply source mismatches was a no-go?
|
|
||
| /// @notice Returns a deterministic hash for the given cross message. The hash remains the same accross different networks | ||
| /// because it doesn't include the network-specific nonce. | ||
| function toDeterministicHash(IpcEnvelope memory crossMsg) internal pure returns (bytes32) { |
There was a problem hiding this comment.
Hm, this is not great; I'd rather have the protocol generate a message ID at origin and propagate that even inside the IpcEnvelope, even if it costs a few little more gas for the extra bytes.
Also, if this is only used for tracing, it's best to signal that by calling this method: toTracingId?
Co-authored-by: Karel Moravec <[email protected]> Co-authored-by: cryptoAtwill <[email protected]>
Co-authored-by: cryptoAtwill <[email protected]>
c3aea65 to
fab6ae5
Compare
Part of #1080
This PR focuses on:
Integration Tests in Solidity (L3-Level Testing)
Improvements
CheckpointCommittedNewBottomUpMessageMessageStoredInPostboxMessagePropagatedFromPostboxTODOs