Skip to content

Commit

Permalink
Fix some more issues
Browse files Browse the repository at this point in the history
  • Loading branch information
bart-linera committed Feb 21, 2025
1 parent a910f3f commit 51a40bd
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 93 deletions.
60 changes: 19 additions & 41 deletions CLI.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ This document contains the help content for the `linera` command-line program.
* [`linera read-data-blob`](#linera-read-data-blob)
* [`linera create-application`](#linera-create-application)
* [`linera publish-and-create`](#linera-publish-and-create)
* [`linera request-application`](#linera-request-application)
* [`linera keygen`](#linera-keygen)
* [`linera assign`](#linera-assign)
* [`linera retry-pending-block`](#linera-retry-pending-block)
Expand All @@ -57,7 +56,7 @@ This document contains the help content for the `linera` command-line program.
* [`linera storage initialize`](#linera-storage-initialize)
* [`linera storage list_namespaces`](#linera-storage-list_namespaces)
* [`linera storage list_blob_ids`](#linera-storage-list_blob_ids)
* [`linera storage list_chain_ids`](#linera-storage-list_chain_ids)
* [`linera storage list_root_keys`](#linera-storage-list_root_keys)

## `linera`

Expand Down Expand Up @@ -94,8 +93,7 @@ A Byzantine-fault tolerant sidechain with low-latency finality and high throughp
* `read-data-blob` — Verify that a data blob is readable
* `create-application` — Create an application
* `publish-and-create` — Create an application, and publish the required bytecode
* `request-application` — Request an application from another chain, so it can be used on this one
* `keygen` — Create an unassigned key pair
* `keygen` — Create an unassigned key-pair
* `assign` — Link an owner with a key pair in the wallet to a chain that was created for that owner
* `retry-pending-block` — Retry a block we unsuccessfully tried to propose earlier
* `wallet` — Show the contents of the wallet
Expand Down Expand Up @@ -368,7 +366,7 @@ Show the version and genesis config hash of a new validator, and print a warning

###### **Options:**

* `--public-key <PUBLIC_KEY>` — The public key of the validator. If given, the signature of the chain query info will be checked
* `--name <NAME>` — The public key of the validator. If given, the signature of the chain query info will be checked



Expand Down Expand Up @@ -404,11 +402,11 @@ Synchronizes a validator with the local state of chains

Add or modify a validator (admin only)

**Usage:** `linera set-validator [OPTIONS] --public-key <PUBLIC_KEY> --address <ADDRESS>`
**Usage:** `linera set-validator [OPTIONS] --name <NAME> --address <ADDRESS>`

###### **Options:**

* `--public-key <PUBLIC_KEY>` — The public key of the validator
* `--name <NAME>` — The public key of the validator
* `--address <ADDRESS>` — Network address
* `--votes <VOTES>` — Voting power

Expand All @@ -421,11 +419,11 @@ Add or modify a validator (admin only)

Remove a validator (admin only)

**Usage:** `linera remove-validator --public-key <PUBLIC_KEY>`
**Usage:** `linera remove-validator --name <NAME>`

###### **Options:**

* `--public-key <PUBLIC_KEY>` — The public key of the validator
* `--name <NAME>` — The public key of the validator



Expand Down Expand Up @@ -681,26 +679,9 @@ Create an application, and publish the required bytecode



## `linera request-application`

Request an application from another chain, so it can be used on this one

**Usage:** `linera request-application [OPTIONS] <APPLICATION_ID>`

###### **Arguments:**

* `<APPLICATION_ID>` — The ID of the application to request

###### **Options:**

* `--target-chain-id <TARGET_CHAIN_ID>` — The target chain on which the application is already registered. If not specified, the chain on which the application was created is used
* `--requester-chain-id <REQUESTER_CHAIN_ID>` — The owned chain on which the application is missing



## `linera keygen`

Create an unassigned key pair
Create an unassigned key-pair

**Usage:** `linera keygen`

Expand Down Expand Up @@ -932,10 +913,7 @@ Start a Local Linera Network
* `--external-protocol <EXTERNAL_PROTOCOL>` — External protocol used, either `grpc` or `grpcs`

Default value: `grpc`
* `--with-faucet` — If present, a faucet is started using the chain provided by --faucet-chain, or `ChainId::root(1)` if not provided, as root 0 is usually the admin chain

Default value: `false`
* `--faucet-chain <FAUCET_CHAIN>` — When using --with-faucet, this specifies the chain on which the faucet will be started. The chain is specified by its root number (0 for the admin chain, 1 for the first non-admin initial chain, etc)
* `--with-faucet-chain <WITH_FAUCET_CHAIN>` — If present, a faucet is started using the given chain root number (0 for the admin chain, 1 for the first non-admin initial chain, etc)
* `--faucet-port <FAUCET_PORT>` — The port on which to run the faucet server

Default value: `8080`
Expand All @@ -961,20 +939,20 @@ Operation on the storage

###### **Subcommands:**

* `delete_all` — Delete all the namespaces in the database
* `delete_all` — Delete all the namespaces of the database
* `delete_namespace` — Delete a single namespace from the database
* `check_existence` — Check existence of a namespace in the database
* `check_absence` — Check absence of a namespace in the database
* `initialize` — Initialize a namespace in the database
* `list_namespaces` — List the namespaces in the database
* `list_blob_ids` — List the blob IDs in the database
* `list_chain_ids` — List the chain IDs in the database
* `list_namespaces` — List the namespaces of the database
* `list_blob_ids` — List the blobs of the database
* `list_root_keys` — List the root keys of the database



## `linera storage delete_all`

Delete all the namespaces in the database
Delete all the namespaces of the database

**Usage:** `linera storage delete_all --storage <STORAGE_CONFIG>`

Expand Down Expand Up @@ -1034,7 +1012,7 @@ Initialize a namespace in the database

## `linera storage list_namespaces`

List the namespaces in the database
List the namespaces of the database

**Usage:** `linera storage list_namespaces --storage <STORAGE_CONFIG>`

Expand All @@ -1046,7 +1024,7 @@ List the namespaces in the database

## `linera storage list_blob_ids`

List the blob IDs in the database
List the blobs of the database

**Usage:** `linera storage list_blob_ids --storage <STORAGE_CONFIG>`

Expand All @@ -1056,11 +1034,11 @@ List the blob IDs in the database



## `linera storage list_chain_ids`
## `linera storage list_root_keys`

List the chain IDs in the database
List the root keys of the database

**Usage:** `linera storage list_chain_ids --storage <STORAGE_CONFIG>`
**Usage:** `linera storage list_root_keys --storage <STORAGE_CONFIG>`

###### **Options:**

Expand Down
2 changes: 0 additions & 2 deletions examples/fungible/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ pub async fn create_with_accounts(
.await;

for (chain, account, initial_amount) in &accounts {
chain.register_application(application_id).await;

let claim_certificate = chain
.add_block(|block| {
block.with_operation(
Expand Down
43 changes: 0 additions & 43 deletions linera-client/src/client_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -942,49 +942,6 @@ where
.expect("should execute block with Transfer operations");
}
self.update_wallet_from_client(&chain_client).await?;
// Make sure all chains have registered the application now.
let mut join_set = task::JoinSet::new();
for (chain_id, chain_client) in chain_clients.iter() {
let chain_id = *chain_id;
let chain_client = chain_client.clone();
join_set.spawn(async move {
let mut delay_ms = 0;
let mut total_delay_ms = 0;
loop {
linera_base::time::timer::sleep(Duration::from_millis(delay_ms)).await;
chain_client.process_inbox().await?;
let chain_state = chain_client.chain_state_view().await?;
if chain_state
.execution_state
.system
.registry
.known_applications
.contains_key(&application_id)
.await?
{
return Ok::<_, Error>(());
}

total_delay_ms += delay_ms;
// If we've been waiting already for more than 10 seconds, give up.
if total_delay_ms > 10_000 {
break;
}

if delay_ms == 0 {
delay_ms = 100;
} else {
delay_ms *= 2;
}
}
panic!("Could not instantiate application on chain {chain_id:?}");
});
}
join_set
.join_all()
.await
.into_iter()
.collect::<Result<Vec<_>, _>>()?;

Ok(())
}
Expand Down
3 changes: 2 additions & 1 deletion linera-execution/src/execution_state_actor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@

//! Handle requests from the synchronous execution thread of user applications.
use std::collections::BTreeMap;
#[cfg(with_metrics)]
use std::{collections::BTreeMap, sync::LazyLock};
use std::sync::LazyLock;

use custom_debug_derive::Debug;
use futures::channel::mpsc;
Expand Down
8 changes: 2 additions & 6 deletions linera-execution/tests/revm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,7 @@ contract ExampleCounter {
.into_view_with(ChainId::root(0), ExecutionRuntimeConfig::default())
.await;
let (app_desc, contract_blob, service_blob) = create_dummy_user_application_description(1);
let app_id = view
.system
.registry
.register_application(app_desc.clone())
.await?;
let app_id = From::from(&app_desc);

let contract = EvmContractModule::Revm {
module: module.clone(),
Expand Down Expand Up @@ -210,7 +206,7 @@ contract ExampleCounter {
};

for increment in &increments {
let mut txn_tracker = TransactionTracker::new(0, Some(Vec::new()));
let mut txn_tracker = TransactionTracker::new(0, 0, Some(Vec::new()));
value += increment;
let operation = incrementCall { input: *increment };
let bytes = operation.abi_encode();
Expand Down

0 comments on commit 51a40bd

Please sign in to comment.