Commit Graph

180 Commits

Author SHA1 Message Date
zero
98fb3af981 runtime::{smt, merkle}: add missing call_idx to db_roots data 2024-04-01 17:50:52 +02:00
zero
9074440105 runtime: remove call_idx from the payload, and add it as a Runtime param 2024-04-01 17:46:27 +02:00
zero
69cf9c3a1a runtime: add missing get_tx_hash() 2024-04-01 17:04:09 +02:00
zero
fbe13ed480 DAO::propose(): goodbye nullifiers, hello SMT 2024-04-01 15:52:58 +02:00
skoupidi
ea93623ff8 blockchain/contract_store: unified wasm and states trees into a single store structure 2024-04-01 15:56:02 +03:00
skoupidi
7d4151c230 sdk: fn get_tx(hash) added 2024-04-01 14:19:22 +03:00
skoupidi
0475a8e2d3 runtime/import/util: corrected some log targets 2024-04-01 13:25:29 +03:00
zero
9878fff12d runtime::{merkle, smt}: change value for roots_db from (blk_height:3, tx_idx:2, call_idx:2) to (tx_hash:32, call_idx:2) 2024-04-01 12:07:25 +02:00
zero
0967744635 runtime: add tx_hash to runtime params 2024-04-01 11:59:17 +02:00
zero
5c9e3bd4a1 tx: change tx.hash() -> Result<blake3::Hash> to tx.hash() -> TransactionHash, by calling .unwrap() on blake3 hasher. This should be safe (see code comment in tx/mod.rs:188 inside fn hash() ) 2024-04-01 11:59:17 +02:00
skoupidi
f9a58ca5ad runtime/import/util: minor optimizations retrieving block info stuff 2024-04-01 12:57:21 +03:00
zero
2919a595f1 runtime/merkle & smt: implements DB_roots format documented in the book arch/dao page. We store all merkle roots together with information about exactly when that root occurred. To store when the root occurred, we use an absolute location of (block_height, tx_idx, call_idx). Right now tx_idx and call_idx are hardcoded to 0 since the env doesn't yet have access to this info. 2024-04-01 09:23:07 +02:00
skoupidi
2956207cc5 chore: clippy 2024-03-26 15:02:21 +02:00
zero
010ea6037d runtime/merkle: db_roots store key=blockhash, value=blockheight (before value=[]) 2024-03-19 10:48:22 +01:00
zero
cde5f7cea2 runtime/merkle: simplify the function. we do not need to store the intermediate roots for the tree since each update is atomic. Also the serialization length == 32 should be an assert rather than a conditional check. 2024-03-19 10:34:45 +01:00
zero
fd1d154b15 runtime/smt: return early with SUCCESS (but give a warning) if the nullifiers list for changing the tree is empty. 2024-03-19 10:26:01 +01:00
zero
309157e0ba runtime/merkle: return early with SUCCESS (but give a warning) if the coins list for changing the tree is empty. We also don't do any gas calc since nothing on disk was modified. 2024-03-19 10:15:24 +01:00
parazyd
ec5984685b chore: Add missing license headers 2024-03-19 09:23:11 +01:00
zero
66b44abc78 runtime: lock sled overlay for the entire duration of merkle::merkle_add() [safety rzns] 2024-03-18 15:58:03 +01:00
zero
c5166445d7 smt: get it working with the WASM, and add it to money contract for nullifiers. Summary of changes:
* EMPTY_NODES_FP in sdk/crypto/smt/empty.rs since computing 256 hashes uses up all the gas
* Create SmtWasmFp backend for SMT in sdk/crypto/smt/wasmdb.rs
* add sparse_merkle_insert_batch() into runtime/import/smt.rs
* Update money contract nullifiers to use the SMT
2024-03-18 15:50:30 +01:00
parazyd
1297ff7b07 src/time: Implement and use {over,under}flow-safe API 2024-03-07 12:35:21 +01:00
skoupidi
a3a747df39 contract/money/pow_reward: removed obselete ECVRF 2024-03-05 13:13:02 +02:00
parazyd
195c477caa chore: Clippy lints 2024-03-05 08:47:43 +01:00
skoupidi
4e8e1ea0a2 chore: clippy 2024-02-23 15:33:08 +02:00
nighthawk24
9d2adcd93a runtime : Use unwrap_or_else to set retdata 2024-02-23 15:29:25 +02:00
skoupidi
8eef36b898 blockchain/header: changed nonce from pallas::Base to u64 2024-02-10 12:06:38 +02:00
skoupidi
2805f1435c validator: fixed minor encoding/decoding bugs 2024-02-01 14:04:36 +02:00
skoupidi
3355575721 runtime: replaced timekeeper with verifying block height directly 2024-01-31 14:22:51 +02:00
skoupidi
2f5de8e999 runtime: removed slot related fns and added gas cost to util fns 2024-01-31 14:12:29 +02:00
skoupidi
f64c4e5750 contract/*: renamed all slot references to block height 2024-01-30 21:27:46 +02:00
skoupidi
07b47fd521 contract/money/pow_reward: simplyfied call to use last block information directly from database overlay 2024-01-30 20:59:23 +02:00
parazyd
5aad1deb73 runtime/import/merkle: Account for gas costs in merkle_add() 2024-01-19 11:17:44 +01:00
parazyd
a3ed654d3a runtime/import/db: Apply gas subtraction to remaining db.rs functions 2024-01-18 13:23:08 +01:00
parazyd
9fb2febfb3 runtime/import/db: Implement host gas cost for zkas_db_set()
This is unfinished, as we should properly account for the ZkBinary
rather than just charging a fixed cost for every literal/witness/opcode.
2024-01-18 12:50:30 +01:00
parazyd
c03d48645c runtime/import: Subtract gas fee in get_slot() 2024-01-17 15:46:29 +01:00
parazyd
f9515f3ddc runtime: Begin implementation of host function gas costs 2024-01-17 15:38:12 +01:00
aggstam
e829424a9c sdk/util: added block height retrieval functions and use them at appropriate places 2024-01-16 18:07:39 +02:00
parazyd
e340fa6824 sdk: Apply relevant changes related to 3240221614 2024-01-16 16:20:14 +01:00
parazyd
3240221614 runtime/import: General function cleanup and use darkfi_sdk error codes
The general idea is that functional stuff inside wasm ends at 32-bits
and anything above is considered an error as per darkfi_sdk::error.
2024-01-16 16:07:18 +01:00
parazyd
87a85e047f runtime/import: Enable pages assertion in put_object_bytes() 2024-01-16 14:18:25 +01:00
parazyd
e034470611 runtime: Minor comment cleanups and log verbosity. 2024-01-16 14:13:26 +01:00
parazyd
0e6f51e895 chore: Update copyright year in license headers 2024-01-16 13:07:22 +01:00
parazyd
561318cf6f runtime: Disable payload debug message on Deploy 2024-01-09 16:06:40 +01:00
parazyd
e102f84e56 runtime: Remove unused sanity_check() function
This is now done inside the deployooor contract.
2024-01-09 12:09:34 +01:00
zero
cc2de1aca1 spec2: concepts page 2024-01-04 10:06:59 +01:00
parazyd
001bdecb53 runtime: Remove unused acl_deny function 2023-12-26 13:31:37 +01:00
x
c3587c0c6f general cleanup, clippy & update VKS/PKS in test-harness 2023-12-23 13:33:00 +01:00
ertosns
c83ad39e2b [runtime/vm_runtime] comment copy_to_memory 2023-12-22 16:33:47 +02:00
ertosns
27f123da5a [runtime/import/merkle] replace assertion by returning an error 2023-12-22 15:41:18 +02:00
ertosns
a4666d2549 [runtime/import/merkle] check if buffer is fully read 2023-12-22 15:38:31 +02:00