skoupidi
9f5e6aafc4
blockchain: changed block height from u64 to u32
2024-04-08 15:17:01 +03:00
skoupidi
d9304c15cd
runtime: changed call_index from u32 to u8
2024-04-08 11:40:16 +03:00
zero
dd341c156a
smt: add docstrings for runtime/SDK fns
2024-04-03 19:07:40 +02:00
zero
56d5281f6c
runtime: remove unused put_object_bytes()
2024-04-03 18:59:06 +02:00
zero
b42cb611c5
runtime: review and update ACL perms for fns
2024-04-03 18:57:40 +02:00
zero
3a6707cb81
runtime/merkle: remove faulty asserts, we used to exit early with success if coins was empty but then that meant the merkle root -> blockheight wouldn't be updated. recently this was changed so the old asserts are no longer valid.
2024-04-03 13:13:15 +02:00
parazyd
d68619d84d
runtime/import/smt: Correct log message
2024-04-03 11:17:19 +02:00
parazyd
f425397115
sdk/crypto/smt: Implement leaf removal support
2024-04-03 11:16:26 +02:00
zero
b9cc42cdf4
SDK: move all WASM runtime fns into wasm/ submod
2024-04-03 10:44:51 +02:00
zero
b6e8c00243
replace all data strings output as [123, 78, ...] with big endian hex strings.
2024-04-02 10:40:56 +02:00
skoupidi
dad7577bed
blockchain/tx_store: new tx location tree added
2024-04-01 21:28:43 +03:00
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