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

[REBASE MERGE] CR11 <> master #10925

Closed
wants to merge 17 commits into from
Closed
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
96 changes: 0 additions & 96 deletions .github/workflows/container-circleci.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/containers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ jobs:
github.ref == 'refs/heads/master' &&
contains(needs.changed-files.outputs.all_modified_files, ',dockerfiles/metadata-crawler')
with:
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-monorepo/providers/github-by-repos
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-monorepo-master/providers/github-by-repos
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/celo-monorepo/blockscout-metadata-crawler
tags: latest
Expand Down
3 changes: 0 additions & 3 deletions dockerfiles/celotool/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ COPY packages/celotool/package.json packages/celotool/
COPY packages/dev-utils/package.json packages/dev-utils/
COPY packages/env-tests/package.json packages/env-tests/package.json
COPY packages/protocol/package.json packages/protocol/
COPY packages/typescript/package.json packages/typescript/
COPY patches/ patches/
COPY scripts/ scripts/
# Makes build fail if it doesn't copy git, will be removed after build
COPY .git .git
Expand All @@ -38,7 +36,6 @@ COPY packages/dev-utils packages/dev-utils/
COPY packages/env-tests packages/env-tests
COPY packages/helm-charts packages/helm-charts
COPY packages/protocol packages/protocol/
COPY packages/typescript packages/typescript/

RUN yarn build

Expand Down
1 change: 0 additions & 1 deletion dockerfiles/circleci/.dockerignore

This file was deleted.

42 changes: 0 additions & 42 deletions dockerfiles/circleci/Dockerfile

This file was deleted.

25 changes: 0 additions & 25 deletions dockerfiles/circleci/circleci-node18/Dockerfile

This file was deleted.

19 changes: 0 additions & 19 deletions dockerfiles/circleci/node10-gcloud/Dockerfile

This file was deleted.

2 changes: 0 additions & 2 deletions dockerfiles/metadata-crawler/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ RUN npm install -g typescript npm

COPY lerna.json package.json yarn.lock ./
COPY scripts scripts/
COPY packages/typescript packages/typescript/
COPY packages/sdk packages/sdk/
COPY packages/dev-utils packages/dev-utils/
COPY packages/metadata-crawler packages/metadata-crawler/

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"typescript": "^5.3.3"
},
"resolutions": {
"ganache": "npm:@soloseng/[email protected]beta.1",
"ganache": "npm:@celo/[email protected]unofficial.0",
"bip39": "https://github.com/bitcoinjs/bip39#d8ea080a18b40f301d4e2219a2991cd2417e83c2",
"blind-threshold-bls": "npm:@celo/[email protected]",
"@types/bn.js": "4.11.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/celotool/src/lib/generate_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import fs from 'fs'
import { merge, range, repeat } from 'lodash'
import { tmpdir } from 'os'
import path from 'path'
import * as rlp from 'rlp' // TODO(soloseng): update?
import * as rlp from 'rlp'
import { MyceloGenesisConfig } from 'src/lib/interfaces/mycelo-genesis-config'
import { CurrencyPair } from 'src/lib/k8s-oracle/base'
import * as ecc from 'tiny-secp256k1'
Expand Down
26 changes: 19 additions & 7 deletions packages/protocol/contracts-0.8/common/GasPriceMinimum.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import "../../contracts/common/interfaces/ICeloVersionedContract.sol";
import "../../contracts/common/FixidityLib.sol";
import "./UsingRegistry.sol";
import "../../contracts/stability/interfaces/ISortedOracles.sol";
import "@openzeppelin/contracts8/utils/math/Math.sol";

/**
* @title Stores and provides gas price minimum for various currencies.
Expand Down Expand Up @@ -38,6 +39,7 @@ contract GasPriceMinimum is
FixidityLib.Fraction public adjustmentSpeed;

uint256 public baseFeeOpCodeActivationBlock;
uint256 public constant ABSOLUTE_MINIMAL_GAS_PRICE = 1;

/**
* @notice Sets initialized == true on implementation contracts
Expand All @@ -53,7 +55,7 @@ contract GasPriceMinimum is
* @return Patch version of the contract.
*/
function getVersionNumber() external pure returns (uint256, uint256, uint256, uint256) {
return (1, 2, 0, 0);
return (1, 2, 0, 1);
}

/**
Expand Down Expand Up @@ -150,12 +152,7 @@ contract GasPriceMinimum is
}
}

/**
* @notice Retrieve the current gas price minimum for a currency.
* @param tokenAddress The currency the gas price should be in (defaults to gold).
* @return current gas price minimum in the requested currency
*/
function getGasPriceMinimum(address tokenAddress) external view returns (uint256) {
function _getGasPriceMinimum(address tokenAddress) private view returns (uint256) {
if (
tokenAddress == address(0) ||
tokenAddress == registry.getAddressForOrDie(GOLD_TOKEN_REGISTRY_ID)
Expand All @@ -172,6 +169,21 @@ contract GasPriceMinimum is
}
}

/**
* @notice Retrieve the current gas price minimum for a currency.
* When caled for 0x0 or Celo address, it returns gasPriceMinimum().
* For other addresses it returns gasPriceMinimum() mutiplied by
* the SortedOracles median of the token. It does not check tokenAddress is a valid fee currency.
* this function will never returns values less than ABSOLUTE_MINIMAL_GAS_PRICE.
* If Oracle rate doesn't exist, it returns ABSOLUTE_MINIMAL_GAS_PRICE.
* @dev This functions assumes one unit of token has 18 digits.
* @param tokenAddress The currency the gas price should be in (defaults to Celo).
* @return current gas price minimum in the requested currency
*/
function getGasPriceMinimum(address tokenAddress) external view returns (uint256) {
return Math.max(_getGasPriceMinimum(tokenAddress), ABSOLUTE_MINIMAL_GAS_PRICE);
}

/**
* @notice Adjust the gas price minimum based on governable parameters
* and block congestion.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.8.7 <0.8.20;

import "./FeeCurrencyAdapterOwnable.sol";

contract CeloFeeCurrencyAdapterOwnable is FeeCurrencyAdapterOwnable {
/**
* @notice Sets initialized == true on implementation contracts
* @param test Set to true to skip implementation initialization
*/
constructor(bool test) FeeCurrencyAdapterOwnable(test) {}

/**
* @notice Returns the storage, major, minor, and patch version of the contract.
* @return Storage version of the contract.
* @return Major version of the contract.
* @return Minor version of the contract.
* @return Patch version of the contract.
*/
function getVersionNumber() external pure returns (uint256, uint256, uint256, uint256) {
return (1, 1, 0, 0);
}
}
Loading
Loading