Add a fourth validator to testnet2 (#990)

* Update testnet2 relayer quorum to 3

* Create fourth validators for testnet2

* Update testnet2 on-chain config

* Merge main

Co-authored-by: Asa Oines <asaoines@Asas-MacBook-Pro.local>
Co-authored-by: Trevor Porter <trkporter@ucdavis.edu>
pull/1021/head
Asa Oines 2 years ago committed by GitHub
parent d316ae68d5
commit aef0aa35e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 21
      typescript/infra/config/environments/testnet2/core.ts
  2. 70
      typescript/infra/config/environments/testnet2/validators.ts
  3. 12
      typescript/infra/scripts/govern.ts
  4. 37
      typescript/infra/src/core/govern.ts

@ -9,8 +9,9 @@ export const core: ChainMap<TestnetChains, CoreConfig> = {
'0x7716860b2be4079137dc21533ac6d26a99d76e83',
'0xb476f4d55d640e9a9a43b9bdf471dc06e4508bbd',
'0xda63918dd964c0d7c59a04062bffe0fba8edaf1c',
'0xebb97602f6acd259ecec9f9fa811aed5b35981ab',
],
threshold: 2,
threshold: 3,
},
},
kovan: {
@ -19,8 +20,9 @@ export const core: ChainMap<TestnetChains, CoreConfig> = {
'0x1ee94e776cbe4bf74d2f80dae551758efbc21887',
'0xf2af10d9fd08eead8c6724a7feb679b5c900a38c',
'0xf3b7d58acfbff1fd64f173607101f611034e4f5f',
'0xff94c7660e857ba3f35ee248ae461feea266a504',
],
threshold: 2,
threshold: 3,
},
},
fuji: {
@ -29,8 +31,9 @@ export const core: ChainMap<TestnetChains, CoreConfig> = {
'0xc0ab1f3e3317521a92462927849b8844cf408b09',
'0xefde1812fea378c645d8e7984ce985b228cd1beb',
'0xb17f4f63e09c0a9207e2f008977e3f5b5584875d',
'0x6f6a95ad0348454a5d4c3029cd3243acecd1cf8b',
],
threshold: 2,
threshold: 3,
},
},
mumbai: {
@ -39,8 +42,9 @@ export const core: ChainMap<TestnetChains, CoreConfig> = {
'0x0f1a231cb2ecc5f26696c433d76fe59521a227e0',
'0x3e527087fc60752695d9a4f77a6324bbae3940b1',
'0x62afdaed75bdfd94e0d6103eb0333669d4f5d232',
'0xa12b4612d00f682276c994040a3f37d0d6f343c4',
],
threshold: 2,
threshold: 3,
},
},
bsctestnet: {
@ -49,8 +53,9 @@ export const core: ChainMap<TestnetChains, CoreConfig> = {
'0xa7959b2f03f6fc77c9592547bd0ca12fe2c7bf8f',
'0xc78c1198d4224103dbb0e365286c3403c54fbbf6',
'0x453da5c773e829aa4f61be9bad64aa5eaaef000a',
'0x625027ffb9b9b9ba083d267e5b7756af33e636a0',
],
threshold: 2,
threshold: 3,
},
},
arbitrumrinkeby: {
@ -59,8 +64,9 @@ export const core: ChainMap<TestnetChains, CoreConfig> = {
'0xf5a871bcb9d6dfa2d3519caf396e7ab3c5a7a2ee',
'0xa6773fc38b023a512106e104a4f2cad2e68d802d',
'0x42f7b994720463eff351186f83d683efa5e2ed49',
'0x49649a8708f45171f5439ec71dc83baafd98b01c',
],
threshold: 2,
threshold: 3,
},
},
optimismkovan: {
@ -69,8 +75,9 @@ export const core: ChainMap<TestnetChains, CoreConfig> = {
'0xef0d7bbb9c71fef7dc148722060afd78d0ff09d8',
'0x8e64ff3936aeadacc23a76cf2c96466927ed758f',
'0x13a3cd962ce99d6a6509f8d5b63a4498db329323',
'0x85f8286a8ee13aecc227e99b75375826cdb512dd',
],
threshold: 2,
threshold: 3,
},
},
};

@ -16,7 +16,7 @@ const s3BucketName = <Chain extends ChainName>(
export const validators: ChainValidatorSets<TestnetChains> = {
alfajores: {
threshold: 2,
threshold: 3,
validators: [
{
address: '0x7716860b2be4079137dc21533ac6d26a99d76e83',
@ -42,10 +42,18 @@ export const validators: ChainValidatorSets<TestnetChains> = {
region: s3BucketRegion,
},
},
{
address: '0xebb97602f6acd259ecec9f9fa811aed5b35981ab',
checkpointSyncer: {
type: CheckpointSyncerType.S3,
bucket: s3BucketName('alfajores', 3),
region: s3BucketRegion,
},
},
],
},
kovan: {
threshold: 2,
threshold: 3,
validators: [
{
address: '0x1ee94e776cbe4bf74d2f80dae551758efbc21887',
@ -71,10 +79,18 @@ export const validators: ChainValidatorSets<TestnetChains> = {
region: s3BucketRegion,
},
},
{
address: '0xff94c7660e857ba3f35ee248ae461feea266a504',
checkpointSyncer: {
type: CheckpointSyncerType.S3,
bucket: s3BucketName('kovan', 3),
region: s3BucketRegion,
},
},
],
},
fuji: {
threshold: 2,
threshold: 3,
validators: [
{
address: '0xc0ab1f3e3317521a92462927849b8844cf408b09',
@ -100,10 +116,18 @@ export const validators: ChainValidatorSets<TestnetChains> = {
region: s3BucketRegion,
},
},
{
address: '0x6f6a95ad0348454a5d4c3029cd3243acecd1cf8b',
checkpointSyncer: {
type: CheckpointSyncerType.S3,
bucket: s3BucketName('fuji', 3),
region: s3BucketRegion,
},
},
],
},
mumbai: {
threshold: 2,
threshold: 3,
validators: [
{
address: '0x0f1a231cb2ecc5f26696c433d76fe59521a227e0',
@ -129,10 +153,18 @@ export const validators: ChainValidatorSets<TestnetChains> = {
region: s3BucketRegion,
},
},
{
address: '0xa12b4612d00f682276c994040a3f37d0d6f343c4',
checkpointSyncer: {
type: CheckpointSyncerType.S3,
bucket: s3BucketName('mumbai', 3),
region: s3BucketRegion,
},
},
],
},
bsctestnet: {
threshold: 2,
threshold: 3,
validators: [
{
address: '0xa7959b2f03f6fc77c9592547bd0ca12fe2c7bf8f',
@ -158,10 +190,18 @@ export const validators: ChainValidatorSets<TestnetChains> = {
region: s3BucketRegion,
},
},
{
address: '0x625027ffb9b9b9ba083d267e5b7756af33e636a0',
checkpointSyncer: {
type: CheckpointSyncerType.S3,
bucket: s3BucketName('bsctestnet', 3),
region: s3BucketRegion,
},
},
],
},
arbitrumrinkeby: {
threshold: 2,
threshold: 3,
validators: [
{
address: '0xf5a871bcb9d6dfa2d3519caf396e7ab3c5a7a2ee',
@ -187,10 +227,18 @@ export const validators: ChainValidatorSets<TestnetChains> = {
region: s3BucketRegion,
},
},
{
address: '0x49649a8708f45171f5439ec71dc83baafd98b01c',
checkpointSyncer: {
type: CheckpointSyncerType.S3,
bucket: s3BucketName('arbitrumrinkeby', 3),
region: s3BucketRegion,
},
},
],
},
optimismkovan: {
threshold: 2,
threshold: 3,
validators: [
{
address: '0xef0d7bbb9c71fef7dc148722060afd78d0ff09d8',
@ -216,6 +264,14 @@ export const validators: ChainValidatorSets<TestnetChains> = {
region: s3BucketRegion,
},
},
{
address: '0x85f8286a8ee13aecc227e99b75375826cdb512dd',
checkpointSyncer: {
type: CheckpointSyncerType.S3,
bucket: s3BucketName('optimismkovan', 3),
region: s3BucketRegion,
},
},
],
},
};

@ -1,7 +1,7 @@
import {
AbacusCore,
AbacusCoreChecker,
ViolationType,
CoreViolationType,
} from '@abacus-network/sdk';
import { AbacusCoreGovernor } from '../src/core/govern';
@ -22,12 +22,16 @@ async function check() {
config.core,
);
await coreChecker.check();
// 16 ownable contracts per chain.
await coreChecker.expectViolations([ViolationType.Owner], [7 * 16]);
// One add validator and one threshold violation per VM per chain
await coreChecker.expectViolations(
[CoreViolationType.Validator],
[2 * 7 * 7],
);
const governor = new AbacusCoreGovernor(coreChecker);
await governor.govern();
governor.logCalls();
await governor.executeCalls();
}
check().then(console.log).catch(console.error);

@ -47,6 +47,36 @@ export class AbacusCoreGovernor<Chain extends ChainName> {
});
}
estimateCalls() {
objMap(this.calls, async (chain, calls) => {
const connection = this.checker.multiProvider.getChainConnection(chain);
const signer = connection.signer;
if (!signer) {
throw new Error(`signer not found for ${chain}`);
}
for (const call of calls) {
await signer.estimateGas({ ...call, from: await signer.getAddress() });
}
});
}
async executeCalls() {
await this.estimateCalls();
objMap(this.calls, async (chain, calls) => {
const connection = this.checker.multiProvider.getChainConnection(chain);
const signer = connection.signer;
if (!signer) {
throw new Error(`signer not found for ${chain}`);
}
for (const call of calls) {
const response = await signer.sendTransaction(call);
console.log(`sent tx ${response.hash} to ${chain}`);
await response.wait(connection.confirmations);
console.log(`confirmed tx ${response.hash} on ${chain}`);
}
});
}
async handleValidatorViolation(violation: ValidatorViolation) {
const validatorManager = violation.data.validatorManager;
switch (violation.data.type) {
@ -65,6 +95,13 @@ export class AbacusCoreGovernor<Chain extends ChainName> {
this.pushCall(violation.chain as Chain, call as types.CallData);
break;
}
case ValidatorViolationType.Threshold: {
const call = await validatorManager.populateTransaction.setThreshold(
violation.expected,
);
this.pushCall(violation.chain as Chain, call as types.CallData);
break;
}
default:
throw new Error(
`Unsupported validator violation type ${violation.data.type}`,

Loading…
Cancel
Save