Skip to content

Commit

Permalink
Martinvol/isolate 0.8 artifacts for gasPriceMinimum (#10437)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinvol authored Sep 15, 2023
1 parent b2bb1c9 commit 277107c
Show file tree
Hide file tree
Showing 82 changed files with 2,066 additions and 1,531 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ jobs:
general-test:
<<: *defaults
# XXX (soloseng): Increased size because this test was hitting the ram limit and failing
resource_class: xlarge
resource_class: large
steps:
- attach_workspace:
at: ~/app
Expand Down
51 changes: 27 additions & 24 deletions .github/workflows/circleci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ on:
push:
branches:
- master
# TODO (soloseng): remove before merge
- pahor/0.8_from_Seb
# TODO(jcortejoso): Replace by pull_request
pull_request_target:
- 'release/**'
pull_request:
branches:
- master
- martinvol/CR10Release
- 'release/**'
- pahor/0.8_from_Seb
- 'martinvol/isolate-0.8-artifacts'

concurrency:
group: circle-ci-${{ github.ref }}
Expand Down Expand Up @@ -255,12 +253,17 @@ jobs:
with:
node-version: 12.22.11
- name: Generate devchain of previous release
run: |
echo "Comparing against $RELEASE_TAG"
# Github has phased out the git protocol so we ensure that we use
# https for all git operations that yarn may perform.
git config --global url."https://github.com".insteadOf git://github.com
yarn --cwd packages/protocol test:generate-old-devchain-and-build -b $RELEASE_TAG -d .tmp/released_chain -l /dev/stdout -g scripts/truffle/releaseGoldExampleConfigs.json
uses: nick-fields/retry@v2
with:
timeout_minutes: 60
max_attempts: 3
command: |
echo "Comparing against $RELEASE_TAG"
# Github has phased out the git protocol so we ensure that we use
# https for all git operations that yarn may perform.
git config --global url."https://github.com".insteadOf git://github.com
yarn --cwd packages/protocol test:generate-old-devchain-and-build -b $RELEASE_TAG -d .tmp/released_chain -l /dev/stdout -g scripts/truffle/releaseGoldExampleConfigs.json
protocol-test-release:
name: Protocol Test Release
runs-on: ["self-hosted", "monorepo-node18"]
Expand Down Expand Up @@ -302,7 +305,7 @@ jobs:
# Keeping name short because GitHub UI does not handle long names well
name: ${{ matrix.name }}
runs-on: ["self-hosted", "monorepo-node18"]
timeout-minutes: 60
timeout-minutes: 120
needs: [install-dependencies, lint-checks]
if: |
contains(needs.install-dependencies.outputs.all_modified_files, 'packages/protocol') ||
Expand Down Expand Up @@ -363,14 +366,12 @@ jobs:
yarn --cwd packages/protocol build
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
timeout-minutes: 20
if: contains(matrix.command, 'common/') && false
with:
limit-access-to-actor: true
if: false
timeout-minutes: 120
- name: Execute matrix command for test
uses: nick-fields/retry@v2
with:
timeout_minutes: 30
timeout_minutes: 60
max_attempts: 3
command: |
${{ matrix.command }}
Expand Down Expand Up @@ -659,10 +660,12 @@ jobs:
./ci_test_validator_order.sh checkout ${CELO_BLOCKCHAIN_BRANCH_TO_TEST}
- name: CIP35 eth compatibility test
command: |
set -e
export PATH="/usr/local/go/bin:$HOME/.cargo/bin:${PATH}"
cd packages/celotool
./ci_test_cip35.sh checkout ${CELO_BLOCKCHAIN_BRANCH_TO_TEST}
echo "Test skipped, see issue https://github.com/celo-org/celo-monorepo/issues/10556"
# set -e
# export PATH="/usr/local/go/bin:$HOME/.cargo/bin:${PATH}"
# cd packages/celotool
# ./ci_test_cip35.sh checkout ${CELO_BLOCKCHAIN_BRANCH_TO_TEST}
steps:
- uses: actions/cache/restore@v3
id: cache_git
Expand All @@ -679,14 +682,14 @@ jobs:
rebuild-package: 'true'
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
timeout-minutes: 20
if: contains(matrix.command, 'ci_test_transfers.sh') && false
timeout-minutes: 120
if: contains(matrix.command, 'ci_test_cip35.sh')
with:
limit-access-to-actor: true
- name: Execute matrix command for test
uses: nick-fields/retry@v2
with:
timeout_minutes: 30
timeout_minutes: 60
max_attempts: 3
command: |
${{ matrix.command }}
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,4 @@
"bignumber.js": "9.0.0"
}
}

2 changes: 1 addition & 1 deletion packages/celotool/src/e2e-tests/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ function gethRepositoryFromFlags() {
}

export function getHooks(gethConfig: GethRunConfig) {
return getContext(gethConfig).hooks
return getContext(gethConfig, true).hooks
}

export function getContext(gethConfig: GethRunConfig, verbose: boolean = verboseOutput) {
Expand Down
21 changes: 21 additions & 0 deletions packages/protocol/contractPackages.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
export interface ContractPackage {
path?: string
folderPath?: string
name?: string
contracstFolder?: string
contracts: string[]
proxyContracts?: string[]
truffleConfig?: string
solidityVersion?: string
proxiesPath?: string
}

export const MENTO_PACKAGE: ContractPackage = {
path: 'mento-core',
contracstFolder: 'contracts',
folderPath: 'lib',
name: 'mento',
contracts: [
'Exchange',
Expand All @@ -30,4 +37,18 @@ export const MENTO_PACKAGE: ContractPackage = {
'StableTokenEURProxy',
'StableTokenProxy',
],
truffleConfig: 'truffle-config.js',
}

export const SOLIDITY_08_PACKAGE: ContractPackage = {
path: 'contracts-0.8',
contracstFolder: '',
folderPath: '',
name: '0.8',
proxiesPath: '/', // Proxies are still with 0.5 contracts
// Proxies shouldn't have to be added to a list manually
// https://github.com/celo-org/celo-monorepo/issues/10555
contracts: ['GasPriceMinimum'],
proxyContracts: ['GasPriceMinimumProxy'],
truffleConfig: 'truffle-config0.8.js',
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ pragma solidity >=0.8.7 <0.8.20;

import "@openzeppelin/contracts8/access/Ownable.sol";

import "./CalledByVm.sol";
import "./Initializable.sol";
import "./interfaces/ICeloVersionedContract.sol";
import "./FixidityLib0.8.sol";
import "./UsingRegistry8.sol";
import "../stability/interfaces/ISortedOracles.sol";
import "../../contracts/common/CalledByVm.sol";
import "../../contracts/common/Initializable.sol";
import "../../contracts/common/interfaces/ICeloVersionedContract.sol";
import "../../contracts/common/FixidityLib.sol";
import "./UsingRegistry.sol";
import "../../contracts/stability/interfaces/ISortedOracles.sol";

/**
* @title Stores and provides gas price minimum for various currencies.
Expand All @@ -17,7 +17,7 @@ contract GasPriceMinimum is
ICeloVersionedContract,
Ownable,
Initializable,
UsingRegistry8,
UsingRegistry,
CalledByVm
{
using FixidityLib for FixidityLib.Fraction;
Expand Down Expand Up @@ -53,7 +53,7 @@ contract GasPriceMinimum is
* @return Patch version of the contract.
*/
function getVersionNumber() external pure returns (uint256, uint256, uint256, uint256) {
return (1, 1, 1, 0);
return (1, 2, 0, 0);
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.8.0 <0.8.20;

// Note: This is not an exact copy of UsingRegistry or UsingRegistryV2 in the contract's folder
// because Mento's interfaces still don't support Solidity 0.8

import "@openzeppelin/contracts8/access/Ownable.sol";
import "@openzeppelin/contracts8/token/ERC20/IERC20.sol";

import "./interfaces/IRegistry.sol";
import "../../contracts/common/interfaces/IRegistry.sol";

contract UsingRegistry8 is Ownable {
contract UsingRegistry is Ownable {
event RegistrySet(address indexed registryAddress);

// solhint-disable state-visibility
Expand Down
Loading

0 comments on commit 277107c

Please sign in to comment.