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

Add support for CIP42 and EIP1559 #10483

Merged
merged 53 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
aab57e6
remove deprecated functions / params for gasPrice / fee currency in kit
aaronmgdr Aug 11, 2023
ac4327e
improve types / format txs
aaronmgdr Aug 11, 2023
490d784
signing tests, add viem to compare with in tests.
aaronmgdr Aug 11, 2023
7991c5b
fix type issue, and split the first 12 (not the last 3)
aaronmgdr Aug 11, 2023
ebaa1a9
remove `only` and give test and actual name
aaronmgdr Aug 11, 2023
de6f824
remove logs and fix some incorrectly setting tx tyoe to wrong type
aaronmgdr Aug 11, 2023
c131c9e
lint fixes
aaronmgdr Aug 11, 2023
74b836c
parallelize async calls.
aaronmgdr Aug 14, 2023
6c0e704
cleanup
aaronmgdr Aug 14, 2023
fe20245
do not extract signer from cip42 txns
aaronmgdr Aug 14, 2023
c5e2901
lint checks
aaronmgdr Aug 15, 2023
3938603
update test
aaronmgdr Aug 15, 2023
1d2896a
revert removal of signer recovery
aaronmgdr Aug 15, 2023
b0918e4
feedback from sep
aaronmgdr Aug 15, 2023
9a909fa
add back signer test for faster deving
aaronmgdr Aug 15, 2023
908f8a4
it works. gandolf rides over the crest as the sun rises blinding the …
aaronmgdr Aug 15, 2023
bba4cc6
lint
aaronmgdr Aug 16, 2023
a0ceeba
show error if the rpc caller does not attach
aaronmgdr Aug 16, 2023
ee59d92
fix binding
aaronmgdr Aug 16, 2023
22b8fec
lint fix, and remove the call to set FeeMarket (i dont think its actu…
aaronmgdr Aug 17, 2023
0553034
lint fix
aaronmgdr Aug 17, 2023
c2f9948
no longer doing it like this
aaronmgdr Aug 17, 2023
20a6183
fix ck tests
aaronmgdr Aug 17, 2023
258c28d
cheat and pay with CELO to avoid the ganache issue where when paying …
aaronmgdr Aug 17, 2023
7187d96
it was never supposed to be like this
aaronmgdr Aug 18, 2023
6d4c240
why is it gasCurrency here?
aaronmgdr Aug 18, 2023
51edbd5
add some logging for that bug debug -- dont judge me!
aaronmgdr Aug 18, 2023
490d609
logging
aaronmgdr Aug 18, 2023
ac9ff23
fix but where transfer was not adhering to the gasFeeCurrency flag
aaronmgdr Aug 19, 2023
c81f4f9
fix #10025 js numbers cause impresission
aaronmgdr Aug 22, 2023
750f537
hex must be even
aaronmgdr Aug 22, 2023
206b88b
cleanup extra logs / commented out code.
aaronmgdr Aug 22, 2023
5ca63f0
add more logging to try to debug test failure
aaronmgdr Aug 22, 2023
0f36113
ah why does this exist?
aaronmgdr Aug 22, 2023
e6cb37d
whats up here
aaronmgdr Aug 22, 2023
61ce2e4
fix test description typos
aaronmgdr Aug 23, 2023
bedc5ba
Dont use custom signing code in protocol test
aaronmgdr Aug 24, 2023
c357182
review / cleanup
aaronmgdr Aug 24, 2023
646e39b
protocol now depends on local wallet
aaronmgdr Aug 24, 2023
472081f
fix varible lint
aaronmgdr Aug 24, 2023
d3e70cd
update to 5.0.0-beta.1
aaronmgdr Aug 24, 2023
3493528
revert back logging to how it was,
aaronmgdr Aug 25, 2023
17688cd
Merge branch 'aaronmgdr/new-tx-types' of https://github.com/celo-org/…
aaronmgdr Sep 11, 2023
262fee9
use named types for address and hex values,
aaronmgdr Sep 11, 2023
030a41a
publish sdk 5 and pnp-common 3.0.1
aaronmgdr Sep 11, 2023
fad24fb
add back dev suffix
aaronmgdr Sep 11, 2023
fdef27d
republish -- pnp engine can not be 18
aaronmgdr Sep 11, 2023
30f29ae
add back dev suffix
aaronmgdr Sep 11, 2023
0ab987a
try
aaronmgdr Sep 11, 2023
aaf8036
publish beta
aaronmgdr Sep 12, 2023
4afb79b
Merge branch 'master' into aaronmgdr/new-tx-types
aaronmgdr Sep 12, 2023
793ab9e
publish good release
aaronmgdr Sep 12, 2023
59055a4
use node 18 in container
aaronmgdr Sep 12, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/cron-npm-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
name: ${{ matrix.package }} NPM package install
runs-on: ubuntu-latest
container:
image: node:14-bullseye
image: node:18-bullseye
strategy:
fail-fast: false
matrix:
Expand Down
3 changes: 2 additions & 1 deletion dependency-graph.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
"@celo/cryptographic-utils",
"@celo/phone-utils",
"@celo/typescript",
"@celo/utils"
"@celo/utils",
"@celo/wallet-local"
]
},
"@celo/typescript": {
Expand Down
18 changes: 9 additions & 9 deletions packages/celotool/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
"author": "Celo",
"license": "Apache-2.0",
"dependencies": {
"@celo/base": "4.1.2-dev",
"@celo/connect": "4.1.2-dev",
"@celo/cryptographic-utils": "4.1.2-dev",
"@celo/contractkit": "4.1.2-dev",
"@celo/base": "5.0.3-dev",
"@celo/connect": "5.0.3-dev",
"@celo/cryptographic-utils": "5.0.3-dev",
"@celo/contractkit": "5.0.3-dev",
"@celo/env-tests": "1.0.0",
"@celo/explorer": "4.1.2-dev",
"@celo/governance": "4.1.2-dev",
"@celo/identity": "4.1.2-dev",
"@celo/network-utils": "4.1.2-dev",
"@celo/utils": "4.1.2-dev",
"@celo/explorer": "5.0.3-dev",
"@celo/governance": "5.0.3-dev",
"@celo/identity": "5.0.3-dev",
"@celo/network-utils": "5.0.3-dev",
"@celo/utils": "5.0.3-dev",
"@ethereumjs/util": "8.0.5",
"@ethereumjs/rlp": "4.0.1",
"@google-cloud/monitoring": "0.7.1",
Expand Down
20 changes: 10 additions & 10 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@
},
"dependencies": {
"@celo/bls12377js": "0.1.1",
"@celo/contractkit": "^4.1.2-dev",
"@celo/explorer": "^4.1.2-dev",
"@celo/governance": "^4.1.2-dev",
"@celo/identity": "^4.1.2-dev",
"@celo/phone-utils": "^4.1.2-dev",
"@celo/utils": "^4.1.2-dev",
"@celo/cryptographic-utils": "^4.1.2-dev",
"@celo/wallet-hsm-azure": "^4.1.2-dev",
"@celo/wallet-ledger": "^4.1.2-dev",
"@celo/wallet-local": "^4.1.2-dev",
"@celo/contractkit": "^5.0.3-dev",
"@celo/explorer": "^5.0.3-dev",
"@celo/governance": "^5.0.3-dev",
"@celo/identity": "^5.0.3-dev",
"@celo/phone-utils": "^5.0.3-dev",
"@celo/utils": "^5.0.3-dev",
"@celo/cryptographic-utils": "^5.0.3-dev",
"@celo/wallet-hsm-azure": "^5.0.3-dev",
"@celo/wallet-ledger": "^5.0.3-dev",
"@celo/wallet-local": "^5.0.3-dev",
"@ledgerhq/hw-transport-node-hid": "^6.27.4",
"@oclif/command": "^1.6.0",
"@oclif/config": "^1.6.0",
Expand Down
3 changes: 0 additions & 3 deletions packages/cli/src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,6 @@ export abstract class BaseCommand extends Command {

const setStableTokenGas = async (stable: StableToken) => {
await this.kit.setFeeCurrency(stableTokenInfos[stable].contract)
await this.kit.updateGasPriceInConnectionLayer(
await this.kit.registry.addressFor(stableTokenInfos[stable].contract)
)
aaronmgdr marked this conversation as resolved.
Show resolved Hide resolved
}
if (Object.keys(StableToken).includes(gasCurrencyConfig)) {
await setStableTokenGas(StableToken[gasCurrencyConfig as keyof typeof StableToken])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ testWithGanache('releasegold:transfer-dollars cmd', (web3: Web3) => {
contractAddress,
'--value',
cUSDToTransfer,
'--gasCurrency',
'CELO',
])
// RG cUSD balance should match the amount sent
const contractBalance = await kit.getTotalBalance(contractAddress)
Expand All @@ -52,6 +54,8 @@ testWithGanache('releasegold:transfer-dollars cmd', (web3: Web3) => {
accounts[0],
'--value',
cUSDToTransfer,
'--gasCurrency',
'CELO',
])
const balanceAfter = await kit.getTotalBalance(accounts[0])
expect(balanceBefore.cUSD).toEqual(balanceAfter.cUSD)
Expand Down
1 change: 0 additions & 1 deletion packages/cli/src/commands/releasegold/transfer-dollars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export default class TransferDollars extends ReleaseGoldBaseCommand {
this.kit.defaultAccount = isRevoked
? await this.releaseGoldWrapper.getReleaseOwner()
: await this.releaseGoldWrapper.getBeneficiary()

await displaySendTx('transfer', this.releaseGoldWrapper.transfer(flags.to, flags.value))
}
}
18 changes: 10 additions & 8 deletions packages/cli/src/transfer-stable-base.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { StableToken } from '@celo/contractkit'
import { StableTokenWrapper } from '@celo/contractkit/lib/wrappers/StableTokenWrapper'
import { stableTokenInfos } from '@celo/contractkit/src/celo-tokens'
import { flags } from '@oclif/command'
import { ParserOutput } from '@oclif/parser/lib/parse'
import BigNumber from 'bignumber.js'
Expand Down Expand Up @@ -35,7 +36,10 @@ export abstract class TransferStableBase extends BaseCommand {
} catch {
failWith(`The ${this._stableCurrency} token was not deployed yet`)
}
await this.kit.updateGasPriceInConnectionLayer(stableToken.address)
// If gasCurrency is not set, use the transferring token
if (!res.flags.gasCurrency) {
await this.kit.setFeeCurrency(stableTokenInfos[this._stableCurrency].contract)
}

const tx = res.flags.comment
? stableToken.transferWithComment(to, value.toFixed(), res.flags.comment)
Expand All @@ -47,14 +51,12 @@ export abstract class TransferStableBase extends BaseCommand {
`Account can afford transfer and gas paid in ${this._stableCurrency}`,
this.kit.connection.defaultFeeCurrency === stableToken.address,
async () => {
const gas = await tx.txo.estimateGas({ feeCurrency: stableToken.address })
// TODO: replace with gasPrice rpc once supported by min client version
const { gasPrice } = await this.kit.connection.fillGasPrice({
gasPrice: '0',
feeCurrency: stableToken.address,
})
const [gas, gasPrice, balance] = await Promise.all([
tx.txo.estimateGas({ feeCurrency: stableToken.address }),
this.kit.connection.gasPrice(stableToken.address),
stableToken.balanceOf(from),
])
const gasValue = new BigNumber(gas).times(gasPrice as string)
const balance = await stableToken.balanceOf(from)
return balance.gte(value.plus(gasValue))
},
`Cannot afford transfer with ${this._stableCurrency} gasCurrency; try reducing value slightly or using gasCurrency=CELO`
Expand Down
14 changes: 7 additions & 7 deletions packages/env-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
"main": "index.js",
"license": "MIT",
"dependencies": {
"@celo/contractkit": "4.1.2-dev",
"@celo/utils": "4.1.2-dev",
"@celo/base": "4.1.2-dev",
"@celo/connect": "4.1.2-dev",
"@celo/identity": "4.1.2-dev",
"@celo/phone-utils": "4.1.2-dev",
"@celo/cryptographic-utils": "4.1.2-dev",
"@celo/contractkit": "5.0.3-dev",
"@celo/utils": "5.0.3-dev",
"@celo/base": "5.0.3-dev",
"@celo/connect": "5.0.3-dev",
"@celo/identity": "5.0.3-dev",
"@celo/phone-utils": "5.0.3-dev",
"@celo/cryptographic-utils": "5.0.3-dev",
"bunyan": "1.8.12",
"bunyan-gke-stackdriver": "0.1.2",
"bunyan-debug-stream": "2.0.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/metadata-crawler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"homepage": "https://github.com/celo-org/celo-monorepo/tree/master/packages/metadata-crawler",
"repository": "https://github.com/celo-org/celo-monorepo/tree/master/packages/metadata-crawler",
"dependencies": {
"@celo/connect": "4.1.2-dev",
"@celo/contractkit": "4.1.2-dev",
"@celo/utils": "4.1.2-dev",
"@celo/connect": "5.0.3-dev",
"@celo/contractkit": "5.0.3-dev",
"@celo/utils": "5.0.3-dev",
"@types/pg": "^7.14.3",
"bunyan": "1.8.12",
"bunyan-gke-stackdriver": "0.1.2",
Expand Down
14 changes: 7 additions & 7 deletions packages/phone-number-privacy/combiner/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@celo/phone-number-privacy-combiner",
"version": "3.0.1-dev",
"version": "3.0.3",
"description": "Orchestrates and combines threshold signatures for use in ODIS",
"author": "Celo",
"license": "Apache-2.0",
Expand Down Expand Up @@ -29,10 +29,10 @@
"test:e2e:mainnet": "CONTEXT_NAME=mainnet yarn test:e2e"
},
"dependencies": {
"@celo/contractkit": "^4.1.2-dev",
"@celo/phone-number-privacy-common": "^3.0.1-dev",
"@celo/identity": "^4.1.2-dev",
"@celo/encrypted-backup": "^4.1.2-dev",
"@celo/contractkit": "^5.0.3-dev",
"@celo/phone-number-privacy-common": "^3.0.3",
"@celo/identity": "^5.0.3-dev",
"@celo/encrypted-backup": "^5.0.3-dev",
"@celo/poprf": "^0.1.9",
"@types/bunyan": "^1.8.8",
"@opentelemetry/api": "^1.4.1",
Expand All @@ -55,8 +55,8 @@
},
"devDependencies": {
"@types/node": "18.15.13",
"@celo/utils": "^4.1.2-dev",
"@celo/phone-utils": "^4.1.2-dev",
"@celo/utils": "^5.0.3-dev",
"@celo/phone-utils": "^5.0.3-dev",
"@types/express": "^4.17.6",
"@types/supertest": "^2.0.12",
"@types/uuid": "^7.0.3",
Expand Down
14 changes: 7 additions & 7 deletions packages/phone-number-privacy/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@celo/phone-number-privacy-common",
"version": "3.0.1-dev",
"version": "3.0.3",
"description": "Common library for the combiner and signer libraries",
"author": "Celo",
"license": "Apache-2.0",
Expand All @@ -18,10 +18,10 @@
"lib/**/*"
],
"dependencies": {
"@celo/base": "^4.1.2-dev",
"@celo/contractkit": "^4.1.2-dev",
"@celo/utils": "^4.1.2-dev",
"@celo/phone-utils": "^4.1.2-dev",
"@celo/base": "^5.0.3-dev",
"@celo/contractkit": "^5.0.3-dev",
"@celo/utils": "^5.0.3-dev",
"@celo/phone-utils": "^5.0.3-dev",
"@types/bunyan": "1.8.8",
"bignumber.js": "^9.0.0",
"bunyan": "1.8.12",
Expand All @@ -41,13 +41,13 @@
},
"devDependencies": {
"@celo/poprf": "^0.1.9",
"@celo/wallet-local": "^4.1.2-dev",
"@celo/wallet-local": "^5.0.3-dev",
"@types/elliptic": "^6.4.12",
"@types/express": "^4.17.6",
"@types/is-base64": "^1.1.0",
"@types/node-fetch": "^2.5.7"
},
"engines": {
"node": ">=10"
"node": ">=12"
}
}
16 changes: 8 additions & 8 deletions packages/phone-number-privacy/monitor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@celo/phone-number-privacy-monitor",
"version": "3.0.0-beta.2-dev",
"version": "3.0.3",
"description": "Regularly queries ODIS to ensure the system is functioning properly",
"author": "Celo",
"license": "Apache-2.0",
Expand All @@ -22,13 +22,13 @@
"loadTest": "ts-node src/scripts/run-load-test.ts run"
},
"dependencies": {
"@celo/contractkit": "^4.1.2-dev",
"@celo/cryptographic-utils": "^4.1.2-dev",
"@celo/encrypted-backup": "^4.1.2-dev",
"@celo/identity": "^4.1.2-dev",
"@celo/wallet-local": "^4.1.2-dev",
"@celo/phone-number-privacy-common": "^3.0.1-dev",
"@celo/utils": "^4.1.2-dev",
"@celo/contractkit": "^5.0.3-dev",
"@celo/cryptographic-utils": "^5.0.3-dev",
"@celo/encrypted-backup": "^5.0.3-dev",
"@celo/identity": "^5.0.3-dev",
"@celo/wallet-local": "^5.0.3-dev",
"@celo/phone-number-privacy-common": "^3.0.2",
"@celo/utils": "^5.0.3-dev",
"firebase-admin": "^9.12.0",
"firebase-functions": "^3.15.7"
},
Expand Down
14 changes: 7 additions & 7 deletions packages/phone-number-privacy/signer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@celo/phone-number-privacy-signer",
"version": "3.0.2-dev",
"version": "3.0.3",
"description": "Signing participator of ODIS",
"author": "Celo",
"license": "Apache-2.0",
Expand Down Expand Up @@ -37,12 +37,12 @@
"ssl:keygen": "./scripts/create-ssl-cert.sh"
},
"dependencies": {
"@celo/base": "^4.1.2-dev",
"@celo/contractkit": "^4.1.2-dev",
"@celo/phone-number-privacy-common": "^3.0.1-dev",
"@celo/base": "^5.0.3-dev",
"@celo/contractkit": "^5.0.3-dev",
"@celo/phone-number-privacy-common": "^3.0.3",
"@celo/poprf": "^0.1.9",
"@celo/utils": "^4.1.2-dev",
"@celo/wallet-hsm-azure": "^4.1.2-dev",
"@celo/utils": "^5.0.3-dev",
"@celo/wallet-hsm-azure": "^5.0.3-dev",
"@google-cloud/secret-manager": "3.0.0",
"@opentelemetry/api": "^1.4.1",
"@opentelemetry/auto-instrumentations-node": "^0.38.0",
Expand Down Expand Up @@ -78,4 +78,4 @@
"engines": {
"node": ">=10"
}
}
}
Loading