Giter Club home page Giter Club logo

swisstronik-chain's People

Contributors

deep-quality-dev avatar delneg avatar dylanschultzie avatar kenta92115 avatar mikkysnow avatar web3js-org avatar zagrebelin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

swisstronik-chain's Issues

Err environment configuration of key "gas price" in app.toml or environment

1. Bug/Vulnerability Description

Error while doing a local development test on a docker image.
ERR invalid server config error="set min gas price in app.toml or flag or env variable: error in app.toml

2. Hardware and Software Specifications

  • OS Name & version : Ubuntu 20.04
  • CPU Name & Brand : linux/amd64
  • Go version : 1.20.5
  • Rust version (x)
  • SGX version (optional)
  • Docker environment

3. Steps to Reproduce

  1. make init
  2. make build-docker-local

And I tried to test on the local version for up docker with docker-compose -f local-network.yml up

4. Impact Analysis

If this were applied to the developer, the developer would be confused because the documentation is incomplete in the README.md Repository.

Better to write complete with git-book or something else.

Very important because it supports the development of public tests and audits.

5. Code Fix Submission

I've tried adding the app.toml file in config, front page, and app. but the result is nil

6. Choose the Right Label

Documentation, Developer, Gas Price, app.toml, configuration

7. Additional Context

node0    | 3:59AM ERR invalid server config error="set min gas price in app.toml or flag or env variable: error in app.toml"
node0    | Error: set min gas price in app.toml or flag or env variable: error in app.toml

Thank you for contributing to the improvement of our project!๐Ÿ‘จโ€๐Ÿ’ป๐Ÿ‘ฉโ€๐Ÿ’ป


Swisstronik internal use only

  • Not duplicate issue
  • Appropriate labels applied

Remote Attestation server stops peers communication

1. Bug/Vulnerability Description

Multiple calls to 46789 (port of Remote Attestation server) stops production of new blocks / communication with other peers

2. Hardware and Software Specifications

  • OS Name & version: Ubuntu 22.04
  • CPU Name & Brand Intel Xeon E-2286G
  • Go version: 1.18
  • Rust version 9eb3afe9e 2023-03-27
  • SGX version (optional) sdk 1.15
  • [-] Docker environment

3. Steps to Reproduce

Send >10 remote attestation requests to 46789 port of node using swisstronikd request-master-key [node_address]

4. Impact Analysis

This issue makes node to lose connection to other peers / stops block production

5. Code Fix Submission

Make Remote Attestation server another service, which should run separately


Thank you for contributing to the improvement of our project!๐Ÿ‘จโ€๐Ÿ’ป๐Ÿ‘ฉโ€๐Ÿ’ป


Swisstronik internal use only

  • [+] Not duplicate issue
  • [+] Appropriate labels applied

Exceeds block gas limit in local testnet

1. Bug/Vulnerability Description

EVM fails on any transaction with error Exceeds block gas limit if max_gas param set to -1 at consensus_params in genesis.json

  "consensus_params": {
    "block": {
      "max_bytes": "22020096",
      "max_gas": "-1",
      "time_iota_ms": "1000"
    }

2. Hardware and Software Specifications

  • OS Name & version: Ubuntu 22.04
  • CPU Name & Brand Intel Xeon E2236
  • Go version -
  • Rust version -
  • SGX version (optional)
  • [-] Docker environment

3. Steps to Reproduce

Set max_gas in genesis.json to -1

4. Impact Analysis

genesis.json files, generated by swisstronikd testnet init-files command will have such issue

5. Code Fix Submission

Replace default value of max_gas (-1) with actual block gas limit (20_000_000) in swisstronikd testnet init-files command

6. Choose the Right Label

ADDITIONAL BUGS, NODE BUGS


Thank you for contributing to the improvement of our project!๐Ÿ‘จโ€๐Ÿ’ป๐Ÿ‘ฉโ€๐Ÿ’ป


Swisstronik internal use only

  • [+] Not duplicate issue
  • [+] Appropriate labels applied

Bash Script for EVM Initialization and Configuration

The provided bash script aims to perform initialization and configuration of the EVM (Ethereum Virtual Machine). However, there are several potential issues that need to be addressed to enhance the script's security, stability, and overall performance.

Recommended Improvements:

  1. Parameter Validation:

    • Add validation to check whether the $1 (MONIKER) and $2 (RPC URL) parameters have been provided before proceeding with the script execution. This will help prevent errors that may occur due to invalid inputs.
    • Example improvement:
      MONIKER=$1
      RPC=$2
      
      if [[ -z $MONIKER ]]; then
          echo >&2 "Invalid MONIKER"
          exit 1
      fi
      
      if [[ -z $RPC ]]; then
          echo >&2 "Invalid RPC URL"
          exit 1
      fi
  2. Error Handling:

    • Add error handling when executing the SGX_MODE=SW make build-enclave and make install commands. This will help to know if there are any issues during the compilation or installation process and provide better information about those errors.
    • Example improvement:
      cd $HOME/chain/ && git pull && SGX_MODE=SW make build-enclave
      if [ $? -ne 0 ]; then
          echo >&2 "Failed to compile SGX_MODE=SW"
          exit 1
      fi
      
      cd $HOME/chain/ && make install
      if [ $? -ne 0 ]; then
          echo >&2 "Failed to install"
          exit 1
      fi
  3. Optimize Commands:

    • Simplify some sequential commands to improve code readability and compactness.
    • Example improvement:
      cd $HOME/chain/ && git pull && SGX_MODE=SW make build-enclave && make install
  4. Appropriate Access Rights:

    • Ensure that this script is executed with appropriate access rights for the sudo rm -rf $HOMEDIR command. This command has the potential to delete directories and their contents, which could have significant impacts on the system.
    • Use with caution and ensure that root access is not misused in this script.
  5. Environment Testing:

    • Ensure that the environment required by the script is properly configured, including variables like $HOME/chain/ and external dependencies such as jq and the swisstronikd service. Make sure that all dependencies are met before running the script.
  6. Default Value Replacements:

    • Some values in the genesis.json file will be replaced. Ensure that these changes align with the needs and purposes of the initialized and configured EVM.

Can't build binary file use ubuntu 22.04 with SGX enabled

Got this err when run make build

Compile into Enclave_t.o
Compile into unsinged enclave
/usr/bin/ld: /opt/intel/sgxsdk/lib64/libsgx_tprotected_fs.a(file_flush.o): in function `protected_fs_file::multi_thread_update_data_nodes()':
file_flush.cpp:(.text._ZN17protected_fs_file30multi_thread_update_data_nodesEv+0x472): undefined reference to `pthread_create'
/usr/bin/ld: file_flush.cpp:(.text._ZN17protected_fs_file30multi_thread_update_data_nodesEv+0x4bf): undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status

My server support SGX and SGX SDK installed

cpuid -1 | grep SGX
      SGX: Software Guard Extensions supported = true
      SGX_LC: SGX launch config supported      = true
   Software Guard Extensions (SGX) capability (0x12/0):
      SGX1 supported                           = true
      SGX2 supported                           = false
      SGX ENCLV E*VIRTCHILD, ESETCONTEXT       = false
      SGX ENCLS ETRACKC, ERDINFO, ELDBC, ELDUC = false
   SGX attributes: ECREATE SECS.ATTRIBUTES (0x12/1):
   SGX Enclave Page Cache (EPC) enumeration (0x12/0x2):
   SGX Enclave Page Cache (EPC) enumeration (0x12/0x3):
ls /opt/intel/sgxsdk/
SampleCode  bin  buildenv.mk  environment  include  lib64  licenses  pkgconfig  sdk_libs  uninstall.sh
ls /dev/sgx*
/dev/sgx_enclave  /dev/sgx_provision  /dev/sgx_vepc

/dev/sgx:
enclave  provision

Unused code in "x/swisstronik/client/cli/tx.go"

1. Bug/Vulnerability Description

It is recommended to keep the codebase clean by removing unused code.

2. Hardware and Software Specifications

  • OS Name & version Ubuntu 20.04
  • CPU Name & Brand linux/amd64
  • Go version 1.20.5

3. Steps to Reproduce

const (
	flagPacketTimeoutTimestamp = "packet-timeout-timestamp"
	listSeparator              = ","
)

4. Impact Analysis

This part of the code has not been used anywhere in the project and is not exported. Maybe it was mistakenly left behind while refactoring or was intended to be used somewhere but remained unused by mistake..

5. Code Fix Submission

Delete un-used code

6. Choose the Right Label

clean-code

Swisstronik internal use only

  • Not duplicate issue
  • Appropriate labels applied

Platform is updated but requires further BIOS configuration

When creating the master key via swisstronikd request-master-key, the following error is thrown:

1. Bug/Vulnerability Description

Platform is updated but requires further BIOS configuration
The following vulnerabilities must be mitigated: ["INTEL-SA-00289", "You must disable overclocking/undervolting in the BIOS"]
outdated_ok is set, overriding outdated error
SIGILL: illegal instruction
PC=0x7f7db7bad32f m=7 sigcode=2
signal arrived during cgo execution
instruction bytes: 0xf 0x1 0xd7 0xf 0xb 0xf3 0xf 0x1e 0xfa 0xf3 0xf 0x1e 0xfa 0x48 0x8d 0x5

2. Hardware and Software Specifications

  • Ubuntu 20.04.6 LTS
  • Intel(R) Xeon(R) E-2278G CPU @ 3.40GHz
  • go version go1.19.9 linux/amd64
  • rustc 1.71.1 (eb26296b5 2023-08-03)
  • SGX version (optional)

swisstronikd version --long
build_deps:

3. Steps to Reproduce

Issue occored, when creating the master key
swisstronikd request-master-key <

4. Impact Analysis

Not able to create the master key

Swisstronik internal use only

  • Not duplicate issue
  • Appropriate labels applied

stable-x86_64-unknown-linux-gnu installed - rustc 1.71.0 not compatible

Bug Report Template

Please use this template to report bugs or vulnerabilities. Please fill out all the sections below:

1. Bug/Vulnerability Description

I'm using rustup version 1.71.0, and the command can't run

2. Hardware and Software Specifications

  • OS Name & version
  • CPU Name & Brand
  • Go version
  • Rust version
    stable-x86_64-unknown-linux-gnu installed - rustc 1.71.0 (8ede3aae2 2023-07-12)
  • SGX version (optional)
  • Docker environment

3. Steps to Reproduce

Provide clear and concise instructions to reproduce the reported bug or vulnerability.

4. Impact Analysis

Analyze the potential consequences of the bug or vulnerability on users, developers, and the organization.

5. Code Fix Submission

(Optional) If you have a suggestion for fixing the bug or vulnerability, provide a code fix or a proposed solution.

6. Choose the Right Label

Choose the suitable label/s that represents the nature of the issue being resolved, indicating its specific category and severity of the vulnerability

7. Additional Context

(Optional)Share any relevant context, screenshots, logs, or error messages that can facilitate problem-solving and comprehensive understanding.
image
image


Thank you for contributing to the improvement of our project!๐Ÿ‘จโ€๐Ÿ’ป๐Ÿ‘ฉโ€๐Ÿ’ป


Swisstronik internal use only

  • Not duplicate issue
  • Appropriate labels applied

Avoid use of == and != in "tests/solidity/test/ERC20.js"

1. Bug/Vulnerability Description

It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

The strict equality operators (=== and !==) use the strict equality comparison algorithm to compare two operands.

2. Hardware and Software Specifications

  • OS Name & version Ubuntu 20.04
  • CPU Name & Brand linux/amd64
  • Go version 1.20.5

3. Steps to Reproduce

Sample BAD PRACTICE AND RECOMMENDED
BAD PRACTICE

a == b
foo == true
bananas != 1
value == undefined
typeof foo == 'undefined'
'hello' != 'world'
0 == 0
true == true
foo == null

RECOMMENDED

a === b
foo === true
bananas !== 1
value === undefined
typeof foo === 'undefined'
'hello' !== 'world'
0 === 0
true === true
foo === null

4. Impact Analysis

  • If the operands are of different types, return false.
  • If both operands are objects, return true only if they refer to the same object.
  • If both operands are null or both operands are undefined, return true.
  • If either operand is NaN, return false.
  • Otherwise, compare the two operand's values:
    Numbers must have the same numeric values. +0 and -0 are considered to be the same value.
    Strings must have the same characters in the same order.
    Booleans must be both true or both false.

The most notable difference between this operator and the equality (==) operator is that if the operands are of different types, the == operator attempts to convert them to the same type before comparing.

6. Choose the Right Label

operators, strict, quality

Swisstronik internal use only

  • Not duplicate issue
  • Appropriate labels applied

There was a problem when I was going to do the "make install" command in the terminal

Screenshot_2023-07-28-14-25-12-553-edit_com server auditor ssh client

Bug Report Template

Please use this template to report bugs or vulnerabilities. Please fill out all the sections below:

1. Bug/Vulnerability Description

Clearly state and describe the identified bug or vulnerability.

2. Hardware and Software Specifications

  • OS Name & version
  • CPU Name & Brand
  • Go version
  • Rust version
  • SGX version (optional)
  • Docker environment

3. Steps to Reproduce

Provide clear and concise instructions to reproduce the reported bug or vulnerability.

4. Impact Analysis

Analyze the potential consequences of the bug or vulnerability on users, developers, and the organization.

5. Code Fix Submission

(Optional) If you have a suggestion for fixing the bug or vulnerability, provide a code fix or a proposed solution.

6. Choose the Right Label

Choose the suitable label/s that represents the nature of the issue being resolved, indicating its specific category and severity of the vulnerability

7. Additional Context

(Optional)Share any relevant context, screenshots, logs, or error messages that can facilitate problem-solving and comprehensive understanding.


Thank you for contributing to the improvement of our project!๐Ÿ‘จโ€๐Ÿ’ป๐Ÿ‘ฉโ€๐Ÿ’ป


Swisstronik internal use only

  • Not duplicate issue
  • Appropriate labels applied

test issue

Bug Report Template

Please use this template to report bugs or vulnerabilities. Please fill out all the sections below:

1. Bug/Vulnerability Description

Clearly state and describe the identified bug or vulnerability.

2. Hardware and Software Specifications

  • OS Name & version
  • CPU Name & Brand
  • Go version
  • Rust version
  • SGX version (optional)
  • Docker environment

3. Steps to Reproduce

Provide clear and concise instructions to reproduce the reported bug or vulnerability.

4. Impact Analysis

Analyze the potential consequences of the bug or vulnerability on users, developers, and the organization.

5. Code Fix Submission

(Optional) If you have a suggestion for fixing the bug or vulnerability, provide a code fix or a proposed solution.

6. Choose the Right Label

Choose the suitable label/s that represents the nature of the issue being resolved, indicating its specific category and severity of the vulnerability

7. Additional Context

(Optional)Share any relevant context, screenshots, logs, or error messages that can facilitate problem-solving and comprehensive understanding.


Thank you for contributing to the improvement of our project!๐Ÿ‘จโ€๐Ÿ’ป๐Ÿ‘ฉโ€๐Ÿ’ป


Swisstronik internal use only

  • Not duplicate issue
  • Appropriate labels applied

ICA Controller route not found when registering Interchain Account

Bugs: ICA Controller route not found when registering Interchain Account

1. Bug/Vulnerability Description

Unable to register an Interchain Account from ICA Controller Module.

2. Hardware and Software Specifications

WSL Ubuntu 22

3. Steps to Reproduce

  1. Run hermes relayer between Swisstronik Testnet with Cosmos Hub Testnet
  2. Create relayer connection
    CMD: hermes create connection --a-chain swisstronik_1291-1 --b-chain theta-testnet-001
    image
    And we got connection-0 for swisstronik testnet
  3. Register Interchain Account using connection-0
    CMD: swisstronikcli tx interchain-accounts controller register connection-0 --from test2 --gas-prices 7uswtr -y
    And the transaction will fail like in this one Tx Hash due to route not found for module ica controller
    image

4. Impact Analysis

Swisstronik testnet is unable to register an interchain account due to the ICA Controller module route not found. It happens due to ICA Controller module hasnโ€™t registered on IBC Router yet, as seen below
image

5. Code Fix Submission

  • If ICA Controller is important for swisstronik then add the IBC route AddRoute(icacontrollertypes.SubModuleName, icaControllerStack)
  • But if ICA Controller is not aligned with swisstronik use cases then the ICA Controller module can be disabled

6. Choose the Right Label

bug

7. Additional Context

Tx History Register ICA


Thank you for contributing to the improvement of our project!๐Ÿ‘จโ€๐Ÿ’ป๐Ÿ‘ฉโ€๐Ÿ’ป


Swisstronik internal use only

  • Not duplicate issue
  • Appropriate labels applied

Set mint function to private & only dev can mint token in .../solidity/contracts/ERC20Token.sol

Bug Report Template

Please use this template to report bugs or vulnerabilities. Please fill out all the sections below:

1. Bug/Vulnerability Description

Vulnerability in the .../solidity/contracts/ERC20Token.sol contract, that is allows anyone mint the token outside the contract.

2. Hardware and Software Specifications

Ubuntu 20.04 LTS
Linux/amd64
Go version 1.20.5

3. Steps to Reproduce

Add new function to contract, and set only Deployer can mint using 'msg.Sender' function to allows dev mint token.

function mint(address to, uint256 amount) public {
require(msg.sender == owner, "Add require statements, Only the owner can call the mint function");
_mint(to, amount);
}

4. Impact Analysis

The token can be minted by anyone from outside the contract , so it will make token supply will increased without any control from the team, this can make a bad reputation to the tram project.

5. Code Fix Submission

// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract ERC20Token is ERC20 {
address private owner;
constructor(string memory name, string memory symbol, uint256 initialSupply) ERC20(name, symbol) {
_mint(msg.sender, initialSupply);
owner = msg.sender;
}
function private_mint(address to, uint256 amount) private {
_mint(to, amount);
}
function public_mint(address to, uint256 amount) public {
require(msg.sender == owner, "Only the owner can call public_mint");
private_mint(to, amount);
}
}

6. Choose the Right Label

Minting issue in contract

7. Additional Context

(Optional)Share any relevant context, screenshots, logs, or error messages that can facilitate problem-solving and comprehensive understanding.


Thank you for contributing to the improvement of our project!๐Ÿ‘จโ€๐Ÿ’ป๐Ÿ‘ฉโ€๐Ÿ’ป


Swisstronik internal use only

  • Not duplicate issue
  • Appropriate labels applied

BUG IN SGX

For now, you can use any Intel CPU that supports SGX through SPS, but not all Intel CPUs can be used to support SGX through SPS

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.