-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bitcoin-move][breaking]Refactor ordinals inscription updater #2500
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Manifest Files |
e786010
to
2533dda
Compare
//let input = vector::borrow(txinput, input_idx); | ||
let utxo = vector::borrow_mut(input_utxos, input_idx); | ||
if (is_coinbase){ | ||
total_input_value = total_input_value + ord::subsidy_by_height(block_height); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果是 coinbase 交易,应该在累加 total_input_value后continue,继续循环执行,对应的 utxo为 null utxo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修复了
new: option::some(FlotsamNew{ | ||
cursed: option::is_some(&curse) && !jubilant, | ||
fee: 0, | ||
//TODO should we handle the hidden |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hidden 字段和home_inscription没有特别看明白,不过看inscriptions_updater.rs实现,貌似对offset没有影响
let output = vector::borrow(txoutput, output_idx); | ||
let value = types::txout_value(output); | ||
let output_script_buf = types::txout_script_pubkey(output); | ||
let is_op_return = script_buf::is_op_return(output_script_buf); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ordinal原始实现里没有处理 op_return
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
最新的代码里有了。
break | ||
}; | ||
|
||
let new_satpoint = ord::new_satpoint(types::new_outpoint(txid, (output_idx as u32)), flotsam.offset - output_value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new_satpoint的计算比较复杂,看了几遍,总觉得跟 ordinal 实现有差异,需要测试用例覆盖
f8c4e69
to
45857ee
Compare
sequence_number: src.sequence_number, | ||
inscription_number: src.inscription_number.unsigned_abs(), | ||
is_curse: src.inscription_number.is_negative(), | ||
//TODO how to get charms |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For statedb/genesis: could export charms from ordinal index
@@ -136,6 +143,9 @@ pub(crate) fn create_genesis_inscription_store_object( | |||
let inscription_store = InscriptionStore { | |||
cursed_inscription_count, | |||
blessed_inscription_count, | |||
//TODO set unbound_inscription_count and lost_sats | |||
unbound_inscription_count: 0, | |||
lost_sats: 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For statedb/genesis: count lost_sats by charm flag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ordinals has a statistic_to_count db to get the counts https://github.com/ordinals/ord/blob/75bf04b22107155f8f8ab6c77f6eefa8117d9ace/src/index/updater.rs#L604-L626
Summary
copy
anddrop
to SimpleMap and SimpleMultiMap.part of #2402 and #2403