-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support l2 plus #1157
base: main
Are you sure you want to change the base?
feat: support l2 plus #1157
Conversation
7696425
to
463ee74
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor comments.
function down(SubnetID calldata subnet1, SubnetID calldata subnet2) public pure returns (SubnetID memory) { | ||
if (subnet1.root != subnet2.root) { | ||
revert DifferentRootNetwork(); | ||
return SubnetID({root: 0, route: new address[](0)}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a reason why it's not reverted? Feels like it's an error that should be handled instead of introducing root = 0
as invalid subnet. Probably in some use cases root: 0, route: []
is a valid use case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like this needs multi-return? SubnetID + bool?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem here is that if I revert, I lose control elsewhere. The method is also used invalidateCrossMessage
, where reverting is not desirable. Additionally, commonParent
method here returns the empty subnet ID instead of reverting. But I understand your point—if this were deployed on Ethereum, the root could be zero. Would returning a boolean (indicating whether it was found or not) help?
@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 ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some initial comments.
IPCAddress({ | ||
subnetId: gatewayDiamond.getter().getNetworkName().getParentSubnet(), | ||
rawAddress: FvmAddressHelper.from(receipient) | ||
}), | ||
IPCAddress({subnetId: id, rawAddress: FvmAddressHelper.from(address(this))}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it was labeled as a top-down message, but the path (from, to) made it a bottom-up message, the test was incorrect. Since we now have checks ensuring that top-down messages are indeed top-down (as a parent can't send a message to itself), this would cause a revert.
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 :) |
Part of #1080
This PR focuses on:
Integration Tests in Solidity (L3-Level Testing)
Improvements
CheckpointCommitted
NewBottomUpMessage
MessageStoredInPostbox
MessagePropagatedFromPostbox