profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/arkpar/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

arkpar/remix 2

Ethereum IDE and tools for the web

arkpar/rust-secp256k1 2

Rust language bindings for Bitcoin secp256k1 library.

arkpar/alethzero 1

The AlethZero Hardcore Ethereum Client

arkpar/cpp-ethereum 1

Gavin Wood's C++ implementation of the Ethereum yellowpaper.

arkpar/dapp-bin 1

A place for all the ÐApps to live

arkpar/parity 1

Fast, light, robust Ethereum implementation

arkpar/qhttpserver 1

HTTP server implementation for Qt based on node.js' http parser

arkpar/bn 0

Pairing cryptography library in Rust

arkpar/core 0

Airalab keep all significant developed smart contracts on this repo.

issue closedparitytech/polkadot

ParityDb issue

The 0.9.9-8b8d4c8c-x86_64-linux-gnu has an issue:

====================
Version: 0.9.9-8b8d4c8c-x86_64-linux-gnu
   0: sp_panic_handler::set::{{closure}}
   1: std::panicking::rust_panic_with_hook
             at rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/std/src/panicking.rs:595:17
   2: std::panicking::begin_panic_handler::{{closure}}
             at rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/std/src/panicking.rs:495:13
   3: std::sys_common::backtrace::__rust_end_short_backtrace
             at rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/std/src/sys_common/backtrace.rs:141:18
   4: rust_begin_unwind
             at rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/std/src/panicking.rs:493:5
   5: core::panicking::panic_fmt
             at rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/core/src/panicking.rs:92:14
   6: core::panicking::panic
             at rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/core/src/panicking.rs:50:5
   7: parity_db::table::ValueTable::next_free
   8: parity_db::table::ValueTable::overwrite_chain
   9: parity_db::column::Column::write_plan
  10: parity_db::db::DbInner::process_commits
  11: parity_db::db::Db::log_worker
  12: std::sys_common::backtrace::__rust_begin_short_backtrace
  13: core::ops::function::FnOnce::call_once{{vtable.shim}}
  14: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/alloc/src/boxed.rs:1546:9
      <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/alloc/src/boxed.rs:1546:9
      std::sys::unix::thread::Thread::new::thread_start
             at rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/std/src/sys/unix/thread.rs:71:17
  15: start_thread
  16: clone
Thread '<unnamed>' panicked at 'attempt to multiply with overflow', /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/parity-db-0.3.1/src/table.rs:601
This is a bug. Please report it at:
        https://github.com/paritytech/polkadot/issues/new

The node uses ParityDb. Last block is #6524424. Flags: -name kusama-bootnode-0 --base-path /home/parity/.local/share/polkadot --listen-addr=/ip4/0.0.0.0/tcp/30334/ws --node-key-file /keys/kusamay --chain kusama --listen-addr=/ip4/0.0.0.0/tcp/30333 --public-addr=/ip4/51.77.66.187/tcp/30333 --in-peers 25 --out-peers 25 --database paritydb-experimental --db-cache 512 --pruning=1000 --unsafe-pruning --prometheus-external --prometheus-port 9615 --ws-port 9944 --ws-max-connections 100 --rpc-port 9933 --listen-addr /ip6/::/tcp/30333

After restart with latest version (0.9.9-07d1830-x86_64-linux-gnu) from the master node can't start. There aren't any error messages.

closed time in an hour

kogeler

pull request commentparitytech/parity-db

fix: madvise_random on not(unix)

published as 0.3.2

kinosang

comment created time in 2 days

push eventparitytech/parity-db

arkpar

commit sha 842ab62e11ec2178f58038b2cd547d537b9daea9

Bump version

view details

push time in 2 days

push eventparitytech/parity-db

Chino Chang

commit sha 53d8eed10b71fb3c3896522794e17a3b0c7540d6

fix: madvise_random should return () instead of Result<()>

view details

Chino Chang

commit sha ca0088bc502ee410d0cc0a18c0c3653aeb8dcda9

Apply suggestions from code review Co-authored-by: Shamil <66209982+shamilsan@users.noreply.github.com>

view details

Arkadiy Paronyan

commit sha c186770e9c9fd1649b96862a1cb164c8dc61234a

Merge pull request #40 from kinosang/patch-1 fix: madvise_random on not(unix)

view details

push time in 2 days

PR merged paritytech/parity-db

fix: madvise_random on not(unix)

should return () instead of Result<()>

+1 -3

2 comments

1 changed file

kinosang

pr closed time in 2 days

issue commentparitytech/polkadot

ParityDb issue

Could you provide a copy of the database?

kogeler

comment created time in 4 days

issue commentparitytech/substrate

Make use of state cache when building blocks for a parachain

There's no benchmark specifically for the block building that I'm aware of. We could try replacing the storage cache with the trie cache and simply compare importing 100k blocks of an existing parachain with an import command.

bkchr

comment created time in 8 days

issue commentparitytech/polkadot

Kusama Node Fails to Sync Beyond 8949248

@bkchr Requesting side specifies the maximum count, but the serving side applies the size limit. I've changed the requested size from 128 to 64 blocks but the result is still above the limit so that serving nodes that are not updated with the fix yet can't send it. I don't think we should further reduce the requested block size as it will result in too fragmented batches for small-sized blocks. Instead we should deploy the fix on the bootnodes to respect the size limit.

joepetrowski

comment created time in 9 days

PullRequestReviewEvent

Pull request review commentparitytech/substrate

Inner hashing of value in state trie (runtime versioning).

 fn generate_runtime_api_base_structures() -> Result<TokenStream> { 				#crate_::StorageChanges<C::StateBackend, Block>, 				String 			> where Self: Sized {+				let at = #crate_::BlockId::Hash(parent_hash.clone());+				let state_hash = self.call+					.runtime_version_at(&at)+					.map(|v| v.state_version())

Is the result of runtime_version_at cached somewhere at this point? This might be an expensive call.

cheme

comment created time in 10 days

Pull request review commentparitytech/substrate

Inner hashing of value in state trie (runtime versioning).

 impl RuntimeVersion { 	pub fn api_version(&self, id: &ApiId) -> Option<u32> { 		self.apis.iter().find_map(|a| (a.0 == *id).then(|| a.1)) 	}++	/// Returns state version to use for update.+	pub fn state_version(&self) -> StateVersion {+		let core_api_id = sp_runtime::hashing::blake2_64(b"Core");

Is there a way to make this compile time const? cc @bkchr

cheme

comment created time in 10 days

Pull request review commentparitytech/substrate

Inner hashing of value in state trie (runtime versioning).

 pub mod well_known_keys { 	} } +/// Default value to use as a threshold for inner hashing.+pub const DEFAULT_MAX_INLINE_VALUE: u32 = 33;

So does this mean that values of size 33 still end up inlined and 34 gets moved to a separate node?

cheme

comment created time in 10 days

Pull request review commentparitytech/substrate

Inner hashing of value in state trie (runtime versioning).

 fn generate_runtime_api_base_structures() -> Result<TokenStream> { 				#crate_::StorageChanges<C::StateBackend, Block>, 				String 			> where Self: Sized {+				let at = #crate_::BlockId::Hash(parent_hash.clone());+				let state_hash = self.call

Is that a hash or storage version?

cheme

comment created time in 10 days

PullRequestReviewEvent
PullRequestReviewEvent

issue commentparitytech/polkadot

Kusama Node Fails to Sync Beyond 8949248

64 block request is still too much. The fix needs to be deployed on a significant number of peers to work properly. @paritytech/ci could we deploy current 0.9.10 on our bootnodes please?

joepetrowski

comment created time in 11 days

pull request commentparitytech/trie

Inner hash of value with new nodes

@bkchr Please review or assign someone

cheme

comment created time in 15 days

PullRequestReviewEvent
PullRequestReviewEvent

pull request commentparitytech/substrate

Storage chain fixes + guide

@liuchengxu Make sure you also use --storage-chain and a custom chain spec as specified in the guide. Check that storage transaction is in the block with https://polkadot.js.org/apps/#/explorer or an RPC request. There should be a Stored event emitted.

arkpar

comment created time in 17 days

PullRequestReviewEvent

Pull request review commentparitytech/trie

Inner hash of value with new nodes

 //! Generation of compact proofs for Merkle-Patricia tries.  use crate::rstd::{-	boxed::Box, convert::TryInto, marker::PhantomData, ops::Range, vec, vec::Vec,+	boxed::Box, convert::TryInto, marker::PhantomData, vec, vec::Vec, };  use hash_db::Hasher;  use crate::{-	CError, ChildReference, nibble::LeftNibbleSlice, nibble_ops::NIBBLE_LENGTH, NibbleSlice, node::{NodeHandle, NodeHandlePlan, NodePlan, OwnedNode}, NodeCodec, Recorder,+	CError, ChildReference, nibble::LeftNibbleSlice, nibble_ops::NIBBLE_LENGTH, NibbleSlice,+	node::{NodeHandle, NodeHandlePlan, NodePlan, OwnedNode, Value, ValuePlan}, NodeCodec, Recorder, 	Result as TrieResult, Trie, TrieError, TrieHash,-	TrieLayout,+	TrieLayout, Record, }; +enum ValueMgmt {+	/// The value should be omitted in the generated proof.+	OmitValue,

Does this mean all value are excluded, or only external?

cheme

comment created time in 18 days

Pull request review commentparitytech/trie

Inner hash of value with new nodes

 pub struct TrieDBMut<'a, L> where 	L: TrieLayout, {-	storage: NodeStorage<TrieHash<L>>,+	layout: L,+	storage: NodeStorage<L>, 	db: &'a mut dyn HashDB<L::Hash, DBValue>, 	root: &'a mut TrieHash<L>, 	root_handle: NodeHandle<TrieHash<L>>, 	death_row: HashSet<(TrieHash<L>, (BackingByteVec, Option<u8>))>, 	/// The number of hash operations this trie has performed. 	/// Note that none are performed until changes are committed.+	/// This omit value hashing.
	/// This does not include value hashing.
cheme

comment created time in 18 days

Pull request review commentparitytech/trie

Inner hash of value with new nodes

 fn empty_children<H>() -> Box<[Option<NodeHandle<H>>; 16]> { /// therefore its left side is a full prefix. type NibbleFullKey<'key> = NibbleSlice<'key>; +/// Value representation for Node.+#[derive(Clone, Eq)]+pub enum Value<L: TrieLayout> {+	/// Node with no value attached.+	NoValue,+	/// Value bytes.+	Value(DBValue),+	/// Hash of value bytes if calculated and value bytes.+	HashedValue(Option<TrieHash<L>>, Option<DBValue>),+}++impl<L: TrieLayout> PartialEq<Self> for Value<L> {+	fn eq(&self, other: &Self) -> bool {+		match (self, other) {+			(Value::NoValue, Value::NoValue) => true,+			(Value::Value(v), Value::Value(ov)) => v == ov,+			(Value::HashedValue(Some(h), _), Value::HashedValue(Some(oh), _)) => h == oh,+			(Value::HashedValue(_, Some(v)), Value::HashedValue(_, Some(ov))) => v == ov,+			// Note that for uncalculated hash we do not calculate it and default to true.+			// This is rather similar to default Eq implementation.+			_ => false,+		}+	}+}++impl<'a, L: TrieLayout> From<EncodedValue<'a>> for Value<L> {+	fn from(v: EncodedValue<'a>) -> Self {+		match v {+			EncodedValue::NoValue => Value::NoValue,+			EncodedValue::Value(value) => Value::Value(value.to_vec()),+			EncodedValue::HashedValue(hash, value) => {+				let mut h = TrieHash::<L>::default();+				h.as_mut().copy_from_slice(hash);+				Value::HashedValue(Some(h), value)+			},+		}+	}+}++impl<L: TrieLayout> From<(Option<DBValue>, Option<u32>)> for Value<L> {+	fn from((v, threshold): (Option<DBValue>, Option<u32>)) -> Self {+		match v {+			Some(value) => if threshold.map(|threshold| value.len() >= threshold as usize).unwrap_or(false) {+				Value::HashedValue(None, Some(value.to_vec()))+			} else {+				Value::Value(value.to_vec())+			},+			None => Value::NoValue,+		}+	}+}++impl<L: TrieLayout> Value<L> {+	fn new(value: Option<DBValue>, new_threshold: Option<u32>) -> Self {+		(value, new_threshold).into()+	}++	fn into_encode<'a, F>(&'a mut self, f: &mut F) -> EncodedValue<'a>+	where+		F: FnMut(Option<&[u8]>, NodeHandle<TrieHash<L>>, Option<&NibbleSlice>, Option<u8>) -> ChildReference<TrieHash<L>>,+	{+		if let Value::HashedValue(hash, value) = self {+			if let Some(value) = value.as_ref() {+				let new_hash = if let ChildReference::Hash(hash) = f(Some(value.as_slice()), NodeHandle::Hash(Default::default()), None, None) {+					hash+				} else {+					unreachable!()

Looks like it depends if f is implemented correctly. There should be an assertion with explanation if it is not.

cheme

comment created time in 18 days

Pull request review commentparitytech/trie

Inner hash of value with new nodes

 where { 	/// Create a new trie with backing database `db` and empty `root`. 	pub fn new(db: &'a mut dyn HashDB<L::Hash, DBValue>, root: &'a mut TrieHash<L>) -> Self {+		Self::new_with_layout(db, root, Default::default())+	}++	/// Create a new trie with backing database `db` and empty `root`.+	/// This could use a context specific layout.
	/// using a context specific layout.
cheme

comment created time in 18 days

Pull request review commentparitytech/trie

Inner hash of value with new nodes

 fn empty_children<H>() -> Box<[Option<NodeHandle<H>>; 16]> { /// therefore its left side is a full prefix. type NibbleFullKey<'key> = NibbleSlice<'key>; +/// Value representation for Node.+#[derive(Clone, Eq)]+pub enum Value<L: TrieLayout> {+	/// Node with no value attached.+	NoValue,+	/// Value bytes.+	Value(DBValue),+	/// Hash of value bytes if calculated and value bytes.+	HashedValue(Option<TrieHash<L>>, Option<DBValue>),

Looks like two options are mutually exclusive? Perhaps it would be better to use two separate enum variants here?

cheme

comment created time in 18 days

Pull request review commentparitytech/trie

Inner hash of value with new nodes

 fn empty_children<H>() -> Box<[Option<NodeHandle<H>>; 16]> { /// therefore its left side is a full prefix. type NibbleFullKey<'key> = NibbleSlice<'key>; +/// Value representation for Node.+#[derive(Clone, Eq)]+pub enum Value<L: TrieLayout> {+	/// Node with no value attached.+	NoValue,+	/// Value bytes.+	Value(DBValue),+	/// Hash of value bytes if calculated and value bytes.+	HashedValue(Option<TrieHash<L>>, Option<DBValue>),+}++impl<L: TrieLayout> PartialEq<Self> for Value<L> {+	fn eq(&self, other: &Self) -> bool {+		match (self, other) {+			(Value::NoValue, Value::NoValue) => true,+			(Value::Value(v), Value::Value(ov)) => v == ov,+			(Value::HashedValue(Some(h), _), Value::HashedValue(Some(oh), _)) => h == oh,+			(Value::HashedValue(_, Some(v)), Value::HashedValue(_, Some(ov))) => v == ov,+			// Note that for uncalculated hash we do not calculate it and default to true.+			// This is rather similar to default Eq implementation.+			_ => false,+		}+	}+}++impl<'a, L: TrieLayout> From<EncodedValue<'a>> for Value<L> {+	fn from(v: EncodedValue<'a>) -> Self {+		match v {+			EncodedValue::NoValue => Value::NoValue,+			EncodedValue::Value(value) => Value::Value(value.to_vec()),+			EncodedValue::HashedValue(hash, value) => {+				let mut h = TrieHash::<L>::default();+				h.as_mut().copy_from_slice(hash);+				Value::HashedValue(Some(h), value)+			},+		}+	}+}++impl<L: TrieLayout> From<(Option<DBValue>, Option<u32>)> for Value<L> {+	fn from((v, threshold): (Option<DBValue>, Option<u32>)) -> Self {+		match v {+			Some(value) => if threshold.map(|threshold| value.len() >= threshold as usize).unwrap_or(false) {+				Value::HashedValue(None, Some(value.to_vec()))+			} else {+				Value::Value(value.to_vec())+			},+			None => Value::NoValue,+		}+	}+}++impl<L: TrieLayout> Value<L> {+	fn new(value: Option<DBValue>, new_threshold: Option<u32>) -> Self {+		(value, new_threshold).into()+	}++	fn into_encode<'a, F>(&'a mut self, f: &mut F) -> EncodedValue<'a>+	where+		F: FnMut(Option<&[u8]>, NodeHandle<TrieHash<L>>, Option<&NibbleSlice>, Option<u8>) -> ChildReference<TrieHash<L>>,+	{+		if let Value::HashedValue(hash, value) = self {+			if let Some(value) = value.as_ref() {+				let new_hash = if let ChildReference::Hash(hash) = f(Some(value.as_slice()), NodeHandle::Hash(Default::default()), None, None) {+					hash+				} else {+					unreachable!()+				};+				if let Some(hash2) = hash.as_ref() {+					debug_assert!(hash2 == &new_hash);+				} else {+					*hash = Some(new_hash);+				}+			}+		}+		let value = match &*self {+			Value::NoValue => EncodedValue::NoValue,+			Value::Value(value) => EncodedValue::Value(value.as_slice()),+			Value::HashedValue(Some(hash), _value) => EncodedValue::HashedValue(hash.as_ref(), None),+			Value::HashedValue(None, _value) => unreachable!(),

Could use an explanation

cheme

comment created time in 18 days

Pull request review commentparitytech/trie

Inner hash of value with new nodes

 fn empty_children<H>() -> Box<[Option<NodeHandle<H>>; 16]> { /// therefore its left side is a full prefix. type NibbleFullKey<'key> = NibbleSlice<'key>; +/// Value representation for Node.+#[derive(Clone, Eq)]+pub enum Value<L: TrieLayout> {+	/// Node with no value attached.+	NoValue,+	/// Value bytes.+	Value(DBValue),+	/// Hash of value bytes if calculated and value bytes.+	HashedValue(Option<TrieHash<L>>, Option<DBValue>),+}++impl<L: TrieLayout> PartialEq<Self> for Value<L> {+	fn eq(&self, other: &Self) -> bool {+		match (self, other) {+			(Value::NoValue, Value::NoValue) => true,+			(Value::Value(v), Value::Value(ov)) => v == ov,+			(Value::HashedValue(Some(h), _), Value::HashedValue(Some(oh), _)) => h == oh,+			(Value::HashedValue(_, Some(v)), Value::HashedValue(_, Some(ov))) => v == ov,+			// Note that for uncalculated hash we do not calculate it and default to true.+			// This is rather similar to default Eq implementation.+			_ => false,+		}+	}+}++impl<'a, L: TrieLayout> From<EncodedValue<'a>> for Value<L> {+	fn from(v: EncodedValue<'a>) -> Self {+		match v {+			EncodedValue::NoValue => Value::NoValue,+			EncodedValue::Value(value) => Value::Value(value.to_vec()),+			EncodedValue::HashedValue(hash, value) => {+				let mut h = TrieHash::<L>::default();+				h.as_mut().copy_from_slice(hash);+				Value::HashedValue(Some(h), value)+			},+		}+	}+}++impl<L: TrieLayout> From<(Option<DBValue>, Option<u32>)> for Value<L> {+	fn from((v, threshold): (Option<DBValue>, Option<u32>)) -> Self {+		match v {+			Some(value) => if threshold.map(|threshold| value.len() >= threshold as usize).unwrap_or(false) {+				Value::HashedValue(None, Some(value.to_vec()))+			} else {+				Value::Value(value.to_vec())+			},+			None => Value::NoValue,+		}+	}+}++impl<L: TrieLayout> Value<L> {+	fn new(value: Option<DBValue>, new_threshold: Option<u32>) -> Self {+		(value, new_threshold).into()+	}++	fn into_encode<'a, F>(&'a mut self, f: &mut F) -> EncodedValue<'a>

into_encoded

cheme

comment created time in 18 days

Pull request review commentparitytech/trie

Inner hash of value with new nodes

 impl NibbleSlicePlan { 	} } +/// Plan for value representation in `NodePlan`.+#[derive(Eq, PartialEq, Clone)]+#[cfg_attr(feature = "std", derive(Debug))]+pub enum ValuePlan {

Is this only used for compact proof encoding?

cheme

comment created time in 18 days

Pull request review commentparitytech/trie

Inner hash of value with new nodes

 where 	/// Returns an error if `root` does not exist 	pub fn new( 		db: &'db dyn HashDBRef<L::Hash, DBValue>,-		root: &'db TrieHash<L>+		root: &'db TrieHash<L>,+	) -> Result<Self, TrieHash<L>, CError<L>> {+		Self::new_with_layout(db, root, Default::default())+	}++	/// Create a new trie with backing database `db` and empty `root`.+	/// Returns an error if `root` does not exist+	/// This can use a context specific layout.+	pub fn new_with_layout(+		db: &'db dyn HashDBRef<L::Hash, DBValue>,+		root: &'db TrieHash<L>,+		layout: L, 	) -> Result<Self, TrieHash<L>, CError<L>> { 		if !db.contains(root, EMPTY_PREFIX) { 			Err(Box::new(TrieError::InvalidStateRoot(*root))) 		} else {-			Ok(TrieDB {db, root, hash_count: 0})+			Ok(TrieDB {db, root, hash_count: 0, layout}) 		} 	} +	/// `new_with_layout`, but do not check root presence, if missing+	/// this will fail at first node access.+	pub fn new_with_layout_uncheck(

new_with_layout_unchecked perhaps

cheme

comment created time in 18 days