Skip to content

Commit

Permalink
Merge pull request #3 from matter-labs/nikita/gateway-release-candidate
Browse files Browse the repository at this point in the history
use DataEncoding for consistency and fix comments
  • Loading branch information
StanislavBreadless authored Nov 15, 2024
2 parents 9d0ffa4 + 5865717 commit 6213f74
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ contract L1AssetRouter is AssetRouterBase, IL1AssetRouter, ReentrancyGuard {
bytes32 _assetRegistrationData,
address _assetDeploymentTracker
) external onlyOwner {
bytes32 assetId = keccak256(abi.encode(block.chainid, _assetDeploymentTracker, _assetRegistrationData));
bytes32 assetId = DataEncoding.encodeAssetId(block.chainid, _assetRegistrationData, _assetDeploymentTracker);
assetDeploymentTracker[assetId] = _assetDeploymentTracker;
emit AssetDeploymentTrackerSet(assetId, _assetDeploymentTracker, _assetRegistrationData);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,9 @@ contract ExecutorFacet is ZKChainBase, IExecutor {
}
}

// We only require 8 logs to be checked, the 9th is if we are expecting a protocol upgrade
// Without the protocol upgrade we expect 8 logs: 2^8 - 1 = 255
// With the protocol upgrade we expect 9 logs: 2^9 - 1 = 511
// We only require 7 logs to be checked, the 8th is if we are expecting a protocol upgrade
// Without the protocol upgrade we expect 7 logs: 2^7 - 1 = 127
// With the protocol upgrade we expect 8 logs: 2^8 - 1 = 255
if (_expectedSystemContractUpgradeTxHash == bytes32(0)) {
if (processedLogs != 127) {
revert MissingSystemLogs(127, processedLogs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ interface IAdmin is IZKChainBase {
function upgradeChainFromVersion(uint256 _protocolVersion, Diamond.DiamondCutData calldata _cutData) external;

/// @notice Executes a proposed governor upgrade
/// @dev Only the current admin can execute the upgrade
/// @dev Only the ChainTypeManager contract can execute the upgrade
/// @param _diamondCut The diamond cut parameters to be executed
function executeUpgrade(Diamond.DiamondCutData calldata _diamondCut) external;

Expand Down
4 changes: 2 additions & 2 deletions l1-contracts/test/foundry/l1/integration/DeploymentTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,12 @@ contract DeploymentTests is L1ContractDeployer, ZKChainDeployer, TokenDeployer,

address bridgehubStmForChain = bridgehub.chainTypeManager(chainId);
bytes32 bridgehubBaseAssetIdForChain = bridgehub.baseTokenAssetId(chainId);
address bridgehubChainAddressdForChain = bridgehub.getZKChain(chainId);
address bridgehubChainAddressForChain = bridgehub.getZKChain(chainId);
address bhAddr = IZKChain(chain).getBridgehub();

assertEq(bridgehubStmForChain, stmAddr);
assertEq(bridgehubBaseAssetIdForChain, baseTokenAssetId);
assertEq(bridgehubChainAddressdForChain, chain);
assertEq(bridgehubChainAddressForChain, chain);
assertEq(bhAddr, address(bridgehub));
}

Expand Down

0 comments on commit 6213f74

Please sign in to comment.