Skip to content

Commit 7e80b5b

Browse files
committed
clean up apply_entry
1 parent 5ecfebf commit 7e80b5b

File tree

11 files changed

+79
-116
lines changed

11 files changed

+79
-116
lines changed

ex/lib/consensus/coordination/fabric_event_gen.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ defmodule FabricEventGen do
4444
{:noreply, state}
4545
end
4646

47-
def handle_info({:entry, entry, muts_hash, muts, logs}, state) do
47+
def handle_info({:entry, entry, muts_hash, muts, receipts}, state) do
4848
height = Entry.height(entry)
49-
if logs != [] do
49+
if receipts != [] do
5050
#IO.inspect {height, logs, muts}
5151
end
5252

ex/lib/consensus/fabric_gen.ex

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,12 @@ defmodule FabricGen do
182182
entry ->
183183
start_ts = :os.system_time(1000)
184184
task = Task.async(fn -> FabricGen.apply_entry(entry) end)
185-
%{error: :ok, mutations_hash: m_hash, logs: l, muts: m
185+
%{error: :ok, mutations_hash: m_hash, receipts: r, muts: m
186186
} = case Task.await(task, :infinity) do
187187
result = %{error: :ok} -> result
188188
end
189189

190-
FabricEventGen.event_applied(entry, m_hash, m, l)
190+
FabricEventGen.event_applied(entry, m_hash, m, r)
191191
TXPool.delete_packed(entry.txs)
192192

193193
proc_entries()
@@ -294,22 +294,8 @@ defmodule FabricGen do
294294
%{db: db, cf: cf} = :persistent_term.get({:rocksdb, Fabric})
295295

296296
entry = next_entry
297-
next_entry_trimmed_map = %{
298-
entry_signer: entry.header.signer,
299-
entry_prev_hash: entry.header.prev_hash,
300-
entry_vr: entry.header.vr,
301-
entry_vr_b3: Blake3.hash(entry.header.vr),
302-
entry_dr: entry.header.dr,
303-
entry_slot: entry.header.slot,
304-
entry_prev_slot: entry.header.prev_slot,
305-
entry_height: entry.header.height,
306-
entry_epoch: div(entry.header.height, 100_000),
307-
}
308-
309-
txus = Enum.map(entry.txs, & Map.merge(&1, %{tx_size: byte_size(RDB.vecpak_encode(&1)), tx_historical_cost: TX.historical_cost(entry.header.height, &1) }))
310-
#IO.inspect txus, limit: 1111111111
311-
{rtx, m, m_rev, l, receipts, root_receipts, root_contractstate} = RDB.apply_entry(db, next_entry_trimmed_map,
312-
Application.fetch_env!(:ama, :trainer_pk), Application.fetch_env!(:ama, :trainer_sk), txus,
297+
{rtx, m, m_rev, receipts, root_receipts, root_contractstate} = RDB.apply_entry(db, RDB.vecpak_encode(entry),
298+
Application.fetch_env!(:ama, :trainer_pk), Application.fetch_env!(:ama, :trainer_sk),
313299
!!Application.fetch_env!(:ama, :testnet), Map.keys(Application.fetch_env!(:ama, :keys_by_pk))
314300
)
315301
rebuild_m_fn = fn(m)->
@@ -323,14 +309,8 @@ defmodule FabricGen do
323309
end
324310
end)
325311
end
326-
rebuild_l_fn = fn(m)->
327-
Enum.map(m, fn(inner)->
328-
%{error: IO.iodata_to_binary(inner["error"]), exec_used: IO.iodata_to_binary(inner["exec_used"])}
329-
end)
330-
end
331312
m = rebuild_m_fn.(m)
332313
m_rev = rebuild_m_fn.(m_rev)
333-
l = rebuild_l_fn.(l)
334314

335315
#receipts != [] && IO.inspect receipts
336316
#IO.inspect {entry.header.height, :erlang.crc32(root_receipts), :erlang.crc32(root_contractstate)}
@@ -384,6 +364,6 @@ defmodule FabricGen do
384364

385365
:ok = RocksDB.transaction_commit(rtx)
386366

387-
%{error: :ok, mutations_hash: mutations_hash, logs: l, muts: m}
367+
%{error: :ok, mutations_hash: mutations_hash, muts: m, receipts: receipts}
388368
end
389369
end

ex/lib/consensus/models/tx.ex

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ defmodule TX do
7373
if !BlsEx.verify?(txu.tx.signer, txu.signature, txu.hash, BLS12AggSig.dst_tx()), do: throw(%{error: :invalid_signature})
7474

7575
if !is_integer(txu.tx.nonce), do: throw(%{error: :nonce_not_integer})
76-
if txu.tx.nonce > 99_999_999_999_999_999_999, do: throw(%{error: :nonce_too_high})
77-
76+
if txu.tx.nonce > 18_446_744_073_709_551_615, do: throw(%{error: :nonce_too_high})
7877
if !is_map(action), do: throw(%{error: :action_must_be_map})
7978
if action[:op] != "call", do: throw %{error: :op_must_be_call}
8079
if !is_binary(action[:contract]), do: throw %{error: :contract_must_be_binary}

ex/lib/native/rdb.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ defmodule RDB do
4343
def transaction_iterator_cf(_tx, _cf), do: :erlang.nif_error(:nif_not_loaded)
4444
def transaction_iterator_move(_it, _action), do: :erlang.nif_error(:nif_not_loaded)
4545

46-
def apply_entry(_db, _next_entry_trimmed_map, _pk, _sk, _txus, _testnet, _testnet_peddlebike), do: :erlang.nif_error(:nif_not_loaded)
46+
def apply_entry(_db, _entry, _pk, _sk, _testnet, _testnet_peddlebike), do: :erlang.nif_error(:nif_not_loaded)
4747

4848
def vecpak_encode(_map), do: :erlang.nif_error(:nif_not_loaded)
4949
def vecpak_decode(_bin), do: :erlang.nif_error(:nif_not_loaded)

ex/native/rdb/src/atoms.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ rustler::atoms! {
3333
entry_prev_slot,
3434
entry_height,
3535
entry_epoch,
36+
entry_full,
3637

3738
tx,
3839
tx_encoded,
@@ -54,7 +55,6 @@ rustler::atoms! {
5455

5556
tx_cost,
5657
tx_historical_cost,
57-
tx_size,
5858

5959
direction,
6060
root,

ex/native/rdb/src/consensus/bic/protocol.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,10 @@ pub fn pay_cost(env: &mut crate::consensus::consensus_apply::ApplyEnv, cost: i12
5757
consensus_kv::kv_increment(env, &crate::bcat(&[b"account:", &env.caller_env.entry_signer, b":balance:AMA"]), cost/2);
5858
consensus_kv::kv_increment(env, &crate::bcat(&[b"account:", &coin::BURN_ADDRESS, b":balance:AMA"]), cost/2);
5959
}
60+
61+
pub fn tx_historical_cost(txu: &crate::model::tx::TXU) -> i128 {
62+
std::cmp::max(
63+
AMA_1_CENT,
64+
COST_PER_BYTE_HISTORICAL * crate::model::tx::to_bytes_tx(&txu.tx).unwrap().len() as i128,
65+
)
66+
}

ex/native/rdb/src/consensus/bic/wasm.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -636,12 +636,6 @@ pub fn setup_wasm_instance(env: &mut ApplyEnv, module: &Module, store: &mut Stor
636636

637637

638638
/*
639-
"import_attach" => Function::new_typed_with_env(&mut store, &host_env, import_attach_implementation),
640-
641-
"import_call_1" => Function::new_typed_with_env(&mut store, &host_env, import_call_1_implementation),
642-
"import_call_2" => Function::new_typed_with_env(&mut store, &host_env, import_call_2_implementation),
643-
"import_call_3" => Function::new_typed_with_env(&mut store, &host_env, import_call_3_implementation),
644-
"import_call_4" => Function::new_typed_with_env(&mut store, &host_env, import_call_4_implementation),
645639
646640
//storage
647641
"import_kv_clear" => Function::new_typed_with_env(&mut store, &host_env, import_storage_kv_clear_implementation),
@@ -745,7 +739,7 @@ pub fn call_contract(env: &mut ApplyEnv, wasm_bytes: &[u8], function_name: Strin
745739
let start = Instant::now();
746740
let call_result = entry_to_call.call(&mut store, &wasm_args);
747741
let duration = start.elapsed();
748-
println!("call result {} {:?}", duration.as_millis(), call_result);
742+
//println!("call result {} {:?}", duration.as_millis(), call_result);
749743

750744
let remaining = match get_remaining_points(&mut store, &instance) {
751745
MeteringPoints::Remaining(v) => v,

ex/native/rdb/src/consensus/consensus_apply.rs

Lines changed: 37 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,11 @@ impl<'db> ApplyEnv<'db> {
104104
Transaction<'db, TransactionDB<MultiThreaded>>,
105105
Vec<consensus_muts::Mutation>,
106106
Vec<consensus_muts::Mutation>,
107-
Vec<HashMap<String, String>>,
108107
Vec<protocol::ExecutionReceipt>,
109108
[u8; 32],
110109
[u8; 32],
111110
) {
112-
(self.txn, self.muts_final, self.muts_final_rev, self.result_log, self.receipts, root_receipts, root_contractstate)
111+
(self.txn, self.muts_final, self.muts_final_rev, self.receipts, root_receipts, root_contractstate)
113112
}
114113
}
115114

@@ -155,28 +154,37 @@ pub fn set_apply_env_tx<'db>(env: &mut ApplyEnv<'db>, tx_hash: &[u8; 32], tx_sig
155154
env.caller_env.account_origin = tx_signer.to_vec();
156155
}
157156

158-
pub fn apply_entry<'db, 'a>(db: &'db TransactionDB<MultiThreaded>, pk: &[u8], sk: &[u8],
159-
entry_signer: &[u8; 48], entry_prev_hash: &[u8; 32],
160-
entry_slot: u64, entry_prev_slot: u64, entry_height: u64, entry_epoch: u64,
161-
entry_vr: &[u8; 96], entry_vr_b3: &[u8; 32], entry_dr: &[u8; 32],
162-
txus: Vec<rustler::Term<'a>>, txn: Transaction<'db, TransactionDB<MultiThreaded>>,
157+
pub fn apply_entry<'db, 'a>(db: &'db TransactionDB<MultiThreaded>, txn: Transaction<'db, TransactionDB<MultiThreaded>>,
158+
entry: crate::model::entry::Entry, pk: &[u8], sk: &[u8],
163159
testnet: bool, testnet_peddlebikes: Vec<Vec<u8>>,
164-
) -> (Transaction<'db, TransactionDB<MultiThreaded>>, Vec<consensus_muts::Mutation>, Vec<consensus_muts::Mutation>, Vec<HashMap<String, String>>, Vec<protocol::ExecutionReceipt>, [u8; 32], [u8; 32]) {
160+
) -> (Transaction<'db, TransactionDB<MultiThreaded>>, Vec<consensus_muts::Mutation>, Vec<consensus_muts::Mutation>, Vec<protocol::ExecutionReceipt>, [u8; 32], [u8; 32]) {
165161
let cf_h = db.cf_handle("contractstate").unwrap();
166162
let cf2_h = db.cf_handle("contractstate").unwrap();
167163
let cf_tree_h = db.cf_handle("contractstate_tree").unwrap();
164+
165+
let entry_signer = entry.header.signer.as_slice().try_into().unwrap_or_else(|_| panic!("entry_signer_len_wrong"));
166+
let entry_prev_hash = entry.header.prev_hash.as_slice().try_into().unwrap_or_else(|_| panic!("entry_prev_hash_len_wrong"));
167+
let entry_vr = entry.header.vr.as_slice().try_into().unwrap_or_else(|_| panic!("entry_vr_len_wrong"));
168+
let entry_vr_b3_binding = blake3::hash(&entry.header.vr);
169+
let entry_vr_b3 = entry_vr_b3_binding.as_bytes().try_into().unwrap_or_else(|_| panic!("entry_vr_len_wrong"));
170+
let entry_dr = entry.header.dr.as_slice().try_into().unwrap_or_else(|_| panic!("entry_dr_len_wrong"));
171+
172+
173+
let entry_epoch = entry.header.height / 100_000;
168174
let mut applyenv = make_apply_env(db, txn, cf_h, b"contractstate".to_vec(), cf2_h, cf_tree_h,
169-
entry_signer, entry_prev_hash, entry_slot, entry_prev_slot, entry_height, entry_epoch, entry_vr, entry_vr_b3, entry_dr,
175+
entry_signer, entry_prev_hash, entry.header.slot, entry.header.prev_slot, entry.header.height,
176+
entry_epoch, entry_vr, entry_vr_b3, entry_dr,
170177
testnet, testnet_peddlebikes);
171178

172-
call_txs_pre_upfront_cost(&mut applyenv, &txus);
179+
call_txs_pre_upfront_cost(&mut applyenv, &entry.txs);
173180

174-
for (i, txu) in txus.clone().into_iter().enumerate() {
175-
let tx_hash = crate::fixed::<32>(txu.map_get(crate::atoms::hash()).unwrap()).unwrap();
176-
let tx = txu.map_get(crate::atoms::tx()).unwrap();
177-
let tx_signer = crate::fixed::<48>(tx.map_get(crate::atoms::signer()).unwrap()).unwrap();
178-
let tx_nonce = tx.map_get(crate::atoms::nonce()).unwrap().decode::<u64>().unwrap();
179-
let action = tx.map_get(crate::atoms::action()).unwrap().decode::<rustler::Term<'a>>().unwrap();
181+
for (i, txu) in entry.txs.clone().into_iter().enumerate() {
182+
let tx_historical_cost = crate::consensus::bic::protocol::tx_historical_cost(&txu);
183+
184+
let tx_hash = txu.hash.as_slice().try_into().unwrap_or_else(|_| panic!("tx_hash_len_wrong"));
185+
let tx_signer = txu.tx.signer.as_slice().try_into().unwrap_or_else(|_| panic!("tx_signer_len_wrong"));
186+
let tx_nonce = txu.tx.nonce;
187+
let action = txu.tx.action;
180188

181189
applyenv.caller_env.tx_index = i as u64;
182190
applyenv.caller_env.tx_hash = tx_hash;
@@ -186,24 +194,11 @@ pub fn apply_entry<'db, 'a>(db: &'db TransactionDB<MultiThreaded>, pk: &[u8], sk
186194
applyenv.caller_env.account_caller = tx_signer.to_vec();
187195

188196
//let op = action.map_get(crate::atoms::op()).unwrap().decode::<rustler::Binary>().unwrap().as_slice();
189-
let contract = action.map_get(crate::atoms::contract()).unwrap().decode::<rustler::Binary>().unwrap().to_vec();
190-
let function = action.map_get(crate::atoms::function()).unwrap().decode::<rustler::Binary>().unwrap().to_vec();
191-
192-
let args = action.map_get(crate::atoms::args()).unwrap().decode::<Vec<rustler::Binary>>().unwrap().into_iter().map(|b| b.as_slice().to_vec()).collect();
193-
let attached_symbol = match action.map_get(crate::atoms::attached_symbol()).ok() {
194-
None => None,
195-
Some(t) => match t.decode::<Option<rustler::Binary>>().ok().flatten() {
196-
None => None,
197-
Some(bin) => Some(bin.as_slice().to_vec()),
198-
},
199-
};
200-
let attached_amount = match action.map_get(crate::atoms::attached_amount()).ok() {
201-
None => None,
202-
Some(t) => match t.decode::<Option<rustler::Binary>>().ok().flatten() {
203-
None => None,
204-
Some(bin) => Some(bin.as_slice().to_vec()),
205-
},
206-
};
197+
let contract = action.contract;
198+
let function = action.function;
199+
let args = action.args;
200+
let attached_symbol = action.attached_symbol.clone();
201+
let attached_amount = action.attached_amount.clone();
207202

208203
applyenv.caller_env.account_current = contract.to_vec();
209204
applyenv.muts = Vec::new();
@@ -234,7 +229,6 @@ pub fn apply_entry<'db, 'a>(db: &'db TransactionDB<MultiThreaded>, pk: &[u8], sk
234229

235230
applyenv.exec_track = false;
236231

237-
let tx_historical_cost = txu.map_get(crate::atoms::tx_historical_cost()).unwrap().decode::<i128>().unwrap();
238232
let exec_cost_total = ((tx_historical_cost + (applyenv.exec_max - applyenv.exec_left) + (applyenv.storage_max - applyenv.storage_left)) as u64).to_string();
239233

240234
match res {
@@ -318,7 +312,7 @@ pub fn apply_entry<'db, 'a>(db: &'db TransactionDB<MultiThreaded>, pk: &[u8], sk
318312

319313
call_exit(&mut applyenv);
320314

321-
let root_receipts = root_receipts(txus.clone(), applyenv.result_log.clone());
315+
let root_receipts = root_receipts(entry.txs.clone(), applyenv.result_log.clone());
322316
let root_contractstate = update_and_root_contractstate(&mut applyenv);
323317

324318
//println!("r{:?} {}", applyenv.caller_env.entry_height, root_receipts(txus.clone(), applyenv.result_log.clone()).iter().map(|b| format!("{:02x}", b)).collect::<String>() );
@@ -376,15 +370,15 @@ fn update_and_root_contractstate(applyenv: &mut ApplyEnv) -> [u8; 32] {
376370
root_contractstate
377371
}
378372

379-
fn root_receipts(txus: Vec<rustler::Term>, result_log: Vec<HashMap<String, String>>) -> [u8; 32] {
373+
fn root_receipts(txus: Vec<crate::model::tx::TXU>, result_log: Vec<HashMap<String, String>>) -> [u8; 32] {
380374
use sha2::{Sha256, Digest};
381375
let mut hubt = bintree::Hubt::new();
382376
let mut kvs = Vec::new();
383377

384378
let count = txus.len();
385379

386380
for (txu, log) in txus.into_iter().zip(result_log.into_iter()) {
387-
let tx_hash = crate::fixed::<32>(txu.map_get(crate::atoms::hash()).unwrap()).unwrap();
381+
let tx_hash = txu.hash;
388382

389383
let error = log.get("error")
390384
.expect("no_error_key_in_receipt")
@@ -476,27 +470,22 @@ fn refund_exec_storage_deposit(applyenv: &mut ApplyEnv) {
476470
applyenv.muts_final_rev.append(&mut applyenv.muts_rev);
477471
}
478472

479-
fn call_txs_pre_upfront_cost<'a>(env: &mut ApplyEnv, txus: &[rustler::Term<'a>]) {
473+
fn call_txs_pre_upfront_cost<'a>(env: &mut ApplyEnv, txus: &[crate::model::tx::TXU]) {
480474
env.muts = Vec::new();
481475
env.muts_rev = Vec::new();
482476
for txu in txus {
483-
let tx_hash = crate::fixed::<32>(txu.map_get(crate::atoms::hash()).unwrap()).unwrap();
484-
let tx = txu.map_get(crate::atoms::tx()).unwrap();
485-
let tx_signer = crate::fixed::<48>(tx.map_get(crate::atoms::signer()).unwrap()).unwrap();
486-
let tx_nonce = tx.map_get(crate::atoms::nonce()).unwrap().decode::<u64>().unwrap();
477+
let tx_hash = txu.hash.as_slice().try_into().unwrap_or_else(|_| panic!("tx_hash_len_wrong"));
478+
let tx_signer = txu.tx.signer.as_slice().try_into().unwrap_or_else(|_| panic!("tx_signer_len_wrong"));
479+
let tx_nonce = txu.tx.nonce;
487480

488481
set_apply_env_tx(env, &tx_hash, &tx_signer, tx_nonce);
489482

490483
// Update nonce
491484
consensus_kv::kv_put(env, &crate::bcat(&[b"account:", &tx_signer, b":attribute:nonce"]), &tx_nonce.to_string().into_bytes());
492485

493486
// Deduct tx historical cost
494-
let tx_historical_cost = txu.map_get(crate::atoms::tx_historical_cost()).unwrap().decode::<i128>().unwrap();
487+
let tx_historical_cost = crate::consensus::bic::protocol::tx_historical_cost(txu);
495488
protocol::pay_cost(env, tx_historical_cost);
496-
// Deduct fixed call costs
497-
let action = tx.map_get(crate::atoms::action()).unwrap().decode::<rustler::Term<'a>>().unwrap();
498-
let contract = action.map_get(crate::atoms::contract()).unwrap().decode::<rustler::Binary>().unwrap().to_vec();
499-
let function = action.map_get(crate::atoms::function()).unwrap().decode::<rustler::Binary>().unwrap().to_vec();
500489

501490
//lock 0.1 AMA during execution
502491
consensus_kv::kv_increment(env, &crate::bcat(&[b"account:", &env.caller_env.account_origin, b":balance:AMA"]), -protocol::AMA_10_CENT);
@@ -634,7 +623,6 @@ fn migrate_db(env: &mut ApplyEnv) {
634623
}
635624
}
636625

637-
638626
pub fn valid_bic_action(contract: Vec<u8>, function: Vec<u8>) -> bool {
639627
let c = contract.as_slice();
640628
let f = function.as_slice();

ex/native/rdb/src/lib.rs

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -675,26 +675,17 @@ pub fn fixed<const N: usize>(t: Term<'_>) -> Result<[u8; N], Error> {
675675
}
676676

677677
#[rustler::nif(schedule = "DirtyCpu")]
678-
fn apply_entry<'a>(env: Env<'a>, db: ResourceArc<DbResource>, next_entry_trimmed_map: Term<'a>, pk: Binary, sk: Binary, txus: Vec<Term<'a>>,
679-
testnet: bool, testnet_peddlebikes: Vec<Binary>) -> Result<Term<'a>, Error> {
680-
let entry_signer = fixed::<48>(next_entry_trimmed_map.map_get(atoms::entry_signer())?)?;
681-
let entry_prev_hash = fixed::<32>(next_entry_trimmed_map.map_get(atoms::entry_prev_hash())?)?;
682-
let entry_vr = fixed::<96>(next_entry_trimmed_map.map_get(atoms::entry_vr())?)?;
683-
let entry_vr_b3 = fixed::<32>(next_entry_trimmed_map.map_get(atoms::entry_vr_b3())?)?;
684-
let entry_dr = fixed::<32>(next_entry_trimmed_map.map_get(atoms::entry_dr())?)?;
685-
686-
let entry_slot = next_entry_trimmed_map.map_get(atoms::entry_slot())?.decode::<u64>()?;
687-
let entry_prev_slot = next_entry_trimmed_map.map_get(atoms::entry_prev_slot())?.decode::<u64>()?;
688-
let entry_height = next_entry_trimmed_map.map_get(atoms::entry_height())?.decode::<u64>()?;
689-
let entry_epoch = next_entry_trimmed_map.map_get(atoms::entry_epoch())?.decode::<u64>()?;
678+
fn apply_entry<'a>(env: Env<'a>, db: ResourceArc<DbResource>, entry_vecpak: Binary, pk: Binary, sk: Binary,
679+
testnet: bool, testnet_peddlebikes: Vec<Binary>) -> Result<Term<'a>, Error>
680+
{
681+
let entry = crate::model::entry::from_bytes(entry_vecpak.as_slice()).map_err(|_| Error::BadArg)?;
690682

691683
let txn_opts = TransactionOptions::default();
692684
let write_opts = WriteOptions::default();
693685
let txn = db.db.transaction_opt(&write_opts, &txn_opts);
694686

695-
let (txn, muts, muts_rev, result_log, receipts, root_receipts, root_contractstate) =
696-
consensus::consensus_apply::apply_entry(&db.db, pk.as_slice(), sk.as_slice(), &entry_signer, &entry_prev_hash,
697-
entry_slot, entry_prev_slot, entry_height, entry_epoch, &entry_vr, &entry_vr_b3, &entry_dr, txus, txn,
687+
let (txn, muts, muts_rev, receipts, root_receipts, root_contractstate) =
688+
consensus::consensus_apply::apply_entry(&db.db, txn, entry, pk.as_slice(), sk.as_slice(),
698689
testnet, testnet_peddlebikes.iter().map(|bin| bin.as_slice().to_vec()).collect()
699690
);
700691

@@ -723,7 +714,7 @@ fn apply_entry<'a>(env: Env<'a>, db: ResourceArc<DbResource>, next_entry_trimmed
723714
receipts_list.push(map);
724715
}
725716

726-
Ok((term_txn, consensus_muts::mutations_to_map(muts), consensus_muts::mutations_to_map(muts_rev), result_log, receipts_list,
717+
Ok((term_txn, consensus_muts::mutations_to_map(muts), consensus_muts::mutations_to_map(muts_rev), receipts_list,
727718
Binary::from_owned(ob1, env).encode(env), Binary::from_owned(ob2, env).encode(env)).encode(env))
728719
}
729720

@@ -957,7 +948,6 @@ fn contract_view<'a>(env: Env<'a>, db: ResourceArc<DbResource>, cur_entry_trimme
957948
fn protocol_constants<'a>(env: Env<'a>) -> Term<'a> {
958949
let mut map = Term::map_new(env);
959950

960-
961951
map = map.map_put(atoms::forkheight(), protocol::FORKHEIGHT).ok().unwrap();
962952

963953
map = map.map_put(atoms::ama_1_dollar(), protocol::AMA_1_DOLLAR).ok().unwrap();

0 commit comments

Comments
 (0)