From 60168a0f5cdf8c94eb6e687450bcd2746e33511c Mon Sep 17 00:00:00 2001 From: WMQ <46511820+wangminqi@users.noreply.github.com> Date: Fri, 24 Nov 2023 15:49:23 +0800 Subject: [PATCH 1/3] P 262 evm extra (#2274) * feat: sync stop because of frontier block import * feat: change workflow for docker log * debug: fmt * debug: docker name --- .github/workflows/simulate-runtime-upgrade.yml | 17 +++++++++++++++++ .gitignore | 1 + node/src/service.rs | 18 ++---------------- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/.github/workflows/simulate-runtime-upgrade.yml b/.github/workflows/simulate-runtime-upgrade.yml index df6fe7249c..556090c1cb 100644 --- a/.github/workflows/simulate-runtime-upgrade.yml +++ b/.github/workflows/simulate-runtime-upgrade.yml @@ -52,3 +52,20 @@ jobs: timeout-minutes: 10 run: | ./scripts/runtime-upgrade.sh ${{ matrix.chain }}-parachain-runtime.compact.compressed.wasm ${{ env.RELEASE_TAG }} + + - name: Collect docker logs if test fails + continue-on-error: true + uses: jwalton/gh-docker-logs@v2 + if: failure() + with: + tail: all + dest: docker-logs + + - name: Upload docker logs if test fails + uses: actions/upload-artifact@v3 + if: failure() + with: + name: ${{ matrix.chain }}-docker-logs + path: docker-logs + if-no-files-found: ignore + retention-days: 3 diff --git a/.gitignore b/.gitignore index 817c0f828d..86c540ba42 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ .cargo/config **/node_modules/ +**/ts-tests/.yarn docker/generated-*/ tee-worker/docker/litentry/ diff --git a/node/src/service.rs b/node/src/service.rs index efe003f24d..44ae29fdc5 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -45,7 +45,6 @@ use cumulus_primitives_parachain_inherent::{ use cumulus_relay_chain_inprocess_interface::build_inprocess_relay_chain; use cumulus_relay_chain_interface::{RelayChainError, RelayChainInterface, RelayChainResult}; use cumulus_relay_chain_minimal_node::build_minimal_relay_chain_node; -use fc_consensus::FrontierBlockImport; use fc_rpc::{EthBlockDataCacheTask, OverrideHandle}; use fc_rpc_core::types::{FeeHistoryCache, FilterPool}; use futures::StreamExt; @@ -162,15 +161,8 @@ pub mod __ { TParachainBlockImport>, ParachainBackend>; #[evm] - type ParachainBlockImport = TParachainBlockImport< - Block, - FrontierBlockImport< - Block, - Arc>, - ParachainClient, - >, - ParachainBackend, - >; + type ParachainBlockImport = + TParachainBlockImport>, ParachainBackend>; #[no_evm] /// Starts a `ServiceBuilder` for a full service. @@ -329,13 +321,7 @@ pub mod __ { #[evm] let frontier_backend = rpc_evm::open_frontier_backend(client.clone(), config)?; - #[evm] - let frontier_block_import = FrontierBlockImport::new(client.clone(), client.clone()); - #[evm] - let block_import = ParachainBlockImport::new(frontier_block_import, backend.clone()); - - #[no_evm] let block_import = ParachainBlockImport::new(client.clone(), backend.clone()); let import_queue = build_import_queue( From 1ae54498826f40bcb6f5b342343b7a618c54dd07 Mon Sep 17 00:00:00 2001 From: Kai <7630809+Kailai-Wang@users.noreply.github.com> Date: Fri, 24 Nov 2023 11:57:55 +0100 Subject: [PATCH 2/3] Fix docker tag in release bot (#2276) --- .github/workflows/release-bot.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-bot.yml b/.github/workflows/release-bot.yml index 9e6ff79426..bb3b71bbee 100644 --- a/.github/workflows/release-bot.yml +++ b/.github/workflows/release-bot.yml @@ -9,6 +9,11 @@ jobs: # this means the release contains a new docker image (thus a new client) if: contains(github.event.release.body, 'litentry/litentry-parachain:v') steps: + - name: Set env + run: | + DOCKER_TAG=$(echo ${{ env.RELEASE_TAG }} | cut -d'-' -f1 | sed 's/p/v/') + echo "DOCKER_TAG=$DOCKER_TAG" >> $GITHUB_ENV + - name: Post discord message env: DISCORD_WEBHOOK: ${{ secrets.RELEASE_BOT_DISCORD_WEBHOOK }} @@ -18,7 +23,7 @@ jobs: args: | Hi @everyone, 🚀 A new client release has been built: https://github.com/litentry/litentry-parachain/releases/tag/${{ github.event.release.tag_name }} - ✨ Please update the client using the docker image litentry/litentry-parachain:${{ github.event.release.tag_name }} + ✨ Please update the client using the docker image litentry/litentry-parachain:$DOCKER_TAG - name: Update litmus image version uses: "OnFinality-io/action-onf-release@v1" @@ -33,7 +38,7 @@ jobs: # Add a new image version to network spec onf-sub-command: image onf-action: add - image-version: ${{ github.event.release.tag_name }} + image-version: $DOCKER_TAG - name: Update litentry image version uses: "OnFinality-io/action-onf-release@v1" @@ -48,5 +53,5 @@ jobs: # Add a new image version to network spec onf-sub-command: image onf-action: add - image-version: ${{ github.event.release.tag_name }} + image-version: $DOCKER_TAG From c6dc6138a867eef0df959b1520c397d944b6ac58 Mon Sep 17 00:00:00 2001 From: Zhouhui Tian <125243011+zhouhuitian@users.noreply.github.com> Date: Fri, 24 Nov 2023 20:50:03 +0800 Subject: [PATCH 3/3] Update AchainableNameAmount (#2277) Co-authored-by: Kai <7630809+Kailai-Wang@users.noreply.github.com> --- .../assertion-build/src/achainable/amount.rs | 8 +++--- .../data-providers/src/achainable_names.rs | 25 +++++++++++-------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/tee-worker/litentry/core/assertion-build/src/achainable/amount.rs b/tee-worker/litentry/core/assertion-build/src/achainable/amount.rs index 7733e1da04..a3dd24bf74 100644 --- a/tee-worker/litentry/core/assertion-build/src/achainable/amount.rs +++ b/tee-worker/litentry/core/assertion-build/src/achainable/amount.rs @@ -25,7 +25,7 @@ use crate::{ *, }; use lc_credentials::litentry_profile::holding_amount::LitentryProfileHoldingAmount; -use lc_data_providers::{achainable_names::AchainableNameBalance, ConvertParameterString}; +use lc_data_providers::{achainable_names::AchainableNameAmount, ConvertParameterString}; const CREATED_OVER_AMOUNT_CONTRACTS: &str = "Created over {amount} contracts"; const BALANCE_OVER_AMOUNT: &str = "Balance over {amount}"; @@ -107,7 +107,7 @@ pub fn build_amount(req: &AssertionBuildRequest, param: AchainableAmount) -> Res .collect::>(); let achainable_param = AchainableParams::Amount(param.clone()); - let bname = AchainableNameBalance::from(achainable_param.name()).map_err(|e| { + let bname = AchainableNameAmount::from(achainable_param.name()).map_err(|e| { Error::RequestVCFailed( Assertion::Achainable(achainable_param.clone()), e.into_error_detail(), @@ -115,7 +115,7 @@ pub fn build_amount(req: &AssertionBuildRequest, param: AchainableAmount) -> Res })?; let mut balance = 0.0; let mut flag = false; - if bname == AchainableNameBalance::BalanceUnderAmount { + if bname == AchainableNameAmount::BalanceUnderAmount { balance = request_achainable_balance(addresses, achainable_param.clone())? .parse::() .map_err(|_| { @@ -130,7 +130,7 @@ pub fn build_amount(req: &AssertionBuildRequest, param: AchainableAmount) -> Res match Credential::new(&req.who, &req.shard) { Ok(mut credential_unsigned) => { - if bname == AchainableNameBalance::BalanceUnderAmount { + if bname == AchainableNameAmount::BalanceUnderAmount { credential_unsigned.update_eth_holding_amount(balance); } else { let (desc, subtype, content) = diff --git a/tee-worker/litentry/core/data-providers/src/achainable_names.rs b/tee-worker/litentry/core/data-providers/src/achainable_names.rs index 35a168a1b6..21e8b41f10 100644 --- a/tee-worker/litentry/core/data-providers/src/achainable_names.rs +++ b/tee-worker/litentry/core/data-providers/src/achainable_names.rs @@ -55,29 +55,34 @@ impl AchainableNameMirror { } } +// The Achainable API using these names can share this structure #[derive(Debug, PartialEq)] -pub enum AchainableNameBalance { +pub enum AchainableNameAmount { BalanceUnderAmount, BalanceOverAmount, + CreatedOverAmountContracts, } -impl GetAchainableName for AchainableNameBalance { +impl GetAchainableName for AchainableNameAmount { fn name(&self) -> &'static str { match self { - AchainableNameBalance::BalanceUnderAmount => "Balance under {amount}", - AchainableNameBalance::BalanceOverAmount => "Balance over {amount}", + AchainableNameAmount::BalanceUnderAmount => "Balance under {amount}", + AchainableNameAmount::BalanceOverAmount => "Balance over {amount}", + AchainableNameAmount::CreatedOverAmountContracts => "Created over {amount} contracts", } } } -impl AchainableNameBalance { - pub fn from(param: ParameterString) -> Result { +impl AchainableNameAmount { + pub fn from(param: ParameterString) -> Result { let name_str = vec_to_string(param.to_vec())?; - if name_str == AchainableNameBalance::BalanceUnderAmount.name() { - return Ok(AchainableNameBalance::BalanceUnderAmount) - } else if name_str == AchainableNameBalance::BalanceOverAmount.name() { - return Ok(AchainableNameBalance::BalanceOverAmount) + if name_str == AchainableNameAmount::BalanceUnderAmount.name() { + return Ok(AchainableNameAmount::BalanceUnderAmount) + } else if name_str == AchainableNameAmount::BalanceOverAmount.name() { + return Ok(AchainableNameAmount::BalanceOverAmount) + } else if name_str == AchainableNameAmount::CreatedOverAmountContracts.name() { + return Ok(AchainableNameAmount::CreatedOverAmountContracts) } Err(Error::AchainableError("Invalid Achainable Name".to_string()))