Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Remove name #243

Merged
merged 1 commit into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
326 changes: 163 additions & 163 deletions .storage-layouts/GatewayActorModifiers.json

Large diffs are not rendered by default.

324 changes: 162 additions & 162 deletions .storage-layouts/GatewayDiamond.json

Large diffs are not rendered by default.

246 changes: 119 additions & 127 deletions .storage-layouts/SubnetActorDiamond.json

Large diffs are not rendered by default.

248 changes: 120 additions & 128 deletions .storage-layouts/SubnetActorModifiers.json

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions src/SubnetActorDiamond.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ contract SubnetActorDiamond {

struct ConstructorParams {
SubnetID parentId;
bytes32 name;
address ipcGatewayAddr;
ConsensusType consensus;
uint256 minActivationCollateral;
Expand Down Expand Up @@ -52,7 +51,6 @@ contract SubnetActorDiamond {
LibDiamond.diamondCut({_diamondCut: _diamondCut, _init: address(0), _calldata: new bytes(0)});

s.parentId = params.parentId;
s.name = params.name;
s.ipcGatewayAddr = params.ipcGatewayAddr;
s.consensus = params.consensus;
s.minActivationCollateral = params.minActivationCollateral;
Expand Down
2 changes: 0 additions & 2 deletions src/lib/LibSubnetActorStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ struct SubnetActorStorage {
uint64 bottomUpCheckPeriod;
/// @notice Minimal number of validators required for the subnet to be able to validate new blocks.
uint64 minValidators;
/// @notice Human-readable name of the subnet.
bytes32 name;
// @notice Hash of the current subnet id
bytes32 currentSubnetHash;
/// @notice Address of the IPC gateway for the subnet
Expand Down
4 changes: 0 additions & 4 deletions src/subnet/SubnetActorGetterFacet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ contract SubnetActorGetterFacet {
return s.minActivationCollateral;
}

function name() external view returns (bytes32) {
return s.name;
}

/// @notice Get the information of a validator
function getValidator(address validatorAddress) external view returns (ValidatorInfo memory validator) {
validator = s.validatorSet.validators[validatorAddress];
Expand Down
2 changes: 0 additions & 2 deletions test/GatewayDiamond.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ contract GatewayDiamondDeploymentTest is StdInvariant, Test {

uint64 constant MAX_NONCE = type(uint64).max;
address constant BLS_ACCOUNT_ADDREESS = address(0xfF000000000000000000000000000000bEefbEEf);
bytes32 private constant DEFAULT_NETWORK_NAME = bytes32("test");
uint64 private constant DEFAULT_MIN_VALIDATORS = 1;
uint8 private constant DEFAULT_MAJORITY_PERCENTAGE = 70;
uint64 constant DEFAULT_COLLATERAL_AMOUNT = 1 ether;
Expand Down Expand Up @@ -234,7 +233,6 @@ contract GatewayDiamondDeploymentTest is StdInvariant, Test {

SubnetActorDiamond.ConstructorParams memory saConstructorParams = SubnetActorDiamond.ConstructorParams({
parentId: SubnetID({root: ROOTNET_CHAINID, route: new address[](0)}),
name: DEFAULT_NETWORK_NAME,
ipcGatewayAddr: address(gatewayDiamond),
consensus: ConsensusType.Fendermint,
minActivationCollateral: DEFAULT_COLLATERAL_AMOUNT,
Expand Down
11 changes: 0 additions & 11 deletions test/SubnetActorDiamond.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ contract SubnetActorDiamondTest is Test {

address private constant DEFAULT_IPC_GATEWAY_ADDR = address(1024);
uint64 private constant DEFAULT_CHECKPOINT_PERIOD = 10;
bytes32 private constant DEFAULT_NETWORK_NAME = bytes32("test");
uint256 private constant DEFAULT_MIN_VALIDATOR_STAKE = 1 ether;
uint64 private constant DEFAULT_MIN_VALIDATORS = 1;
string private constant DEFAULT_NET_ADDR = "netAddr";
Expand Down Expand Up @@ -92,7 +91,6 @@ contract SubnetActorDiamondTest is Test {
gatewayAddress = address(gatewayContract);

_assertDeploySubnetActor(
DEFAULT_NETWORK_NAME,
gatewayAddress,
ConsensusType.Fendermint,
DEFAULT_MIN_VALIDATOR_STAKE,
Expand All @@ -115,7 +113,6 @@ contract SubnetActorDiamondTest is Test {
}

function testSubnetActorDiamond_Deployment_Works(
bytes32 _networkName,
address _ipcGatewayAddr,
uint256 _minActivationCollateral,
uint64 _minValidators,
Expand All @@ -129,7 +126,6 @@ contract SubnetActorDiamondTest is Test {
vm.assume(_ipcGatewayAddr != address(0));

_assertDeploySubnetActor(
_networkName,
_ipcGatewayAddr,
ConsensusType.Fendermint,
_minActivationCollateral,
Expand All @@ -152,7 +148,6 @@ contract SubnetActorDiamondTest is Test {
createSubnetActorDiamondWithFaucets(
SubnetActorDiamond.ConstructorParams({
parentId: SubnetID(ROOTNET_CHAINID, new address[](0)),
name: DEFAULT_NETWORK_NAME,
ipcGatewayAddr: address(0),
consensus: ConsensusType.Fendermint,
minActivationCollateral: DEFAULT_MIN_VALIDATOR_STAKE,
Expand Down Expand Up @@ -689,7 +684,6 @@ contract SubnetActorDiamondTest is Test {
// }

function _assertDeploySubnetActor(
bytes32 _name,
address _ipcGatewayAddr,
ConsensusType _consensus,
uint256 _minActivationCollateral,
Expand Down Expand Up @@ -724,7 +718,6 @@ contract SubnetActorDiamondTest is Test {
diamondCut,
SubnetActorDiamond.ConstructorParams({
parentId: _parentId,
name: _name,
ipcGatewayAddr: _ipcGatewayAddr,
consensus: _consensus,
minActivationCollateral: _minActivationCollateral,
Expand All @@ -739,10 +732,6 @@ contract SubnetActorDiamondTest is Test {
saManager = SubnetManagerTestUtil(address(saDiamond));
saGetter = SubnetActorGetterFacet(address(saDiamond));

require(
keccak256(abi.encodePacked(saGetter.name())) == keccak256(abi.encodePacked(_name)),
"keccak256(abi.encodePacked(saGetter.name())) == keccak256(abi.encodePacked(_networkName))"
);
require(saGetter.ipcGatewayAddr() == _ipcGatewayAddr, "saGetter.ipcGatewayAddr() == _ipcGatewayAddr");
require(
saGetter.minActivationCollateral() == _minActivationCollateral,
Expand Down
6 changes: 0 additions & 6 deletions test/SubnetRegistry.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ contract SubnetRegistryTest is Test {
function test_Registry_Deployment_DifferentGateway() public {
SubnetActorDiamond.ConstructorParams memory params = SubnetActorDiamond.ConstructorParams({
parentId: SubnetID({root: ROOTNET_CHAINID, route: new address[](0)}),
name: DEFAULT_NETWORK_NAME,
ipcGatewayAddr: address(1),
consensus: ConsensusType.Fendermint,
minActivationCollateral: DEFAULT_MIN_VALIDATOR_STAKE,
Expand All @@ -86,7 +85,6 @@ contract SubnetRegistryTest is Test {
vm.startPrank(DEFAULT_SENDER);
SubnetActorDiamond.ConstructorParams memory params = SubnetActorDiamond.ConstructorParams({
parentId: SubnetID({root: ROOTNET_CHAINID, route: new address[](0)}),
name: DEFAULT_NETWORK_NAME,
ipcGatewayAddr: DEFAULT_IPC_GATEWAY_ADDR,
consensus: ConsensusType.Fendermint,
minActivationCollateral: DEFAULT_MIN_VALIDATOR_STAKE,
Expand All @@ -105,7 +103,6 @@ contract SubnetRegistryTest is Test {
vm.startPrank(DEFAULT_SENDER);
SubnetActorDiamond.ConstructorParams memory params = SubnetActorDiamond.ConstructorParams({
parentId: SubnetID({root: ROOTNET_CHAINID, route: new address[](0)}),
name: DEFAULT_NETWORK_NAME,
ipcGatewayAddr: DEFAULT_IPC_GATEWAY_ADDR,
consensus: ConsensusType.Fendermint,
minActivationCollateral: DEFAULT_MIN_VALIDATOR_STAKE,
Expand All @@ -122,7 +119,6 @@ contract SubnetRegistryTest is Test {

function test_Registry_Deployment_Works() public {
_assertDeploySubnetActor(
DEFAULT_NETWORK_NAME,
DEFAULT_IPC_GATEWAY_ADDR,
ConsensusType.Fendermint,
DEFAULT_MIN_VALIDATOR_STAKE,
Expand All @@ -134,7 +130,6 @@ contract SubnetRegistryTest is Test {
}

function _assertDeploySubnetActor(
bytes32 _name,
address _ipcGatewayAddr,
ConsensusType _consensus,
uint256 _minActivationCollateral,
Expand All @@ -146,7 +141,6 @@ contract SubnetRegistryTest is Test {
vm.startPrank(DEFAULT_SENDER);
SubnetActorDiamond.ConstructorParams memory params = SubnetActorDiamond.ConstructorParams({
parentId: SubnetID({root: ROOTNET_CHAINID, route: new address[](0)}),
name: _name,
ipcGatewayAddr: _ipcGatewayAddr,
consensus: _consensus,
minActivationCollateral: _minActivationCollateral,
Expand Down
Loading