Skip to content

Commit

Permalink
remove multisig actor and some precompiles (Zondax#246)
Browse files Browse the repository at this point in the history
* remove multisig actor
* remove get_actor_type and ripemd160 precompiles
* remove useless call on test contracts
* remove types not used locally and move others to the right place
* apply prettier to project
* remove all FIXMEs
  • Loading branch information
emmanuelm41 authored and longfeiWan9 committed Mar 7, 2023
1 parent cf201ef commit d5457f6
Show file tree
Hide file tree
Showing 38 changed files with 158 additions and 1,285 deletions.
69 changes: 2 additions & 67 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -522,67 +522,6 @@ jobs:
name: gas_results_account.csv
path: testing/gas_results_account.csv

multisig-integration:
name: "Multisig API: integration tests"
timeout-minutes: 20
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'true'
- name: Instal deps
run: make install-opencl
- name: Install node
uses: actions/setup-node@v2
with:
node-version: '16.16.0'
- name: Install yarn
run: npm install -g yarn
- name: Install latest stable
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- name: Install dependencies
run: |
yarn install
make install_solc_linux
- name: Restore crates
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-${{ hashFiles('./testing/Cargo.lock') }}
- name: Restore previous compilation
uses: actions/cache@v3
with:
path: |
./testing/target
key: ${{ runner.os }}-testing-${{ hashFiles('./testing/Cargo.lock') }}
- name: Restore builtin-actors
uses: actions/cache@v3
with:
path: |
./testing/builtin-actors/target
key: ${{ runner.os }}-actors-${{ hashFiles('./testing/builtin-actors/Cargo.lock') }}
- name: Build builtin-actors
run: make build_builtin_actors
- name: Build contracts
run: make
- name: Run tests on multisig
run: |
cd testing
rustup target add wasm32-unknown-unknown
cargo test multisig_test
- uses: actions/upload-artifact@v3
with:
name: gas_results_multisig.csv
path: testing/gas_results_multisig.csv

precompiles-integration:
name: "Precompiles API: integration tests"
timeout-minutes: 20
Expand Down Expand Up @@ -708,7 +647,7 @@ jobs:
comment-result:
name: "Comment the result on PR"
runs-on: ubuntu-22.04
needs: [account-integration, datacap-integration, init-integration, market-integration, miner-integration, multisig-integration, power-integration, precompiles-integration, send-integration, verifreg-integration]
needs: [account-integration, datacap-integration, init-integration, market-integration, miner-integration, power-integration, precompiles-integration, send-integration, verifreg-integration]
steps:
- name: "Get gas_results_account.csv"
uses: actions/download-artifact@v3
Expand All @@ -730,10 +669,6 @@ jobs:
uses: actions/download-artifact@v3
with:
name: gas_results_market.csv
- name: "Get gas_results_multisig.csv"
uses: actions/download-artifact@v3
with:
name: gas_results_multisig.csv
- name: "Get gas_results_power.csv"
uses: actions/download-artifact@v3
with:
Expand All @@ -756,7 +691,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pip install csv2md
MKD=$(( echo "## Account actor"; csv2md gas_results_account.csv; echo "## Datacap actor"; csv2md gas_results_datacap.csv; echo "## Init actor"; csv2md gas_results_init.csv; echo "## Market actor"; csv2md gas_results_market.csv; echo "## Multisig actor"; csv2md gas_results_multisig.csv; echo "## Power actor"; csv2md gas_results_power.csv; echo "## Precompiles actor"; csv2md gas_results_precompiles.csv; echo "## Send actor"; csv2md gas_results_send.csv; echo "## Verifreg actor"; csv2md gas_results_verifreg.csv ) | cat)
MKD=$(( echo "## Account actor"; csv2md gas_results_account.csv; echo "## Datacap actor"; csv2md gas_results_datacap.csv; echo "## Init actor"; csv2md gas_results_init.csv; echo "## Market actor"; csv2md gas_results_market.csv; echo "## Power actor"; csv2md gas_results_power.csv; echo "## Precompiles actor"; csv2md gas_results_precompiles.csv; echo "## Send actor"; csv2md gas_results_send.csv; echo "## Verifreg actor"; csv2md gas_results_verifreg.csv ) | cat)
BODY=$(jq --null-input --arg body "# Gas results 🚀📝
${MKD}" '{"body": $body}')
curl \
Expand Down
5 changes: 0 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ build_tests:
./bin/solc solidity-cborutils=${PWD}/node_modules/solidity-cborutils/ @openzeppelin=${PWD}/node_modules/@openzeppelin/ @ensdomains=${PWD}/node_modules/@ensdomains/ contracts/v0.8/tests/account.test.sol --output-dir ./build/v0.8/tests --overwrite --bin --hashes --opcodes --abi
./bin/solc solidity-cborutils=${PWD}/node_modules/solidity-cborutils/ @openzeppelin=${PWD}/node_modules/@openzeppelin/ @ensdomains=${PWD}/node_modules/@ensdomains/ contracts/v0.8/tests/datacap.test.sol --output-dir ./build/v0.8/tests --overwrite --bin --hashes --opcodes --abi
./bin/solc solidity-cborutils=${PWD}/node_modules/solidity-cborutils/ @openzeppelin=${PWD}/node_modules/@openzeppelin/ @ensdomains=${PWD}/node_modules/@ensdomains/ contracts/v0.8/tests/init.test.sol --output-dir ./build/v0.8/tests --overwrite --bin --hashes --opcodes --abi
./bin/solc solidity-cborutils=${PWD}/node_modules/solidity-cborutils/ @openzeppelin=${PWD}/node_modules/@openzeppelin/ @ensdomains=${PWD}/node_modules/@ensdomains/ contracts/v0.8/tests/multisig.test.sol --output-dir ./build/v0.8/tests --overwrite --bin --hashes --opcodes --abi
./bin/solc solidity-cborutils=${PWD}/node_modules/solidity-cborutils/ @openzeppelin=${PWD}/node_modules/@openzeppelin/ @ensdomains=${PWD}/node_modules/@ensdomains/ contracts/v0.8/tests/verifreg.test.sol --output-dir ./build/v0.8/tests --overwrite --bin --hashes --opcodes --abi
./bin/solc solidity-cborutils=${PWD}/node_modules/solidity-cborutils/ @openzeppelin=${PWD}/node_modules/@openzeppelin/ @ensdomains=${PWD}/node_modules/@ensdomains/ contracts/v0.8/tests/precompiles.test.sol --output-dir ./build/v0.8/tests --overwrite --bin --hashes --opcodes --abi
./bin/solc solidity-cborutils=${PWD}/node_modules/solidity-cborutils/ @openzeppelin=${PWD}/node_modules/@openzeppelin/ @ensdomains=${PWD}/node_modules/@ensdomains/ contracts/v0.8/tests/send.test.sol --output-dir ./build/v0.8/tests --overwrite --bin --hashes --opcodes --abi
Expand All @@ -25,7 +24,6 @@ build_api:
./bin/solc solidity-cborutils=${PWD}/node_modules/solidity-cborutils/ @openzeppelin=${PWD}/node_modules/@openzeppelin/ @ensdomains=${PWD}/node_modules/@ensdomains/ contracts/v0.8/DataCapAPI.sol --output-dir ./build/v0.8 --overwrite --bin --hashes --opcodes --abi
./bin/solc solidity-cborutils=${PWD}/node_modules/solidity-cborutils/ @openzeppelin=${PWD}/node_modules/@openzeppelin/ @ensdomains=${PWD}/node_modules/@ensdomains/ contracts/v0.8/InitAPI.sol --output-dir ./build/v0.8 --overwrite --bin --hashes --opcodes --abi
./bin/solc solidity-cborutils=${PWD}/node_modules/solidity-cborutils/ @openzeppelin=${PWD}/node_modules/@openzeppelin/ @ensdomains=${PWD}/node_modules/@ensdomains/ contracts/v0.8/AccountAPI.sol --output-dir ./build/v0.8 --overwrite --bin --hashes --opcodes --abi
./bin/solc solidity-cborutils=${PWD}/node_modules/solidity-cborutils/ @openzeppelin=${PWD}/node_modules/@openzeppelin/ @ensdomains=${PWD}/node_modules/@ensdomains/ contracts/v0.8/MultisigAPI.sol --output-dir ./build/v0.8 --overwrite --bin --hashes --opcodes --abi
./bin/solc solidity-cborutils=${PWD}/node_modules/solidity-cborutils/ @openzeppelin=${PWD}/node_modules/@openzeppelin/ @ensdomains=${PWD}/node_modules/@ensdomains/ contracts/v0.8/PrecompilesAPI.sol --output-dir ./build/v0.8 --overwrite --bin --hashes --opcodes --abi
./bin/solc solidity-cborutils=${PWD}/node_modules/solidity-cborutils/ @openzeppelin=${PWD}/node_modules/@openzeppelin/ @ensdomains=${PWD}/node_modules/@ensdomains/ contracts/v0.8/Utils.sol --output-dir ./build/v0.8 --overwrite --bin --hashes --opcodes --abi
./bin/solc solidity-cborutils=${PWD}/node_modules/solidity-cborutils/ @openzeppelin=${PWD}/node_modules/@openzeppelin/ @ensdomains=${PWD}/node_modules/@ensdomains/ contracts/v0.8/SendAPI.sol --output-dir ./build/v0.8 --overwrite --bin --hashes --opcodes --abi
Expand Down Expand Up @@ -91,9 +89,6 @@ test_init_integration: build build_builtin_actors
test_account_integration: build build_builtin_actors
cd testing && cargo test account_test -- --nocapture

test_multisig_integration: build build_builtin_actors
cd testing && cargo test multisig_test -- --nocapture

test_precompiles_integration: build build_builtin_actors
cd testing && cargo test precompiles_test -- --nocapture

Expand Down
2 changes: 1 addition & 1 deletion contracts/v0.8/AccountAPI.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import "./cbor/BytesCbor.sol";
import "./utils/Misc.sol";
import "./utils/Actor.sol";

/// @title This contract is a proxy to the Account actor. Calling one of its methods will result in a cross-actor call being performed.
/// @title This library is a proxy to the Account actor. Calling one of its methods will result in a cross-actor call being performed.
/// @author Zondax AG
library AccountAPI {
using AccountCBOR for *;
Expand Down
2 changes: 1 addition & 1 deletion contracts/v0.8/DataCapAPI.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import "./cbor/DataCapCbor.sol";
import "./cbor/BytesCbor.sol";
import "./utils/Actor.sol";

/// @title This contract is a proxy to the singleton DataCap actor (address: f0X). Calling one of its methods will result in a cross-actor call being performed.
/// @title This library is a proxy to the singleton DataCap actor (address: f0X). Calling one of its methods will result in a cross-actor call being performed.
/// @author Zondax AG
library DataCapAPI {
using DataCapCBOR for *;
Expand Down
2 changes: 1 addition & 1 deletion contracts/v0.8/InitAPI.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import "./cbor/InitCbor.sol";
import "./utils/Misc.sol";
import "./utils/Actor.sol";

/// @title This contract is a proxy to the singleton Init actor (address: f01). Calling one of its methods will result in a cross-actor call being performed.
/// @title This library is a proxy to the singleton Init actor (address: f01). Calling one of its methods will result in a cross-actor call being performed.
/// @author Zondax AG
library InitAPI {
using InitCBOR for *;
Expand Down
2 changes: 1 addition & 1 deletion contracts/v0.8/MarketAPI.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import "./types/CommonTypes.sol";
import "./utils/Misc.sol";
import "./utils/Actor.sol";

/// @title This contract is a proxy to the singleton Storage Market actor (address: f05). Calling one of its methods will result in a cross-actor call being performed.
/// @title This library is a proxy to the singleton Storage Market actor (address: f05). Calling one of its methods will result in a cross-actor call being performed.
/// @author Zondax AG
library MarketAPI {
using BytesCBOR for bytes;
Expand Down
2 changes: 1 addition & 1 deletion contracts/v0.8/MinerAPI.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import "./cbor/BytesCbor.sol";
import "./utils/Misc.sol";
import "./utils/Actor.sol";

/// @title This contract is a proxy to a built-in Miner actor. Calling one of its methods will result in a cross-actor call being performed.
/// @title This library is a proxy to a built-in Miner actor. Calling one of its methods will result in a cross-actor call being performed.
/// @notice During miner initialization, a miner actor is created on the chain, and this actor gives the miner its ID f0.... The miner actor is in charge of collecting all the payments sent to the miner.
/// @dev For more info about the miner actor, please refer to https://lotus.filecoin.io/storage-providers/operate/addresses/
/// @author Zondax AG
Expand Down
Loading

0 comments on commit d5457f6

Please sign in to comment.