Giter VIP home page Giter VIP logo

automata's People

Contributors

chanson-chan avatar chzyer avatar frankata avatar gnnng avatar kayryu avatar liao1 avatar ljiacheng avatar melynx avatar prz23 avatar ryuh1 avatar

Stargazers

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

Watchers

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

automata's Issues

Adds an Aura Consensus algorithm to Runtime

Now start the development network using the BABE algorithm.If there is only a single node, the network will not function properly after being shut down for a period of time, which is not conducive to internal testing.

So it makes more sense to change the BABE algorithm to the AURA algorithm.

The error message:

ClientImport("Unexpected epoch change")  

Evm/Substrate address mapping

We can use subkey to generate a sr25519 key pair, we will get the Secret Seed and Account ID, Account ID is the substrate address(let us call it as addressA), and you can genarate the private key using this secret seed.
Besides, we can import the generated private key into Metamask and get a corresponding evm address(call it addressB), but actually these 2 addresses are address of 2 different account.
We can do a experimentation:

  1. using the evm address we get above to get 10 testnet ATA from faucet
  2. import the substrate address into blockchain explorer
  3. get balance of the imported account in step#2(Developer -> Chain state -> system -> account)
    We will find tha balance of the imported account is not 10, actually is 0 if it is a new generated account

Then you can use code below to calculate a substrate address from the evm address, <evm address> is the address in Metamask without leading 0x

use blake2::VarBlake2b;
use blake2::digest::{Update, VariableOutput};
use hex;

fn main() {
    // create a Blake2b object
    let mut hasher = VarBlake2b::new(32).unwrap();

    // write input message
    let mut data = [0_u8; 24];
    data[0..4].copy_from_slice(b"evm:");
    data[4..24].copy_from_slice(&hex::decode("<evm address>").unwrap());

    hasher.update(&data);

    // read hash digest and consume hasher
    let _res = hasher.finalize_variable(|res| {
        println!("{:?}", hex::encode(&res[..]));
    });
}

you will get a string like 65f5fbd10250447019bb8b9e06f6918d033b2feb6478470137b1a552656e2911 by running code above, then come back to blockchain explorer, paste the string here(we will get a another address, call it addressC ) and call account function:
image
you will find that balance of this account is 10 ATA(or 10 BATA)
The result verifies that actually addressA and addressB are 2 different account in our chain, addressB and addressC are same account in our chain.
Currently, assume that someone have some ata in his evm address account, and he want to interact(send extrinsics) with our chain, it is impossible because he doesn't know the private key of corresponding substrate address.
So maybe we need to change the mapping methods in evm pallet, take the previous example, we should mapping addressA to addressB

Fail to start a local testnet using locally built image to evaluate local changes

When I execute the following command in readme.md, to test how to setup an environment if we do some local changes.
./scripts/run-network.sh --build

It will occur error at the end of docker building:

Image: automata
Chain: local
ERROR: Version in "./docker-compose.yml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/

Any suggestion about the this issue? The build will succeed if I specify the version form "3.7" to "3.3" and move it under the services key, but not sure whether this change will impact our code or logic.

Problematic implements

  1. Need to check if the instance exist before using it (will not record issues in fulfillment pallet, since this pallet will be removed)
    After the block has been initialized, each valid extrinsic is executed in order of transaction priority. Extrinsics must not cause a panic in the runtime logic or else the system becomes vulnerable to attacks where users can trigger computational execution without any punishment. --Substrate Developer Hub
    let mut attestor = <Attestors<T>>::get(&who);
    attestor.url = url;

x86 building with Rust Nightly Compiling ed25519 v1.3.0 cannot find trait `Signature` in crate `signature`

Compiling ed25519 v1.3.0 (https://github.com/RustCrypto/signatures.git?tag=ed25519/v1.3.0#8282fcaf)
error[E0405]: cannot find trait Signature in crate signature
--> /home/user/.cargo/git/checkouts/signatures-a6df6df1cc32e789/8282fca/ed25519/src/lib.rs:349:17
|
349 | impl signature::Signature for Signature {
| ^^^^^^^^^ not found in signature

For more information about this error, try rustc --explain E0405.
Compiling regex-automata v0.4.3
error: could not compile ed25519 (lib) due to previous error
warning: build failed, waiting for other jobs to finish...

cargo 1.75.0-nightly (6fa6fdc76 2023-10-10) - do not impact - many trials on diferent days after cargo update

Building on x86 with rust nightly, proc-macro2 v1.0.38 fail

automata$ cargo build
Compiling proc-macro2 v1.0.38
error[E0422]: cannot find struct, variant or union type LineColumn in crate proc_macro
--> /home/am/.cargo/registry/src/index.crates.io-6f17d22bba15001f/proc-macro2-1.0.38/src/wrapper.rs:485:33
|
485 | let proc_macro::LineColumn { line, column } = s.start();
| ^^^^^^^^^^ not found in proc_macro
|
help: consider importing one of these items
|
1 + use crate::LineColumn;
|
1 + use crate::fallback::LineColumn;
|
help: if you import LineColumn, refer to it directly
|
485 - let proc_macro::LineColumn { line, column } = s.start();
485 + let LineColumn { line, column } = s.start();
|

error[E0422]: cannot find struct, variant or union type LineColumn in crate proc_macro
--> /home/am/.cargo/registry/src/index.crates.io-6f17d22bba15001f/proc-macro2-1.0.38/src/wrapper.rs:502:33
|
502 | let proc_macro::LineColumn { line, column } = s.end();
| ^^^^^^^^^^ not found in proc_macro
|
help: consider importing one of these items
|
1 + use crate::LineColumn;
|
1 + use crate::fallback::LineColumn;
|
help: if you import LineColumn, refer to it directly
|
502 - let proc_macro::LineColumn { line, column } = s.end();
502 + let LineColumn { line, column } = s.end();
|

For more information about this error, try rustc --explain E0422.
error: could not compile proc-macro2 (lib) due to 2 previous errors

Runing automata net on frsh Ubuntu 21.04

Hi, I conduct build process according to instaction
I have installed docker and docker-compose

I have this problem:

a@s:~/progs/automata$ sudo ./scripts/run-network.sh
[sudo] hasło użytkownika adi: 
Running the network
Image: automata
Chain: local
Pulling validator-a (automata:)...
ERROR: The image for the service you're trying to recreate has been removed. If you continue, volume data could be lost. Consider backing up your data before continuing.

Continue with the new image? [yN]y
Pulling validator-a (automata:)...
ERROR: pull access denied for automata, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
a@s:~/progs/automata$ ./scripts/run-network.sh
Running the network
Image: automata
Chain: local
ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
a@s:~/progs/automata$ 

How I can make automata running?

Robustify Attestor

There is a corner case that could cause the chain having dirty data:

If an attestor get disconnected from chain, and not going to come back, the geode that it was attesting will remain in Registered state forever, and no one would be responsible for checking the liveness of that geode to ensure it's in proper status.

Thus here are some TODOs for eliminate this corner case:

  1. Attestor should maintain a way of informing the chain about its status periodically, if it failed to do so in a timeout, the chain should mark it as an offline attestor.
  2. As geode needs to be attested by a certain amount of attestors to get its state changed into attested(currently the amount is 1), while attestor could be offline at any moment, the geode needs a way to keep themselves aware of the situation on chain, and try to find new attestor as soon as possible to meet required number of attestors, otherwise it could be marked as degraded, or even worse: if no attestor is attesting it, will be marked as unknown.
  3. While it's true that geode can poll the chain to gets the information from chain, it would definitely be more ideal if the Geode can subscribe the Event emitted from the chain.

Error during building: `prost-build v0.7.0`, The PROTOC environment variable is not set

pi@pi4:~/automata $ cargo build --release
Compiling sct v0.6.0
Compiling webpki v0.21.4
Compiling wasm-timer v0.2.5
Compiling rw-stream-sink v0.2.1
Compiling soketto v0.4.2
Compiling yamux v0.8.1
Compiling libp2p-pnet v0.20.0
Compiling intervalier v0.4.0
Compiling futures-diagnose v1.0.1
Compiling exit-future v0.2.0
Compiling prost-build v0.7.0
error: failed to run custom build command for prost-build v0.7.0

Caused by:
process didn't exit successfully: /home/pi/automata/target/release/build/prost-build-0f2fe0256215a37a/build-script-build (exit code: 101)
--- stderr
thread 'main' panicked at 'Failed to find the protoc binary. The PROTOC environment variable is not set, there is no bundled protoc for this platform, and protoc is not in the PATH', /home/pi/.cargo/registry/src/github.com-1285ae84e5963aae/prost-build-0.7.0/build.rs:100:10
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed
pi@pi4:~/automata $

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.