feat(AggLayer): add leafType param to CLAIM note#2290
Conversation
2e892d4 to
c940064
Compare
partylikeits1983
left a comment
There was a problem hiding this comment.
Looks good, but instead of setting the leafValue as a parameter to the CLAIM note, it should be a constant that we pass when we call get_leaf_value. This mirrors more closely the agglayer solidity contracts.
See how _LEAF_TYPE_ASSET is a constant that is passed to getLeafValue: https://github.com/agglayer/agglayer-contracts/blob/e468f9b0967334403069aa650d9f1164b1731ebb/contracts/v2/previousVersions/pessimistic/PolygonZkEVMBridgeV2Pessimistic.sol#L479
The CLAIM note inputs should match pretty much 1:1 the data of this function call:
|
@partylikeits1983 Agreed! Thanks for pointing this out. (btw, let's make sure we reference the right AggLayer contracts: https://github.com/agglayer/agglayer-contracts/blob/e468f9b0967334403069aa650d9f1164b1731ebb/contracts/v2/PolygonZkEVMBridgeV2.sol#L55, instead of "previousVersions") |
|
@partylikeits1983 I ended up implementing something halfway, where the
So we could in theory not put LMK if you find another place to inject it. |
fix after merge
afa04a1 to
998c6cd
Compare
|
@partylikeits1983 since the recent |
partylikeits1983
left a comment
There was a problem hiding this comment.
Looks good! Makes sense to put the leaf type as part of the CLAIM note inputs
* feat: add leafType param fix after merge * changelog
As per the description in #2276, we were missing
leafType. As a result of adding this, I've slightly restructured the note input data as well. The full list of interconnected changes is as follows:CLAIMnote should carry aleaf_type, which is set to0u32for asset transfers, and1u32for message passingFelt::ZEROafterleaf_typeLEAF_DATA_WORD_LENfrom 6 to 8 words (=32 Felts)AccountIdinget_destination_account_id, use constants instead of hardcoded values