Merge branch 'main' into prune_no_reward

This commit is contained in:
Peilun Li 2024-07-29 18:55:31 +08:00
commit 9e0beb6e05
38 changed files with 5662 additions and 217 deletions

48
.github/workflows/abi.yml vendored Normal file
View File

@ -0,0 +1,48 @@
name: abi-consistent-check
on:
push:
branches: [ "main"]
pull_request:
branches: [ "main" ]
jobs:
build-and-compare:
runs-on: ubuntu-latest
steps:
- name: Clone current repository
uses: actions/checkout@v3
- name: Get the Git revision from the current repository
id: get-rev
run: echo "rev=$(cat ./storage-contracts-abis/0g-storage-contracts-rev)" >> $GITHUB_OUTPUT
- name: Clone another repository
uses: actions/checkout@v3
with:
repository: '0glabs/0g-storage-contracts'
path: '0g-storage-contracts'
- name: Checkout specific revision
working-directory: ./0g-storage-contracts
run: |
git fetch --depth=1 origin ${{ steps.get-rev.outputs.rev }}
git checkout ${{ steps.get-rev.outputs.rev }}
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18.17'
cache: 'yarn'
cache-dependency-path: ./0g-storage-contracts
- name: Run yarn in the cloned repository
working-directory: ./0g-storage-contracts
run: |
yarn
yarn build
- name: Compare files
run: |
./scripts/check_abis.sh ./0g-storage-contracts/artifacts/

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "0g-storage-contracts"]
path = 0g-storage-contracts
url = https://github.com/0glabs/0g-storage-contracts.git

@ -1 +0,0 @@
Subproject commit 8f8f906224f966651de0b745738fb8aab4f492c4

View File

@ -3,16 +3,10 @@ use ethers::prelude::abigen;
// run `cargo doc -p contract-interface --open` to read struct definition
#[cfg(not(feature = "dev"))]
abigen!(
ZgsFlow,
"../../0g-storage-contracts/artifacts/contracts/dataFlow/Flow.sol/Flow.json"
);
abigen!(ZgsFlow, "../../storage-contracts-abis/Flow.json");
#[cfg(not(feature = "dev"))]
abigen!(
PoraMine,
"../../0g-storage-contracts/artifacts/contracts/miner/Mine.sol/PoraMine.json"
);
abigen!(PoraMine, "../../storage-contracts-abis/PoraMine.json");
#[cfg(not(feature = "dev"))]
abigen!(

View File

@ -9,6 +9,7 @@ mod loader;
mod metrics;
mod mine;
mod miner_id;
mod monitor;
pub mod pora;
mod recall_range;
mod sealer;

View File

@ -9,7 +9,6 @@ use tokio::time::{sleep, Duration, Instant};
use storage::config::ShardConfig;
use zgs_spec::{SECTORS_PER_LOAD, SECTORS_PER_MAX_MINING_RANGE, SECTORS_PER_PRICING};
use super::metrics;
use crate::recall_range::RecallRange;
use crate::{
pora::{AnswerWithoutProof, Miner},
@ -20,7 +19,7 @@ use crate::{
use std::sync::Arc;
pub struct PoraService {
mine_context_receiver: mpsc::UnboundedReceiver<MineContextMessage>,
mine_context_receiver: broadcast::Receiver<MineContextMessage>,
mine_answer_sender: mpsc::UnboundedSender<AnswerWithoutProof>,
msg_recv: broadcast::Receiver<MinerMessage>,
loader: Arc<dyn PoraLoader>,
@ -33,9 +32,29 @@ pub struct PoraService {
iter_batch: usize,
}
struct PoraPuzzle {
#[derive(Debug, Clone, PartialEq, Eq)]
pub(super) struct PoraPuzzle {
context: MineContext,
target_quality: U256,
max_shards: u64,
}
impl PoraPuzzle {
pub fn new(context: MineContext, target_quality: U256, max_shards: u64) -> Self {
Self {
context,
target_quality,
max_shards,
}
}
pub fn max_shards(&self) -> u64 {
self.max_shards
}
pub fn context_digest(&self) -> H256 {
H256(self.context.digest)
}
}
#[derive(Clone, Debug, Default)]
pub struct MineRangeConfig {
@ -89,7 +108,7 @@ impl PoraService {
pub fn spawn(
executor: TaskExecutor,
msg_recv: broadcast::Receiver<MinerMessage>,
mine_context_receiver: mpsc::UnboundedReceiver<MineContextMessage>,
mine_context_receiver: broadcast::Receiver<MineContextMessage>,
loader: Arc<dyn PoraLoader>,
config: &MinerConfig,
miner_id: H256,
@ -138,15 +157,19 @@ impl PoraService {
Ok(MinerMessage::SetStartPosition(pos)) => {
info!("Change start position to: {:?}", pos);
self.mine_range.start_position = pos;
self.report_reason_if_mine_stop("update mine range");
}
Ok(MinerMessage::SetEndPosition(pos)) => {
info!("Change end position to: {:?}", pos);
self.mine_range.end_position = pos;
self.report_reason_if_mine_stop("update mine range");
}
Ok(MinerMessage::SetShardConfig(shard_config)) => {
self.mine_range.shard_config = shard_config;
self.report_reason_if_mine_stop("update shard");
}
Err(broadcast::error::RecvError::Closed)=>{
Err(broadcast::error::RecvError::Closed) => {
warn!("Unexpected: Mine service config channel closed.");
channel_opened = false;
}
@ -157,21 +180,26 @@ impl PoraService {
}
maybe_msg = self.mine_context_receiver.recv() => {
if let Some(msg) = maybe_msg {
info!("Update mine service: {:?}", msg);
info!("Mine iterations statistics: {}", metrics::report());
self.puzzle = msg.map(|(context, target_quality)| PoraPuzzle {
context, target_quality
});
} else {
warn!("Mine context channel closed.");
match maybe_msg {
Ok(msg) => {
info!("Update mine service: {:?}", msg);
self.puzzle = msg;
self.report_reason_if_mine_stop("update mine context");
},
Err(broadcast::error::RecvError::Closed) => {
warn!("Mine context channel closed.");
},
Err(_) => {}
}
}
() = &mut diastole, if !diastole.is_elapsed() => {
}
_ = async {}, if mining_enabled && cpu_percent > 0 && self.as_miner().map_or(false, |miner| miner.range.mining_length > 0) && diastole.is_elapsed() => {
_ = async {}, if mining_enabled
&& cpu_percent > 0
&& self.as_miner().is_ok()
&& diastole.is_elapsed() => {
let nonce = H256(rand::thread_rng().gen());
let miner = self.as_miner().unwrap();
@ -194,13 +222,27 @@ impl PoraService {
}
#[inline]
fn as_miner(&self) -> Option<Miner> {
let puzzle = self.puzzle.as_ref()?;
fn as_miner(&self) -> Result<Miner, &'static str> {
let puzzle = self.puzzle.as_ref().ok_or("no mine context")?;
let range = self.mine_range.to_valid_range(&puzzle.context)?;
(range.mining_length > 0).then_some(())?;
let range = self
.mine_range
.to_valid_range(&puzzle.context)
.ok_or("no mine range")?;
Some(Miner {
if range.mining_length == 0 {
return Err("mine range is zero");
}
if puzzle.max_shards() < self.mine_range.shard_config.num_shard as u64 {
return Err("too many mine shards");
}
if self.mine_range.shard_config.num_shard as u64 > puzzle.context.flow_length.as_u64() {
return Err("Not enough flow length to shard");
}
Ok(Miner {
range,
miner_id: &self.miner_id,
mine_range_config: &self.mine_range,
@ -209,4 +251,10 @@ impl PoraService {
loader: &*self.loader,
})
}
fn report_reason_if_mine_stop(&self, event: &'static str) {
if let Err(reason) = self.as_miner() {
info!(reason, "Mine stopped on {}", event);
}
}
}

27
node/miner/src/monitor.rs Normal file
View File

@ -0,0 +1,27 @@
use std::time::Duration;
use task_executor::TaskExecutor;
use tokio::time::sleep;
use super::metrics;
pub struct Monitor {
period: Duration,
}
impl Monitor {
pub fn spawn(executor: TaskExecutor, period: Duration) {
let monitor = Monitor { period };
executor.spawn(
async move { Box::pin(monitor.start()).await },
"pora_master",
);
}
async fn start(&self) {
loop {
info!("Mine iterations statistics: {}", metrics::report());
let _ = sleep(self.period).await;
}
}
}

View File

@ -102,15 +102,16 @@ impl<'a> Miner<'a> {
}
let quality = self.pora(idx, &sealed_data, pad_seed);
let quality_scale = self.range.shard_mask.count_zeros();
if quality <= U256::MAX >> quality_scale
&& quality << quality_scale <= *self.target_quality
{
let difficulty_scale_x64 = self
.range
.difficulty_scale_x64(self.context.flow_length.as_u64());
if quality <= (self.target_quality / difficulty_scale_x64) << 64 {
debug!(
"Find a PoRA valid answer, quality: {}, target_quality {}, scale {}",
"Find a PoRA valid answer, quality: {}, target_quality {}, scale {:.3}",
U256::MAX / quality,
U256::MAX / self.target_quality,
quality_scale
difficulty_scale_x64.as_u128() as f64 / (u64::MAX as f64 + 1.0)
);
inc_counter(&HIT_COUNT);
// Undo mix data when find a valid solition

View File

@ -1,6 +1,6 @@
use ethereum_types::U256;
use tiny_keccak::{Hasher, Keccak};
use zgs_spec::SECTORS_PER_LOAD;
use zgs_spec::{SECTORS_PER_LOAD, SECTORS_PER_MAX_MINING_RANGE};
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
pub struct RecallRange {
@ -38,6 +38,16 @@ impl RecallRange {
Some(self.start_position + recall_offset * SECTORS_PER_LOAD as u64)
}
pub fn difficulty_scale_x64(&self, flow_length: u64) -> U256 {
let no_shard_mine_length = std::cmp::min(flow_length, SECTORS_PER_MAX_MINING_RANGE as u64);
let sharded_mine_length = std::cmp::min(
flow_length >> self.shard_mask.count_zeros(),
SECTORS_PER_MAX_MINING_RANGE as u64,
);
(U256::from(no_shard_mine_length) << 64) / sharded_mine_length
}
}
impl From<RecallRange> for contract_interface::RecallRange {

View File

@ -1,9 +1,11 @@
use crate::miner_id::check_and_request_miner_id;
use crate::monitor::Monitor;
use crate::sealer::Sealer;
use crate::submitter::Submitter;
use crate::{config::MinerConfig, mine::PoraService, watcher::MineContextWatcher};
use network::NetworkMessage;
use std::sync::Arc;
use std::time::Duration;
use storage::config::ShardConfig;
use storage_async::Store;
use tokio::sync::broadcast;
@ -48,7 +50,7 @@ impl MineService {
let mine_answer_receiver = PoraService::spawn(
executor.clone(),
msg_recv.resubscribe(),
mine_context_receiver,
mine_context_receiver.resubscribe(),
store.clone(),
&config,
miner_id,
@ -57,12 +59,15 @@ impl MineService {
Submitter::spawn(
executor.clone(),
mine_answer_receiver,
mine_context_receiver,
provider.clone(),
store.clone(),
&config,
);
Sealer::spawn(executor, provider, store, &config, miner_id);
Sealer::spawn(executor.clone(), provider, store, &config, miner_id);
Monitor::spawn(executor, Duration::from_secs(5));
debug!("Starting miner service");

View File

@ -6,19 +6,23 @@ use ethers::providers::PendingTransaction;
use hex::ToHex;
use shared_types::FlowRangeProof;
use std::sync::Arc;
use std::time::Duration;
use storage::H256;
use storage_async::Store;
use task_executor::TaskExecutor;
use tokio::sync::mpsc;
use tokio::sync::{broadcast, mpsc};
use crate::config::{MineServiceMiddleware, MinerConfig};
use crate::pora::AnswerWithoutProof;
use crate::watcher::MineContextMessage;
use zgs_spec::{BYTES_PER_SEAL, SECTORS_PER_SEAL};
const SUBMISSION_RETIES: usize = 3;
const SUBMISSION_RETIES: usize = 15;
pub struct Submitter {
mine_answer_receiver: mpsc::UnboundedReceiver<AnswerWithoutProof>,
mine_context_receiver: broadcast::Receiver<MineContextMessage>,
mine_contract: PoraMine<MineServiceMiddleware>,
flow_contract: ZgsFlow<MineServiceMiddleware>,
default_gas_limit: Option<U256>,
@ -29,6 +33,7 @@ impl Submitter {
pub fn spawn(
executor: TaskExecutor,
mine_answer_receiver: mpsc::UnboundedReceiver<AnswerWithoutProof>,
mine_context_receiver: broadcast::Receiver<MineContextMessage>,
provider: Arc<MineServiceMiddleware>,
store: Arc<Store>,
config: &MinerConfig,
@ -39,6 +44,7 @@ impl Submitter {
let submitter = Submitter {
mine_answer_receiver,
mine_context_receiver,
mine_contract,
flow_contract,
store,
@ -51,18 +57,39 @@ impl Submitter {
}
async fn start(mut self) {
let mut current_context_digest: Option<H256> = None;
loop {
match self.mine_answer_receiver.recv().await {
Some(answer) => {
if let Err(e) = self.submit_answer(answer).await {
warn!(e)
tokio::select! {
answer_msg = self.mine_answer_receiver.recv() => {
match answer_msg {
Some(answer) => {
if Some(answer.context_digest) != current_context_digest {
info!("Skip submission because of inconsistent context digest");
continue;
}
if let Err(e) = self.submit_answer(answer).await {
warn!(e);
}
}
None => {
warn!("Mine submitter stopped because mine answer channel is closed.");
return;
}
}
}
None => {
warn!("Mine submitter stopped because mine answer channel is closed.");
break;
context_msg = self.mine_context_receiver.recv() => {
match context_msg {
Ok(puzzle) => {
current_context_digest = puzzle.map(|p| p.context_digest());
}
Err(broadcast::error::RecvError::Closed) => {
warn!("Mine context channel closed.");
},
Err(_) => {}
}
}
};
}
}
}
@ -136,6 +163,7 @@ impl Submitter {
let receipt = pending_transaction
.retries(SUBMISSION_RETIES)
.interval(Duration::from_secs(2))
.await
.map_err(|e| format!("Fail to execute mine answer transaction: {:?}", e))?
.ok_or(format!(

View File

@ -19,9 +19,9 @@ use std::sync::Arc;
use std::time::Duration;
use std::{ops::DerefMut, str::FromStr};
use crate::{config::MineServiceMiddleware, MinerConfig, MinerMessage};
use crate::{config::MineServiceMiddleware, mine::PoraPuzzle, MinerConfig, MinerMessage};
pub type MineContextMessage = Option<(MineContext, U256)>;
pub type MineContextMessage = Option<PoraPuzzle>;
lazy_static! {
pub static ref EMPTY_HASH: H256 =
@ -33,7 +33,7 @@ pub struct MineContextWatcher {
flow_contract: ZgsFlow<MineServiceMiddleware>,
mine_contract: PoraMine<MineServiceMiddleware>,
mine_context_sender: mpsc::UnboundedSender<MineContextMessage>,
mine_context_sender: broadcast::Sender<MineContextMessage>,
last_report: MineContextMessage,
msg_recv: broadcast::Receiver<MinerMessage>,
@ -45,14 +45,14 @@ impl MineContextWatcher {
msg_recv: broadcast::Receiver<MinerMessage>,
provider: Arc<MineServiceMiddleware>,
config: &MinerConfig,
) -> mpsc::UnboundedReceiver<MineContextMessage> {
) -> broadcast::Receiver<MineContextMessage> {
let provider = provider;
let mine_contract = PoraMine::new(config.mine_address, provider.clone());
let flow_contract = ZgsFlow::new(config.flow_address, provider.clone());
let (mine_context_sender, mine_context_receiver) =
mpsc::unbounded_channel::<MineContextMessage>();
broadcast::channel::<MineContextMessage>(4096);
let watcher = MineContextWatcher {
provider,
flow_contract,
@ -108,12 +108,17 @@ impl MineContextWatcher {
let context_call = self.flow_contract.make_context_with_result();
let valid_call = self.mine_contract.can_submit();
let quality_call = self.mine_contract.pora_target();
let shards_call = self.mine_contract.max_shards();
let (context, can_submit, quality) =
try_join!(context_call.call(), valid_call.call(), quality_call.call())
.map_err(|e| format!("Failed to query mining context: {:?}", e))?;
let (context, can_submit, quality, max_shards) = try_join!(
context_call.call(),
valid_call.call(),
quality_call.call(),
shards_call.call()
)
.map_err(|e| format!("Failed to query mining context: {:?}", e))?;
let report = if can_submit && context.digest != EMPTY_HASH.0 {
Some((context, quality))
Some(PoraPuzzle::new(context, quality, max_shards))
} else {
None
};

View File

@ -40,5 +40,9 @@ pub trait Rpc {
async fn get_peers(&self) -> RpcResult<HashMap<String, PeerInfo>>;
#[method(name = "getFileLocation")]
async fn get_file_location(&self, tx_seq: u64) -> RpcResult<Option<Vec<LocationInfo>>>;
async fn get_file_location(
&self,
tx_seq: u64,
all_shards: bool,
) -> RpcResult<Option<Vec<LocationInfo>>>;
}

View File

@ -185,7 +185,13 @@ impl RpcServer for RpcServerImpl {
.collect())
}
async fn get_file_location(&self, tx_seq: u64) -> RpcResult<Option<Vec<LocationInfo>>> {
async fn get_file_location(
&self,
tx_seq: u64,
all_shards: bool,
) -> RpcResult<Option<Vec<LocationInfo>>> {
info!("admin_getFileLocation()");
let tx = match self.ctx.log_store.get_tx_by_seq_number(tx_seq).await? {
Some(tx) => tx,
None => {
@ -221,7 +227,9 @@ impl RpcServer for RpcServerImpl {
shard_config: shard_config.unwrap(),
})
.collect();
if all_shards_available(info.iter().map(|info| info.shard_config).collect()) {
if !all_shards || all_shards_available(info.iter().map(|info| info.shard_config).collect())
{
Ok(Some(info))
} else {
Ok(None)

View File

@ -126,7 +126,7 @@ impl Batcher {
Ok(Some(SyncResult::Failed))
}
// file sync timeout
// finding peers timeout
Some(SyncState::FindingPeers { origin, .. })
if origin.elapsed() > self.config.find_peer_timeout =>
{
@ -135,6 +135,15 @@ impl Batcher {
Ok(Some(SyncResult::Timeout))
}
// connecting peers timeout
Some(SyncState::ConnectingPeers { origin, .. })
if origin.elapsed() > self.config.find_peer_timeout =>
{
debug!(%tx_seq, "Terminate file sync due to connecting peers timeout");
self.terminate_file_sync(tx_seq, false).await;
Ok(Some(SyncResult::Timeout))
}
// others
_ => Ok(None),
}

View File

@ -40,6 +40,7 @@ pub enum SyncState {
},
FoundPeers,
ConnectingPeers {
origin: InstantWrapper,
since: InstantWrapper,
},
AwaitingOutgoingConnection {
@ -253,6 +254,7 @@ impl SerialSyncController {
info!(%self.tx_seq, %num_peers_dailed, "Connecting peers");
self.state = SyncState::ConnectingPeers {
origin: self.since,
since: Instant::now().into(),
};
}
@ -632,6 +634,7 @@ impl SerialSyncController {
SyncState::FoundPeers => {
if self.peers.all_shards_available(vec![Connecting, Connected]) {
self.state = SyncState::ConnectingPeers {
origin: self.since,
since: Instant::now().into(),
};
} else {

12
scripts/check_abis.sh Executable file
View File

@ -0,0 +1,12 @@
set -e
artifacts_path="$1"
check_abis() {
for contract_name in "$@"; do
diff $(./scripts/search_abi.sh "$artifacts_path" "$contract_name.json") "storage-contracts-abis/$contract_name.json"
done
}
check_abis DummyMarket DummyReward Flow PoraMine PoraMineTest FixedPrice ChunkLinearReward FixedPriceFlow

15
scripts/search_abi.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
directory="$1" # The directory to search in
filename="$2" # The filename to search for
# Find the file in the directory
found_files=$(find "$directory" -type f -name "$filename")
# Check if any files were found
if [ -z "$found_files" ]; then
echo "Error: No files named '$filename' found in directory '$directory'." >&2
exit 1
else
echo "$found_files"
fi

65
scripts/update_abis.sh Executable file
View File

@ -0,0 +1,65 @@
#!/bin/bash
set -e
default_path="../0g-storage-contracts"
path="${1:-$default_path}"
# Step 1: Check if the path is a valid Git directory with commits
if [ ! -d "$path/.git" ] || [ -z "$(git -C "$path" rev-parse HEAD 2> /dev/null)" ]; then
echo "Error: The specified path is not a valid Git repository with commits."
exit 1
fi
if [ ! -z "$(git -C "$path" status --porcelain)" ]; then
echo "Error: There are uncommitted changes in the contract repository."
exit 1
fi
# Step 2: Build the contracts
build_contracts() {
local target_path="$path"
local original_path=$(pwd) # Save the current directory
if cd "$target_path"; then
yarn
yarn build
cd "$original_path"
else
echo "Error: Failed to switch to directory $target_path."
exit 1
fi
}
build_contracts
# Step 3: Copy the file from a specified sub-path
copy_file() {
local source_path="$1"
local destination_path="$2"
# Check if the source file exists
if [ ! -f "$source_path" ]; then
echo "Error: The file $source_path does not exist."
exit 1
fi
# Copy the file to the destination
cp "$source_path" "$destination_path"
echo "File copied: $source_path -> $destination_path."
}
copy_abis() {
for contract_name in "$@"; do
copy_file $(./scripts/search_abi.sh "$path/artifacts" "$contract_name.json") "storage-contracts-abis/$contract_name.json"
done
}
copy_abis DummyMarket DummyReward Flow PoraMine PoraMineTest FixedPrice ChunkLinearReward FixedPriceFlow
# Step 4: Get the current Git revision and write it to a specified file
git_revision=$(git -C "$path" rev-parse HEAD)
revision_file="storage-contracts-abis/0g-storage-contracts-rev"
echo "$git_revision" > "$revision_file"
echo "Write git rev $git_revision to $revision_file."

View File

@ -0,0 +1 @@
dbeff538b949599c203e43be6ecc05e9e997d09d

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,34 @@
{
"_format": "hh-sol-artifact-1",
"contractName": "DummyMarket",
"sourceName": "contracts/test/DummyMarket.sol",
"abi": [
{
"inputs": [
{
"internalType": "uint256",
"name": "beforeLength",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "uploadSectors",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "paddingSectors",
"type": "uint256"
}
],
"name": "chargeFee",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"bytecode": "0x6080604052348015600f57600080fd5b5060a08061001e6000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063da6eb36a14602d575b600080fd5b603d6038366004603f565b505050565b005b600080600060608486031215605357600080fd5b50508135936020830135935060409092013591905056fea264697066735822122054eb84b374e7eb5c57b284f82f977fe19500436ef4128d3e147969cefdd4cbcd64736f6c63430008100033",
"deployedBytecode": "0x6080604052348015600f57600080fd5b506004361060285760003560e01c8063da6eb36a14602d575b600080fd5b603d6038366004603f565b505050565b005b600080600060608486031215605357600080fd5b50508135936020830135935060409092013591905056fea264697066735822122054eb84b374e7eb5c57b284f82f977fe19500436ef4128d3e147969cefdd4cbcd64736f6c63430008100033",
"linkReferences": {},
"deployedLinkReferences": {}
}

View File

@ -0,0 +1,77 @@
{
"_format": "hh-sol-artifact-1",
"contractName": "DummyReward",
"sourceName": "contracts/test/DummyReward.sol",
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint256",
"name": "pricingIndex",
"type": "uint256"
},
{
"indexed": true,
"internalType": "address",
"name": "beneficiary",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "DistributeReward",
"type": "event"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "pricingIndex",
"type": "uint256"
},
{
"internalType": "address payable",
"name": "beneficiary",
"type": "address"
},
{
"internalType": "bytes32",
"name": "minerId",
"type": "bytes32"
}
],
"name": "claimMineReward",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "beforeLength",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "uploadSectors",
"type": "uint256"
}
],
"name": "fillReward",
"outputs": [],
"stateMutability": "payable",
"type": "function"
}
],
"bytecode": "0x608060405234801561001057600080fd5b5060f18061001f6000396000f3fe60806040526004361060265760003560e01c806359e9670014602b578063b7a3c04c14603c575b600080fd5b603a60363660046058565b5050565b005b348015604757600080fd5b50603a60533660046079565b505050565b60008060408385031215606a57600080fd5b50508035926020909101359150565b600080600060608486031215608d57600080fd5b8335925060208401356001600160a01b038116811460aa57600080fd5b92959294505050604091909101359056fea264697066735822122031a993c3def9ed899c5b5a53bab495d498047e1a8ce262b61e700511cfb9adf164736f6c63430008100033",
"deployedBytecode": "0x60806040526004361060265760003560e01c806359e9670014602b578063b7a3c04c14603c575b600080fd5b603a60363660046058565b5050565b005b348015604757600080fd5b50603a60533660046079565b505050565b60008060408385031215606a57600080fd5b50508035926020909101359150565b600080600060608486031215608d57600080fd5b8335925060208401356001600160a01b038116811460aa57600080fd5b92959294505050604091909101359056fea264697066735822122031a993c3def9ed899c5b5a53bab495d498047e1a8ce262b61e700511cfb9adf164736f6c63430008100033",
"linkReferences": {},
"deployedLinkReferences": {}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,3 @@
This folder is maintained by the script `./scripts/update_abis.sh <0g-storage-contracts-path>`. Please do not modify it manually. The default value for `0g-storage-contracts-path` is `../0g-storage-contracts`.
When running the script, ensure that there are no uncommitted changes in the storage path and that `yarn` is already installed.

View File

@ -45,14 +45,14 @@ class MineTest(TestFramework):
self.log.info("Submission done, current epoch is %d", start_epoch)
self.log.info("Wait for the first mine context release")
wait_until(lambda: int(blockchain.eth_blockNumber(), 16) >= start_epoch + 1, timeout=180)
wait_until(lambda: self.contract.epoch() >= start_epoch + 1, timeout=180)
self.contract.update_context()
self.log.info("Wait for the first mine answer")
wait_until(lambda: self.mine_contract.last_mined_epoch() == start_epoch + 1 and not self.mine_contract.can_submit(), timeout=180)
self.log.info("Wait for the second mine context release")
wait_until(lambda: int(blockchain.eth_blockNumber(), 16) >= start_epoch + 2, timeout=180)
wait_until(lambda: self.contract.epoch() >= start_epoch + 2, timeout=180)
self.contract.update_context()
self.log.info("Wait for the second mine answer")
@ -60,7 +60,7 @@ class MineTest(TestFramework):
self.nodes[0].miner_stop()
self.log.info("Wait for the third mine context release")
wait_until(lambda: int(blockchain.eth_blockNumber(), 16) >= start_epoch + 3, timeout=180)
wait_until(lambda: self.contract.epoch() >= start_epoch + 3, timeout=180)
self.contract.update_context()
self.log.info("Submit the second data chunk")

View File

@ -50,6 +50,7 @@ class MineTest(TestFramework):
SECTORS_PER_PRICING = int(8 * ( 2 ** 30 ) / 256)
self.log.info("Submit the actual data chunk (256 MB)")
self.submit_data(b"\x11", int(SECTORS_PER_PRICING / 32))
@ -74,7 +75,7 @@ class MineTest(TestFramework):
firstReward = rewards[0].args.amount
self.log.info("Received reward %d Gwei", firstReward / (10**9))
self.reward_contract.transfer(10000 * 10 ** 18)
self.reward_contract.donate(10000 * 10 ** 18)
self.log.info("Donation Done")
self.log.info("Submit the data hash only (8 GB)")
self.submit_data(b"\x11", int(SECTORS_PER_PRICING), no_submit=True)

View File

@ -29,6 +29,9 @@ class SyncTest(TestFramework):
client1 = self.nodes[0]
client2 = self.nodes[1]
# stop client2, preventing it from receiving AnnounceFile
client2.shutdown()
# Create submission
chunk_data = random.randbytes(256 * 1024)
data_root = self.__create_submission(chunk_data)
@ -41,16 +44,22 @@ class SyncTest(TestFramework):
segments = submit_data(client1, chunk_data)
self.log.info("segments: %s", [(s["root"], s["index"], s["proof"]) for s in segments])
wait_until(lambda: client1.zgs_get_file_info(data_root)["finalized"])
# File should not be auto sync on node 2
# restart client2
client2.start()
client2.wait_for_rpc_connection()
# File should not be auto sync on node 2 and there is no cached file locations
wait_until(lambda: client2.zgs_get_file_info(data_root) is not None)
time.sleep(3)
assert_equal(client2.zgs_get_file_info(data_root)["finalized"], False)
assert(client2.admin_get_file_location(0) is None)
# Trigger file sync by rpc
assert(client2.admin_start_sync_file(0) is None)
wait_until(lambda: client2.sync_status_is_completed_or_unknown(0))
wait_until(lambda: client2.zgs_get_file_info(data_root)["finalized"])
assert(client2.admin_get_file_location(0) is not None)
# Validate data
assert_equal(

View File

@ -267,7 +267,7 @@ class BlockchainNode(TestNode):
def deploy_contract(name, args=None):
if args is None:
args = []
contract_interface = load_contract_metadata(base_path=self.contract_path, name=name)
contract_interface = load_contract_metadata(path=self.contract_path, name=name)
contract = w3.eth.contract(
abi=contract_interface["abi"],
bytecode=contract_interface["bytecode"],
@ -303,7 +303,7 @@ class BlockchainNode(TestNode):
mine_contract.functions.setTargetSubmissions(2).transact(TX_PARAMS)
self.log.debug("Mine Initialized")
flow_initialize_hash = (flow_contract.get_function_by_signature('initialize(address)'))(dummy_market_contract.address).transact(TX_PARAMS)
flow_initialize_hash = flow_contract.functions.initialize(dummy_market_contract.address).transact(TX_PARAMS)
self.log.debug("Flow Initialized")
self.wait_for_transaction_receipt(w3, flow_initialize_hash)
@ -340,9 +340,10 @@ class BlockchainNode(TestNode):
self.log.debug("Market Initialized")
reward_contract.functions.initialize(market_contract.address, mine_contract.address).transact(TX_PARAMS)
reward_contract.functions.setBaseReward(10 ** 18).transact(TX_PARAMS)
self.log.debug("Reward Initialized")
flow_initialize_hash = (flow_contract.get_function_by_signature('initialize(address)'))(market_contract.address).transact(TX_PARAMS)
flow_initialize_hash = flow_contract.functions.initialize(market_contract.address).transact(TX_PARAMS)
self.log.debug("Flow Initialized")
self.wait_for_transaction_receipt(w3, flow_initialize_hash)

View File

@ -28,6 +28,14 @@ class ContractProxy:
contract = self._get_contract(node_idx)
return getattr(contract.functions, fn_name)(**args).transact(copy(TX_PARAMS))
def _send_payable(self, fn_name, node_idx, value, **args):
assert node_idx < len(self.blockchain_nodes)
contract = self._get_contract(node_idx)
tx_params = copy(TX_PARAMS)
tx_params["value"] = value
return getattr(contract.functions, fn_name)(**args).transact(tx_params)
def _logs(self, event_name, node_idx, **args):
assert node_idx < len(self.blockchain_nodes)
@ -66,7 +74,6 @@ class FlowContractProxy(ContractProxy):
contract.w3, tx_hash, parent_hash=parent_hash
)
if receipt["status"] != 1:
print(receipt)
assert_equal(receipt["status"], 1)
return tx_hash
@ -98,6 +105,12 @@ class MineContractProxy(ContractProxy):
class IRewardContractProxy(ContractProxy):
class RewardContractProxy(ContractProxy):
def reward_distributes(self, node_idx=0):
return self._logs("DistributeReward", node_idx)
return self._logs("DistributeReward", node_idx)
def donate(self, value, node_idx = 0):
return self._send_payable("donate", node_idx, value)
def base_reward(self, node_idx = 0):
return self._call("baseReward", node_idx)

View File

@ -1,11 +1,10 @@
from os.path import join
from pathlib import Path
import json
from web3 import Web3
def load_contract_metadata(base_path: str, name: str):
path = Path(join(base_path, "artifacts"))
def load_contract_metadata(path: str, name: str):
path = Path(path)
try:
found_file = next(path.rglob(f"{name}.json"))
return json.loads(open(found_file, "r").read())

View File

@ -15,7 +15,7 @@ from pathlib import Path
from eth_utils import encode_hex
from test_framework.bsc_node import BSCNode
from test_framework.contract_proxy import FlowContractProxy, MineContractProxy, IRewardContractProxy
from test_framework.contract_proxy import FlowContractProxy, MineContractProxy, RewardContractProxy
from test_framework.zgs_node import ZgsNode
from test_framework.blockchain_node import BlockChainNodeType
from test_framework.conflux_node import ConfluxNode, connect_sample_nodes
@ -175,7 +175,7 @@ class TestFramework:
contract, tx_hash, mine_contract, reward_contract = self.blockchain_nodes[0].setup_contract(self.enable_market, self.mine_period, self.lifetime_seconds)
self.contract = FlowContractProxy(contract, self.blockchain_nodes)
self.mine_contract = MineContractProxy(mine_contract, self.blockchain_nodes)
self.reward_contract = IRewardContractProxy(reward_contract, self.blockchain_nodes)
self.reward_contract = RewardContractProxy(reward_contract, self.blockchain_nodes)
for node in self.blockchain_nodes[1:]:
@ -258,7 +258,7 @@ class TestFramework:
dest="contract",
default=os.path.join(
__file_path__,
"../../0g-storage-contracts/",
"../../storage-contracts-abis/",
),
type=str,
)

View File

@ -115,6 +115,9 @@ class ZgsNode(TestNode):
def sync_status_is_completed_or_unknown(self, tx_seq):
status = self.rpc.admin_getSyncStatus([tx_seq])
return status == "Completed" or status == "unknown"
def admin_get_file_location(self, tx_seq, all_shards = True):
return self.rpc.admin_getFileLocation([tx_seq, all_shards])
def clean_data(self):
shutil.rmtree(os.path.join(self.data_dir, "db"))

View File

@ -108,37 +108,36 @@ version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
[[package]]
name = "base16ct"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce"
[[package]]
name = "base64"
version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd"
[[package]]
name = "base64ct"
version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b"
[[package]]
name = "bitflags"
version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bitvec"
version = "0.20.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7774144344a4faa177370406a7ff5f1da24303817368584c6206c8303eb07848"
dependencies = [
"funty",
"radium",
"tap",
"wyz",
]
[[package]]
name = "block-buffer"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4"
dependencies = [
"block-padding",
"generic-array",
]
@ -151,12 +150,6 @@ dependencies = [
"generic-array",
]
[[package]]
name = "block-padding"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae"
[[package]]
name = "bs58"
version = "0.4.0"
@ -215,9 +208,9 @@ dependencies = [
[[package]]
name = "const-oid"
version = "0.5.2"
version = "0.9.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "279bc8fc53f788a75c7804af68237d1fce02cde1e275a886a4b320604dc2aeda"
checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8"
[[package]]
name = "cpufeatures"
@ -235,12 +228,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7"
[[package]]
name = "crypto-common"
version = "0.1.1"
name = "crypto-bigint"
version = "0.4.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "683d6b536309245c849479fba3da410962a43ed8e51c26b729208ec0ac2798d0"
checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef"
dependencies = [
"generic-array",
"rand_core 0.6.3",
"subtle",
"zeroize",
]
[[package]]
name = "crypto-common"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3"
dependencies = [
"generic-array",
"typenum",
]
[[package]]
@ -253,16 +259,6 @@ dependencies = [
"subtle",
]
[[package]]
name = "crypto-mac"
version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714"
dependencies = [
"generic-array",
"subtle",
]
[[package]]
name = "ctr"
version = "0.8.0"
@ -293,12 +289,12 @@ checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57"
[[package]]
name = "der"
version = "0.3.5"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2eeb9d92785d1facb50567852ce75d0858630630e7eabea59cf7eb7474051087"
checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de"
dependencies = [
"const-oid",
"typenum",
"zeroize",
]
[[package]]
@ -312,13 +308,13 @@ dependencies = [
[[package]]
name = "digest"
version = "0.10.1"
version = "0.10.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b697d66081d42af4fba142d56918a3cb21dc8eb63372c6b85d14f44fb9c5979b"
checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
dependencies = [
"block-buffer 0.10.0",
"crypto-common",
"generic-array",
"subtle",
]
[[package]]
@ -328,7 +324,7 @@ dependencies = [
"aes",
"aes-gcm",
"arrayvec",
"digest 0.10.1",
"digest 0.10.7",
"enr",
"env_logger 0.9.0",
"fnv",
@ -347,7 +343,7 @@ dependencies = [
"rand_core 0.6.3",
"rand_xorshift",
"rlp",
"sha2",
"sha2 0.10.8",
"simple_logger",
"smallvec",
"tokio",
@ -361,13 +357,13 @@ dependencies = [
[[package]]
name = "ecdsa"
version = "0.11.1"
version = "0.14.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34d33b390ab82f2e1481e331dbd0530895640179d2128ef9a79cc690b78d1eba"
checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c"
dependencies = [
"der",
"elliptic-curve",
"hmac 0.11.0",
"rfc6979",
"signature",
]
@ -390,7 +386,7 @@ dependencies = [
"ed25519",
"rand 0.7.3",
"serde",
"sha2",
"sha2 0.9.8",
"zeroize",
]
@ -402,25 +398,29 @@ checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
[[package]]
name = "elliptic-curve"
version = "0.9.12"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c13e9b0c3c4170dcc2a12783746c4205d98e18957f57854251eea3f9750fe005"
checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3"
dependencies = [
"bitvec",
"base16ct",
"crypto-bigint",
"der",
"digest 0.10.7",
"ff",
"generic-array",
"group",
"pkcs8",
"rand_core 0.6.3",
"sec1",
"subtle",
"zeroize",
]
[[package]]
name = "enr"
version = "0.5.1"
version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "809869a1328bfb586b48c9c0f87761c47c41793a85bcb06f66074a87cafc1bcd"
checksum = "26fa0a0be8915790626d5759eb51fe47435a8eac92c2f212bd2da9aa7f30ea56"
dependencies = [
"base64",
"bs58",
@ -461,11 +461,10 @@ dependencies = [
[[package]]
name = "ff"
version = "0.9.0"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72a4d941a5b7c2a75222e2d44fcdf634a67133d9db31e177ae5ff6ecda852bfe"
checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160"
dependencies = [
"bitvec",
"rand_core 0.6.3",
"subtle",
]
@ -492,12 +491,6 @@ dependencies = [
"percent-encoding",
]
[[package]]
name = "funty"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7"
[[package]]
name = "futures"
version = "0.3.19"
@ -555,7 +548,7 @@ checksum = "6dbd947adfffb0efc70599b3ddcf7b5597bb5fa9e245eb99f62b3a5f7bb8bd3c"
dependencies = [
"proc-macro2",
"quote",
"syn",
"syn 1.0.80",
]
[[package]]
@ -638,9 +631,9 @@ dependencies = [
[[package]]
name = "group"
version = "0.9.0"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "61b3c1e8b4f1ca07e6605ea1be903a5f6956aec5c8a67fd44d56076631675ed8"
checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7"
dependencies = [
"ff",
"rand_core 0.6.3",
@ -697,12 +690,11 @@ checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0"
[[package]]
name = "hkdf"
version = "0.11.0"
version = "0.12.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "01706d578d5c281058480e673ae4086a9f4710d8df1ad80a5b03e39ece5f886b"
checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7"
dependencies = [
"digest 0.9.0",
"hmac 0.11.0",
"hmac 0.12.1",
]
[[package]]
@ -711,18 +703,17 @@ version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840"
dependencies = [
"crypto-mac 0.8.0",
"crypto-mac",
"digest 0.9.0",
]
[[package]]
name = "hmac"
version = "0.11.0"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b"
checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e"
dependencies = [
"crypto-mac 0.11.1",
"digest 0.9.0",
"digest 0.10.7",
]
[[package]]
@ -798,21 +789,24 @@ dependencies = [
[[package]]
name = "k256"
version = "0.8.1"
version = "0.11.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8c3e8e491ed22bc161583a1c77e42313672c483eba6bd9d7afec0f1131d0b9ce"
checksum = "72c1e0b51e7ec0a97369623508396067a486bd0cbed95a2659a4b863d28cfc8b"
dependencies = [
"cfg-if",
"ecdsa",
"elliptic-curve",
"sha2",
"sha2 0.10.8",
]
[[package]]
name = "keccak"
version = "0.1.0"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7"
checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654"
dependencies = [
"cpufeatures",
]
[[package]]
name = "lazy_static"
@ -852,7 +846,7 @@ dependencies = [
"rand 0.8.4",
"ring",
"rw-stream-sink",
"sha2",
"sha2 0.9.8",
"smallvec",
"thiserror",
"unsigned-varint",
@ -875,7 +869,7 @@ dependencies = [
"libsecp256k1-gen-genmult",
"rand 0.8.4",
"serde",
"sha2",
"sha2 0.9.8",
"typenum",
]
@ -1005,7 +999,7 @@ dependencies = [
"digest 0.9.0",
"generic-array",
"multihash-derive",
"sha2",
"sha2 0.9.8",
"unsigned-varint",
]
@ -1019,7 +1013,7 @@ dependencies = [
"proc-macro-error",
"proc-macro2",
"quote",
"syn",
"syn 1.0.80",
"synstructure",
]
@ -1141,7 +1135,7 @@ checksum = "3be26700300be6d9d23264c73211d8190e755b6b5ca7a1b28230025511b52a5e"
dependencies = [
"proc-macro2",
"quote",
"syn",
"syn 1.0.80",
]
[[package]]
@ -1152,7 +1146,7 @@ checksum = "6e8fe8163d14ce7f0cdac2e040116f22eac817edabff0be91e8aff7e9accf389"
dependencies = [
"proc-macro2",
"quote",
"syn",
"syn 1.0.80",
]
[[package]]
@ -1169,9 +1163,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
[[package]]
name = "pkcs8"
version = "0.6.1"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c9c2f795bc591cb3384cb64082a578b89207ac92bb89c9d98c1ea2ace7cd8110"
checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba"
dependencies = [
"der",
"spki",
@ -1214,7 +1208,7 @@ dependencies = [
"proc-macro-error-attr",
"proc-macro2",
"quote",
"syn",
"syn 1.0.80",
"version_check",
]
@ -1231,11 +1225,11 @@ dependencies = [
[[package]]
name = "proc-macro2"
version = "1.0.30"
version = "1.0.86"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edc3358ebc67bc8b7fa0c007f945b0b18226f78437d61bec735a9eb96b61ee70"
checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77"
dependencies = [
"unicode-xid",
"unicode-ident",
]
[[package]]
@ -1278,7 +1272,7 @@ dependencies = [
"itertools",
"proc-macro2",
"quote",
"syn",
"syn 1.0.80",
]
[[package]]
@ -1305,19 +1299,13 @@ dependencies = [
[[package]]
name = "quote"
version = "1.0.10"
version = "1.0.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05"
checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
dependencies = [
"proc-macro2",
]
[[package]]
name = "radium"
version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "643f8f41a8ebc4c5dc4515c82bb8abd397b527fc20fd681b7c011c2aee5d44fb"
[[package]]
name = "rand"
version = "0.7.3"
@ -1452,6 +1440,17 @@ dependencies = [
"winapi",
]
[[package]]
name = "rfc6979"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb"
dependencies = [
"crypto-bigint",
"hmac 0.12.1",
"zeroize",
]
[[package]]
name = "ring"
version = "0.16.20"
@ -1500,6 +1499,20 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
[[package]]
name = "sec1"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928"
dependencies = [
"base16ct",
"der",
"generic-array",
"pkcs8",
"subtle",
"zeroize",
]
[[package]]
name = "serde"
version = "1.0.130"
@ -1517,7 +1530,7 @@ checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b"
dependencies = [
"proc-macro2",
"quote",
"syn",
"syn 1.0.80",
]
[[package]]
@ -1534,15 +1547,24 @@ dependencies = [
]
[[package]]
name = "sha3"
version = "0.9.1"
name = "sha2"
version = "0.10.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809"
checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8"
dependencies = [
"block-buffer 0.9.0",
"digest 0.9.0",
"cfg-if",
"cpufeatures",
"digest 0.10.7",
]
[[package]]
name = "sha3"
version = "0.10.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60"
dependencies = [
"digest 0.10.7",
"keccak",
"opaque-debug",
]
[[package]]
@ -1565,11 +1587,11 @@ dependencies = [
[[package]]
name = "signature"
version = "1.3.1"
version = "1.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c19772be3c4dd2ceaacf03cb41d5885f2a02c4d8804884918e3a258480803335"
checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c"
dependencies = [
"digest 0.9.0",
"digest 0.10.7",
"rand_core 0.6.3",
]
@ -1606,10 +1628,11 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d"
[[package]]
name = "spki"
version = "0.3.0"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9dae7e047abc519c96350e9484a96c6bf1492348af912fd3446dd2dc323f6268"
checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b"
dependencies = [
"base64ct",
"der",
]
@ -1636,6 +1659,17 @@ dependencies = [
"unicode-xid",
]
[[package]]
name = "syn"
version = "2.0.72"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "synstructure"
version = "0.12.6"
@ -1644,16 +1678,10 @@ checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f"
dependencies = [
"proc-macro2",
"quote",
"syn",
"syn 1.0.80",
"unicode-xid",
]
[[package]]
name = "tap"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369"
[[package]]
name = "tempfile"
version = "3.2.0"
@ -1694,15 +1722,16 @@ checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b"
dependencies = [
"proc-macro2",
"quote",
"syn",
"syn 1.0.80",
]
[[package]]
name = "thread_local"
version = "1.1.3"
version = "1.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8018d24e04c95ac8790716a5987d0fec4f8b27249ffa0f7d33f1369bdfb88cbd"
checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c"
dependencies = [
"cfg-if",
"once_cell",
]
@ -1765,7 +1794,7 @@ checksum = "b557f72f448c511a979e2564e55d74e6c4432fc96ff4f6241bc6bded342643b7"
dependencies = [
"proc-macro2",
"quote",
"syn",
"syn 1.0.80",
]
[[package]]
@ -1824,7 +1853,7 @@ checksum = "f4f480b8f81512e825f337ad51e94c1eb5d3bbdf2b363dcd01e2b19a9ffe3f8e"
dependencies = [
"proc-macro2",
"quote",
"syn",
"syn 1.0.80",
]
[[package]]
@ -1889,6 +1918,12 @@ version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f"
[[package]]
name = "unicode-ident"
version = "1.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
[[package]]
name = "unicode-normalization"
version = "0.1.19"
@ -1989,7 +2024,7 @@ dependencies = [
"log",
"proc-macro2",
"quote",
"syn",
"syn 1.0.80",
"wasm-bindgen-shared",
]
@ -2011,7 +2046,7 @@ checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab"
dependencies = [
"proc-macro2",
"quote",
"syn",
"syn 1.0.80",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
@ -2074,29 +2109,22 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "wyz"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214"
[[package]]
name = "zeroize"
version = "1.4.3"
version = "1.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d68d9dcec5f9b43a30d38c49f91dfedfaac384cb8f085faca366c26207dd1619"
checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde"
dependencies = [
"zeroize_derive",
]
[[package]]
name = "zeroize_derive"
version = "1.2.0"
version = "1.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bdff2024a851a322b08f179173ae2ba620445aef1e838f0c196820eade4ae0c7"
checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69"
dependencies = [
"proc-macro2",
"quote",
"syn",
"synstructure",
"syn 2.0.72",
]