Merge branch 'rust_edition' into grim

# Conflicts:
#	.github/workflows/publish-ghcr.yaml.yml
#	p2p/Cargo.toml
#	p2p/src/msg.rs
#	p2p/tests/peer_handshake.rs
This commit is contained in:
ardocrat
2026-05-14 22:52:52 +03:00
27 changed files with 71 additions and 84 deletions
+11 -3
View File
@@ -2,7 +2,7 @@ name: Build and Push to GHCR
on:
push:
branches: [grim]
branches: [master, staging]
env:
GHCR_IMAGE: ghcr.io/${{ secrets.GHCR_USERNAME }}/${{ github.event.repository.name }}
@@ -97,7 +97,15 @@ jobs:
- name: Generate image tag
id: vars
run: echo "tag=$(awk -F'"' '/^version/{ print $2; exit; }' Cargo.toml)" >> $GITHUB_OUTPUT
run: |
version=$(awk -F'"' '/^version/{ print $2; exit; }' Cargo.toml)
if ${{ github.ref_name == 'master' }}; then
echo "version=$version" >> $GITHUB_OUTPUT
echo "tag=latest" >> $GITHUB_OUTPUT
else
echo "version=${version}-staging" >> $GITHUB_OUTPUT
echo "tag=staging" >> $GITHUB_OUTPUT
fi
- name: Docker meta
id: meta
@@ -105,8 +113,8 @@ jobs:
with:
images: ${{ env.GHCR_IMAGE }}
tags: |
type=raw,value=${{ steps.vars.outputs.version }},enable=true
type=raw,value=${{ steps.vars.outputs.tag }},enable=true
type=raw,value=latest,enable=true
- name: Create manifest list and push
working-directory: ${{ runner.temp }}/digests
+1 -1
View File
@@ -9,7 +9,7 @@ keywords = [ "crypto", "grin", "mimblewimble" ]
readme = "README.md"
exclude = ["**/*.grin", "**/*.grin2"]
build = "src/build/build.rs"
edition = "2018"
edition = "2021"
[workspace]
members = ["api", "chain", "config", "core", "keychain", "p2p", "servers", "store", "util", "pool"]
+1 -1
View File
@@ -7,7 +7,7 @@ license = "Apache-2.0"
repository = "https://github.com/mimblewimble/grin"
keywords = [ "crypto", "grin", "mimblewimble" ]
workspace = ".."
edition = "2018"
edition = "2021"
[dependencies]
easy-jsonrpc-mw = "0.5.4"
+1 -1
View File
@@ -7,7 +7,7 @@ license = "Apache-2.0"
repository = "https://github.com/mimblewimble/grin"
keywords = [ "crypto", "grin", "mimblewimble" ]
workspace = ".."
edition = "2018"
edition = "2021"
[dependencies]
bit-vec = "0.6"
+1 -1
View File
@@ -7,7 +7,7 @@ license = "Apache-2.0"
repository = "https://github.com/mimblewimble/grin"
keywords = [ "crypto", "grin", "mimblewimble" ]
workspace = ".."
edition = "2018"
edition = "2021"
[dependencies]
rand = "0.6"
+1 -1
View File
@@ -7,7 +7,7 @@ license = "Apache-2.0"
repository = "https://github.com/mimblewimble/grin"
keywords = [ "crypto", "grin", "mimblewimble" ]
workspace = ".."
edition = "2018"
edition = "2021"
[dependencies]
blake2 = { package = "blake2-rfc", version = "0.2"}
+1 -1
View File
@@ -3,7 +3,7 @@ name = "grin_core-fuzz"
version = "0.0.3"
authors = ["Grin Developers <mimblewimble@lists.launchpad.net>"]
publish = false
edition = "2018"
edition = "2021"
[dependencies]
libfuzzer-sys = "0.4.0"
+9 -28
View File
@@ -244,7 +244,6 @@ fn transaction_cut_through() {
let tx1 = tx1i2o();
let tx2 = tx2i1o();
assert!(tx1.validate(Weighting::AsTransaction).is_ok());
assert!(tx2.validate(Weighting::AsTransaction).is_ok());
@@ -277,17 +276,12 @@ fn multi_kernel_transaction_deaggregation() {
assert!(tx34.validate(Weighting::AsTransaction).is_ok());
let deaggregated_tx34 = deaggregate(tx1234.clone(), &[tx12.clone()]).unwrap();
assert!(deaggregated_tx34
.validate(Weighting::AsTransaction)
.is_ok());
assert!(deaggregated_tx34.validate(Weighting::AsTransaction).is_ok());
assert_eq!(tx34, deaggregated_tx34);
let deaggregated_tx12 = deaggregate(tx1234, &[tx34]).unwrap();
assert!(deaggregated_tx12
.validate(Weighting::AsTransaction)
.is_ok());
assert!(deaggregated_tx12.validate(Weighting::AsTransaction).is_ok());
assert_eq!(tx12, deaggregated_tx12);
}
@@ -309,9 +303,7 @@ fn multi_kernel_transaction_deaggregation_2() {
assert!(tx12.validate(Weighting::AsTransaction).is_ok());
let deaggregated_tx3 = deaggregate(tx123, &[tx12]).unwrap();
assert!(deaggregated_tx3
.validate(Weighting::AsTransaction)
.is_ok());
assert!(deaggregated_tx3.validate(Weighting::AsTransaction).is_ok());
assert_eq!(tx3, deaggregated_tx3);
}
@@ -334,9 +326,7 @@ fn multi_kernel_transaction_deaggregation_3() {
assert!(tx2.validate(Weighting::AsTransaction).is_ok());
let deaggregated_tx13 = deaggregate(tx123, &[tx2]).unwrap();
assert!(deaggregated_tx13
.validate(Weighting::AsTransaction)
.is_ok());
assert!(deaggregated_tx13.validate(Weighting::AsTransaction).is_ok());
assert_eq!(tx13, deaggregated_tx13);
}
@@ -366,9 +356,7 @@ fn multi_kernel_transaction_deaggregation_4() {
assert!(tx12345.validate(Weighting::AsTransaction).is_ok());
let deaggregated_tx5 = deaggregate(tx12345, &[tx1, tx2, tx3, tx4]).unwrap();
assert!(deaggregated_tx5
.validate(Weighting::AsTransaction)
.is_ok());
assert!(deaggregated_tx5.validate(Weighting::AsTransaction).is_ok());
assert_eq!(tx5, deaggregated_tx5);
}
@@ -401,9 +389,7 @@ fn multi_kernel_transaction_deaggregation_5() {
assert!(tx12345.validate(Weighting::AsTransaction).is_ok());
let deaggregated_tx5 = deaggregate(tx12345, &[tx12, tx34]).unwrap();
assert!(deaggregated_tx5
.validate(Weighting::AsTransaction)
.is_ok());
assert!(deaggregated_tx5.validate(Weighting::AsTransaction).is_ok());
assert_eq!(tx5, deaggregated_tx5);
}
@@ -424,16 +410,12 @@ fn basic_transaction_deaggregation() {
let deaggregated_tx1 = deaggregate(tx3.clone(), &[tx2.clone()]).unwrap();
assert!(deaggregated_tx1
.validate(Weighting::AsTransaction)
.is_ok());
assert!(deaggregated_tx1.validate(Weighting::AsTransaction).is_ok());
assert_eq!(tx1, deaggregated_tx1);
let deaggregated_tx2 = deaggregate(tx3, &[tx1]).unwrap();
assert!(deaggregated_tx2
.validate(Weighting::AsTransaction)
.is_ok());
assert!(deaggregated_tx2.validate(Weighting::AsTransaction).is_ok());
assert_eq!(tx2, deaggregated_tx2);
}
@@ -558,8 +540,7 @@ fn reward_with_tx_block() {
let tx1 = tx2i1o();
let previous_header = BlockHeader::default();
tx1.validate(Weighting::AsTransaction)
.unwrap();
tx1.validate(Weighting::AsTransaction).unwrap();
let block = new_block(&[tx1], &keychain, &builder, &previous_header, &key_id);
block.validate(&BlindingFactor::zero()).unwrap();
+1 -1
View File
@@ -1,7 +1,7 @@
[package]
name = "grin_gen_gen"
version = "0.0.1"
edition = "2018"
edition = "2021"
authors = ["Grin Developers <mimblewimble@lists.launchpad.net>"]
description = "Utility to automate the generation of Grin's genesis block"
license = "Apache-2.0"
+1 -1
View File
@@ -7,7 +7,7 @@ license = "Apache-2.0"
repository = "https://github.com/mimblewimble/grin"
keywords = [ "crypto", "grin", "mimblewimble" ]
workspace = '..'
edition = "2018"
edition = "2021"
[dependencies]
byteorder = "1"
+1 -1
View File
@@ -7,7 +7,7 @@ license = "Apache-2.0"
repository = "https://github.com/mimblewimble/grin"
keywords = [ "crypto", "grin", "mimblewimble" ]
workspace = ".."
edition = "2018"
edition = "2021"
build = "src/build/build.rs"
[dependencies]
+8 -7
View File
@@ -18,16 +18,17 @@ use grin_p2p as p2p;
use grin_util as util;
use grin_util::StopState;
use crate::core::core::hash::Hash;
use crate::core::global;
use crate::core::pow::Difficulty;
use crate::p2p::types::PeerAddr;
use crate::p2p::Peer;
use grin_p2p::msg::built_info;
use std::net::{SocketAddr, TcpListener, TcpStream};
use std::sync::Arc;
use std::{thread, time};
use crate::core::core::hash::Hash;
use crate::core::global;
use crate::core::pow::Difficulty;
use crate::p2p::msg::built_info;
use crate::p2p::types::PeerAddr;
use crate::p2p::Peer;
fn open_port() -> u16 {
// use port 0 to allow the OS to assign an open port
// TcpListener's Drop impl will unbind the port as soon as
@@ -89,7 +90,7 @@ fn peer_handshake() {
.unwrap();
let git_hash =
built_info::GIT_COMMIT_HASH_SHORT.map_or_else(|| "+".to_owned(), |v| ".".to_owned() + v);
built_info::GIT_COMMIT_HASH_SHORT.map_or_else(|| "".to_owned(), |v| ".".to_owned() + v);
assert!(peer
.info
.user_agent
+1 -1
View File
@@ -7,7 +7,7 @@ license = "Apache-2.0"
repository = "https://github.com/mimblewimble/grin"
keywords = [ "crypto", "grin", "mimblewimble" ]
workspace = '..'
edition = "2018"
edition = "2021"
[dependencies]
blake2-rfc = "0.2"
+1 -1
View File
@@ -3,7 +3,7 @@ name = "grin_pool_fuzz"
version = "0.0.0"
authors = ["Automatically generated"]
publish = false
edition = "2018"
edition = "2021"
[dependencies]
chrono = "0.4.11"
+1 -3
View File
@@ -402,9 +402,7 @@ where
// Otherwise discard and let the next block pick this tx up.
let bucket = &tx_buckets[pos];
if let Ok(new_bucket) =
bucket.aggregate_with_tx(entry.tx.clone(), weighting)
{
if let Ok(new_bucket) = bucket.aggregate_with_tx(entry.tx.clone(), weighting) {
if new_bucket.fee_rate >= bucket.fee_rate {
// Only aggregate if it would not reduce the fee_rate ratio.
tx_buckets[pos] = new_bucket;
+1 -1
View File
@@ -1,2 +1,2 @@
hard_tabs = true
edition = "2018"
edition = "2021"
+1 -1
View File
@@ -7,7 +7,7 @@ license = "Apache-2.0"
repository = "https://github.com/mimblewimble/grin"
keywords = [ "crypto", "grin", "mimblewimble" ]
workspace = ".."
edition = "2018"
edition = "2021"
[dependencies]
hyper = { version = "0.14", features = ["full"] }
+10 -12
View File
@@ -33,22 +33,20 @@ use crate::p2p::types::PeerAddr;
use crate::p2p::ChainAdapter;
use crate::util::StopState;
/// DNS Seeds with contact email associated - Mainnet
/// DNS Seeds with contacts associated - Mainnet
pub const MAINNET_DNS_SEEDS: &[&str] = &[
"mainnet.seed.grin.lesceller.com", // q.lesceller@gmail.com
"mainnet.seed.grin.prokapi.com", // hendi@prokapi.com
"grinseed.revcore.net", // yeastplume@gmail.com
"mainnet-seed.grinnode.live", // info@grinnode.live
"mainnet.grin.punksec.de", // grin@punksec.de
"grinnode.30-r.com", // trinitron@30-r.com
"grincoin.org", // xmpp:aglkm@conversations.im
"main.gri.mw", // admin@gri.mw
"mainnet.grinffindor.org", // support@grinffindor.org
"main-seed.grin.money", // support@grinily.com
];
/// DNS Seeds with contact email associated - Testnet
/// DNS Seeds with contacts associated - Testnet
pub const TESTNET_DNS_SEEDS: &[&str] = &[
"floonet.seed.grin.lesceller.com", // q.lesceller@gmail.com
"floonet.seed.grin.prokapi.com", // hendi@prokapi.com
"grintestseed.revcore.net", // yeastplume@gmail.com
"testnet.grin.punksec.de", // grin@punksec.de
"testnet.grinnode.30-r.com", // trinitron@30-r.com
"testnet.grincoin.org", // xmpp:aglkm@conversations.im
"test.gri.mw", // admin@gri.mw
"testnet.grinffindor.org", // support@grinffindor.org
"test-seed.grin.money", // support@grinily.com
];
pub fn connect_and_monitor(
+1 -1
View File
@@ -55,7 +55,7 @@ pub fn info_strings() -> (String, String) {
format!(
"This is Grin version {}{}, built for {} by {}.",
built_info::PKG_VERSION,
built_info::GIT_VERSION.map_or_else(|| "".to_owned(), |v| format!(" (git {})", v)),
built_info::GIT_COMMIT_HASH.map_or_else(|| "".to_owned(), |v| format!(" (git {})", v)),
built_info::TARGET,
built_info::RUSTC_VERSION,
),
+1
View File
@@ -0,0 +1 @@
staging test
+1 -1
View File
@@ -7,7 +7,7 @@ license = "Apache-2.0"
repository = "https://github.com/mimblewimble/grin"
keywords = [ "crypto", "grin", "mimblewimble" ]
workspace = ".."
edition = "2018"
edition = "2021"
[dependencies]
byteorder = "1"
+1 -1
View File
@@ -7,7 +7,7 @@ license = "Apache-2.0"
repository = "https://github.com/mimblewimble/grin"
keywords = [ "crypto", "grin", "mimblewimble" ]
workspace = ".."
edition = "2018"
edition = "2021"
[dependencies]
anyhow = "1.0"