diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposal/acceptProposal.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposal/acceptProposal.ts index 8d5597687..133aee6ed 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposal/acceptProposal.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposal/acceptProposal.ts @@ -255,13 +255,21 @@ export default class AcceptProposal extends SolanaCommand { const proposalDigest = this.calculateProposalDigest(this.makeDigestInputFromProposal(proposalState as Proposal)) const isSameDigest = Buffer.compare(this.contractInput.offchainDigest, proposalDigest) === 0 this.require(isSameDigest, 'Digest generated is different from the onchain digest') - logger.success('Generated configuration matches with onchain proposal configuration') - logger.info(`Accepting config proposal at ${this.args[0]} with the following configuration`) // final diff between proposal and actual contract state - diff.printDiff(contractConfig, proposalConfig) - await prompt('Continue?') + logger.info(`OffchainConfig difference in contract ${this.args[0]} and proposal ${this.input.proposalId}`) + diff.printDiff( + { offchainConfig: contractConfig.offchainConfig, f: contractConfig.f }, + { offchainConfig: proposalConfig.offchainConfig, f: proposalConfig.f }, + ) + + logger.info(`Existing Oracles Config on contract ${this.args[0]}`) + logger.log(contractConfig.oracles) + logger.info(`Proposed Oracles Config for contract ${this.args[0]}`) + logger.log(proposalConfig.oracles) + + await prompt('Accept config proposal?') } execute = async () => { diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposeConfig.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposeConfig.ts index d9877133a..0a42029d5 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposeConfig.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposeConfig.ts @@ -119,9 +119,12 @@ export default class ProposeConfig extends SolanaCommand { }, {}), } - logger.info(`Proposing new config on contract ${this.args[0]}:`) - diff.printDiff(contractConfig, proposedConfig) + logger.info(`Existing Config on contract ${this.args[0]}:`) + logger.log(contractConfig) + logger.info(`Proposed Config for contract ${this.args[0]}:`) + logger.log(proposedConfig) + // diff.printDiff(contractConfig, proposedConfig) await prompt('Continue?') } diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposeOffchainConfig.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposeOffchainConfig.ts index da49e6dc4..9af02bcd2 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposeOffchainConfig.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposeOffchainConfig.ts @@ -268,6 +268,7 @@ export default class ProposeOffchainConfig extends SolanaCommand { const proposedConfig = deserializeConfig(this.contractInput.serializedOffchainConfig) const proposedConfigForDiff = prepareOffchainConfigForDiff(proposedConfig) + logger.info(`Proposed OffchainConfig for contract ${this.args[0]}`) diff.printDiff(contractOffchainConfigForDiff, proposedConfigForDiff) logger.info( diff --git a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposePayees.ts b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposePayees.ts index 0dc168aa1..fb4c9a463 100644 --- a/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposePayees.ts +++ b/gauntlet/packages/gauntlet-solana-contracts/src/commands/contracts/ocr2/proposePayees.ts @@ -131,40 +131,36 @@ export default class ProposePayees extends SolanaCommand { beforeExecute = async () => { const state = new PublicKey(this.args[0]) - let contractState = await this.program.account.state.fetch(state) - let numOfOracles = contractState.oracles.len.toNumber() - - if (numOfOracles === 0) { - // handle case when no oracles were set yet - // iterate through oracles list in proposal - const proposal = new PublicKey(this.input.proposalId) - contractState = await this.program.account.proposal.fetch(proposal) - } + const contractState = await this.program.account.state.fetch(state) const payeesInContract = contractState.oracles.xs.slice(0, contractState.oracles.len.toNumber()).reduce( (agg, { transmitter, payee }, idx) => ({ ...agg, - [`operator#${idx}`]: { + [`oracle#${idx}`]: { transmitter: transmitter.toString(), payee: payee.toString(), }, }), {}, ) + logger.info(`Existing payees on contract ${this.args[0]}`) + logger.log(payeesInContract) - const proposedPayees = Object.entries(payeesInContract).reduce( - (agg, [key, value]) => ({ + const proposedPayees = Object.entries(this.contractInput.payeeByTransmitter).reduce( + (agg, [transmitter, payee], idx) => ({ ...agg, - [key]: { - transmitter: (value as any).transmitter, - payee: this.contractInput.payeeByTransmitter[(value as any).transmitter].toString(), + [`oracle#${idx}`]: { + transmitter, + payee: payee.toString(), }, }), {}, ) + logger.info(`Proposed payees for contract ${this.args[0]}`) + logger.log(proposedPayees) - logger.info(`Proposing payees for contract ${this.args[0]}`) - diff.printDiff(payeesInContract, proposedPayees) + // todo: enable diff when fixed + // diff.printDiff(payeesInContract, proposedPayees) await prompt('Continue?') }