-
Notifications
You must be signed in to change notification settings - Fork 23
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
Tests use permissionless l1 #641
base: main
Are you sure you want to change the base?
Conversation
/** | ||
* @notice Returns the ERC20 token being staked | ||
*/ | ||
function erc20() external view returns (IERC20Mintable) { |
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.
I added this to allow the deployment utility to return an IPoSValidatorManager
object, and recover the ERC20
instance after the fact. It also seems reasonable that use cases will emerge that will want to access the staked asset programatically.
--exc $filtered_contracts | ||
echo "Generating Go bindings for $contract_name..." | ||
|
||
if [ -z "$filtered_contracts" ]; then |
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.
This addresses an edge case in which the only contract in the combined JSON is the contract to compile itself. In that case, there are no contracts to exclude.
@@ -202,6 +363,37 @@ func (n *LocalNetwork) GetPrimaryNetworkInfo() interfaces.SubnetTestInfo { | |||
} | |||
} | |||
|
|||
func (n *LocalNetwork) GetSubnetInfo(subnetID ids.ID) interfaces.SubnetTestInfo { | |||
for _, subnet := range n.Network.Subnets { |
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.
There are a handful of places where we do a linear search over the subnets and nodes. I didn't think it was worth migrating to maps for random access, given that we're only ever searching over a handful of subnets/nodes.
Expect(err).Should(BeNil()) | ||
|
||
return proxyAddress, proxyAdmin, contract | ||
return proxyAddress, proxyAdmin |
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 target T
contract instance can be constructed from the proxyAddress
by the caller.
return n.pChainWallet | ||
// Create the P-Chain wallet to issue transactions | ||
kc := secp256k1fx.NewKeychain(n.globalFundedKey) | ||
n.GetSubnetsInfo() |
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.
I don't think this line is necessary
@@ -57,7 +58,7 @@ var _ = ginkgo.BeforeSuite(func() { | |||
Expect(err).Should(BeNil()) | |||
|
|||
// Create the local network instance | |||
ctx, cancel := context.WithTimeout(context.Background(), 120*time.Second) | |||
ctx, cancel := context.WithTimeout(context.Background(), 120*2*time.Second) |
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.
Would this make more sense as 60*4*time.Second
?
Why this should be merged
Adds support for Etna SoVs in
LocalNetwork
. Allows for full separation of primary network and SoV validator sets. Also includes many semi-related cleanup items.How this works
The meat of this change involves moving the subnet conversion steps previously done in the validator manager test flows to
LocalNetwork
.LocalNetwork.NewNetwork
specifies only a single bootstrap node per subnet.LocalNetwork.ConvertSubnet
converts a subnet by:ValidatorManager
instance (the concrete instance is specfied as an argument to the call)ConvertSubnetTx
on the P-ChainAfter the subnet is converted, the bootstrap nodes validate only the primary network, and the nodes provided in the subnet conversion only validate the subnet.
LocalNetwork
users can choose if and when to convert the subnet. For example, theteleporter
suite does so in the initial network setup, converting all subnets to be managed byPoAValidatorManager
. Thegovernance
suite uses pre-Etna subnet validators as before. Thevalidator-manager
leaves it to each flow to convert the subnet according to its needs.Additionally, cleans up the following:
ERC20TokenStakingManager
's staking assetsignature-aggregator
over the Subnet EVM Warp API to aggregate signatures across all testsvalidator_manager.go
to useIValidatorManager
orIPoSValidatorManager
instances to remove duplicate code.How this was tested
CI
How is this documented
N/A