Skip to content
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

Upgrade Celo Dependencies #11184

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,6 @@
"blind-threshold-bls": "npm:@celo/[email protected]",
"@types/bn.js": "4.11.6",
"bignumber.js": "9.0.0"
}
},
"packageManager": "[email protected]+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610"
}
18 changes: 9 additions & 9 deletions packages/celotool/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
"author": "Celo",
"license": "Apache-2.0",
"dependencies": {
"@celo/base": "^6.0.0",
"@celo/connect": "^5.1.2",
"@celo/cryptographic-utils": "^5.0.7",
"@celo/contractkit": "^7.0.0",
"@celo/base": "^6.1.0",
"@celo/connect": "^6.0.1",
"@celo/cryptographic-utils": "^5.1.0",
"@celo/contractkit": "^8.1.1",
"@celo/env-tests": "1.0.3",
"@celo/explorer": "^5.0.8",
"@celo/governance": "^5.0.9",
"@celo/network-utils": "^5.0.5",
"@celo/utils": "^5.0.6",
"@celo/explorer": "^5.0.12",
"@celo/governance": "^5.1.3",
"@celo/network-utils": "^5.0.6",
"@celo/utils": "^7.0.0",
"@ethereumjs/util": "8.0.5",
"@ethereumjs/rlp": "4.0.1",
"@google-cloud/monitoring": "0.7.1",
Expand Down Expand Up @@ -44,7 +44,7 @@
"tiny-secp256k1": "2.2.1",
"chai": "^4.3.7",
"mocha": "^10.2.0",
"web3": "1.10.0",
"web3": "1.10.4",
"web3-eth-admin": "1.0.0-beta.55",
"yargs": "17.7.2"
},
Expand Down
5 changes: 4 additions & 1 deletion packages/celotool/src/cmds/deploy/upgrade/hotfix.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This is a more unusual Celotool command. It basically helps you to execute Hotfixes on testnets. Because constructing proposals is difficult to do via a CLI, you should define them here in code. There are two examples below that you can start from.

import { newKitFromWeb3 } from '@celo/contractkit'
import { L1HotfixRecord } from '@celo/contractkit/lib/wrappers/Governance'
import { hotfixToHash, ProposalBuilder, proposalToJSON } from '@celo/governance'
import { privateKeyToAddress } from '@celo/utils/lib/address'
import { concurrentMap } from '@celo/utils/lib/async'
Expand Down Expand Up @@ -121,7 +122,9 @@ export const handler = async (argv: EthstatsArgv) => {
hotfixRecord = await governance.getHotfixRecord(proposalHash)
console.info('\nHotfix Record: ', hotfixRecord)

if (hotfixRecord.preparedEpoch.toNumber() === 0) {
// if this is actually used we need to handle the L2 case but that is out of scope for just upgrading ck

if ((hotfixRecord as L1HotfixRecord).preparedEpoch?.toNumber() === 0) {
console.error('Hotfix could not be prepared')
throw new Error()
}
Expand Down
3 changes: 2 additions & 1 deletion packages/celotool/src/cmds/generate/faucet-load-test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { StrongAddress } from '@celo/base'
import { newKit } from '@celo/contractkit'
import { switchToClusterFromEnv } from 'src/lib/cluster'
import { convertToContractDecimals } from 'src/lib/contract-utils'
Expand Down Expand Up @@ -65,7 +66,7 @@ export const handler = async (argv: CeloEnvArgv & FaucetLoadTest) => {
const kit = newKit('http://localhost:8545')
const account = (await kit.web3.eth.getAccounts())[0]
console.info(`Using account: ${account}`)
kit.defaultAccount = account
kit.defaultAccount = account as StrongAddress

const [goldToken, stableToken] = await Promise.all([
kit.contracts.getGoldToken(),
Expand Down
70 changes: 27 additions & 43 deletions packages/celotool/src/e2e-tests/cip35_tests.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { StrongAddress } from '@celo/base'
import { CeloTx } from '@celo/connect'
import { ContractKit, newKitFromWeb3 } from '@celo/contractkit'
import { privateKeyToAddress } from '@celo/utils/lib/address'
Expand Down Expand Up @@ -26,7 +27,6 @@ const validatorPrivateKey = generatePrivateKey(mnemonic, AccountType.VALIDATOR,
const validatorAddress = privateKeyToAddress(validatorPrivateKey)
// Arbitrary addresses to use in the transactions
const toAddress = '0x8c36775E95A5f7FEf6894Ba658628352Ac58605B'
const gatewayFeeRecipientAddress = '0xc77538d1e30C0e4ec44B0DcaD97FD3dc63fcaCC4'

// Simple contract with a single constant
const bytecode =
Expand All @@ -47,8 +47,6 @@ const devFilter: Filter = {
ethCompatible: undefined,
contractCreation: undefined,
useFeeCurrency: undefined,
useGatewayFee: undefined,
useGatewayFeeRecipient: undefined,
sendRawTransaction: undefined,
}
/// ////////////////////////////////////////////////////////////////////////////////////////////
Expand All @@ -65,8 +63,6 @@ interface TestCase {
ethCompatible: boolean
contractCreation: boolean
useFeeCurrency: boolean
useGatewayFee: boolean
useGatewayFeeRecipient: boolean
sendRawTransaction: boolean // whether to use eth_sendRawTransaction ot eth_sendTransaction
errorString: string | null
errorReason: string | null
Expand All @@ -88,38 +84,32 @@ function generateTestCases(cipIsActivated: boolean) {
for (const ethCompatible of getValues(devFilter.ethCompatible)) {
for (const contractCreation of getValues(devFilter.contractCreation)) {
for (const useFeeCurrency of getValues(devFilter.useFeeCurrency)) {
for (const useGatewayFee of getValues(devFilter.useGatewayFee)) {
for (const useGatewayFeeRecipient of getValues(devFilter.useGatewayFeeRecipient)) {
for (const sendRawTransaction of getValues(devFilter.sendRawTransaction)) {
let errorString: string | null = null
let errorReason: string | null = null
const hasCeloFields = useFeeCurrency || useGatewayFee || useGatewayFeeRecipient
if (ethCompatible && hasCeloFields) {
errorString = notCompatibleError
errorReason = 'transaction has celo-only fields'
} else if (ethCompatible && !cipIsActivated) {
errorString = notYetActivatedError
errorReason = 'Donut is not activated'
}
if (sendRawTransaction && ethCompatible && hasCeloFields) {
// Such scenarios don't make sense, since eth-compatible transactions in RLP can't have
// these fields. So skip these cases.
continue
}
cases.push({
cipIsActivated,
lightNode,
ethCompatible,
contractCreation,
useFeeCurrency,
useGatewayFee,
useGatewayFeeRecipient,
sendRawTransaction,
errorString,
errorReason,
})
}
for (const sendRawTransaction of getValues(devFilter.sendRawTransaction)) {
let errorString: string | null = null
let errorReason: string | null = null
const hasCeloFields = useFeeCurrency
if (ethCompatible && hasCeloFields) {
errorString = notCompatibleError
errorReason = 'transaction has celo-only fields'
} else if (ethCompatible && !cipIsActivated) {
errorString = notYetActivatedError
errorReason = 'Donut is not activated'
}
if (sendRawTransaction && ethCompatible && hasCeloFields) {
// Such scenarios don't make sense, since eth-compatible transactions in RLP can't have
// these fields. So skip these cases.
continue
}
cases.push({
cipIsActivated,
lightNode,
ethCompatible,
contractCreation,
useFeeCurrency,
sendRawTransaction,
errorString,
errorReason,
})
}
}
}
Expand Down Expand Up @@ -344,13 +334,7 @@ class TestEnv {
nonce: await this.kit.connection.nonce(validatorAddress),
}
if (testCase.useFeeCurrency) {
tx.feeCurrency = this.stableTokenAddr
}
if (testCase.useGatewayFee) {
tx.gatewayFee = '0x25'
}
if (testCase.useGatewayFeeRecipient) {
tx.gatewayFeeRecipient = gatewayFeeRecipientAddress
tx.feeCurrency = this.stableTokenAddr as StrongAddress
}

if (testCase.contractCreation) {
Expand Down
Loading
Loading