Todas as lições · Rust scripts and ckb-std · Começa aqui · Glossário
Raw cell_deps indexes match Source::CellDep only before the first dep groupAvançadoDe uma correção
De uma correção · Verificação: em parte certa · Verificada em 2026-11-19
When a script reads the raw transaction's cell_deps (via load_transaction) and uses a position there as a Source::CellDep index for load_cell_type_hash or load_cell_data, the mapping holds only for the leading run of dep_type code entries, because dep groups expand into their member cells and shift later indexes. This vote script restricts its proposal and deposit lookups to that direct prefix and lets wallet dep groups follow it.
Porque importa: Once a dep group sits before the wanted dep, a raw cell_deps position reads a different resolved cell, so the script checks the wrong proposal or deposit data, or fails.
Padrão
.take_while(|dep| dep.dep_type().as_slice() == [0])Tirado do commit, encurtado.
Um teste mudou no mesmo commit
Está ao lado da correcção. Nós não o corremos.
- CellScript-Labs/AgoraSeal:
crates/protocol/tests/reference_vote_vm.rs,crates/protocol/tests/replay.rs,crates/protocol/tests/treasury_vm.rs
- Conceitos
- Cell deps and script lookup
- Evidência
- De uma correção: de um projeto, verificada contra o commit
- Vista pela primeira vez
- 2026-10-07
- Última mudança
- 2026-10-07
- Última verificação
- 2026-11-19
- Verificação contra o commit
- em parte certa: um núcleo verdadeiro, com uma parte solta ou demasiado larga
Fontes (1)
- 2026-10-07 · CellScript-Labs/AgoraSeal · mais deste projeto
Mais sobre Rust scripts and ckb-std
- Check that a derived successor type args match the spent cell's type args
- Delegating script validation via exec to a hash bound cell dep
- Iterating group inputs and outputs with ckb-std until IndexOutOfBound
Manténs um projeto de onde esta lição veio? Confirma ou corrige
Citar esta lição
LusoCryptoLabs, "Raw cell_deps indexes match Source::CellDep only before the first dep group", CKB lessons, https://pulse.lusocryptolabs.com/learned/scripts/raw-cell-deps-indexes-match-source-celldep-only-before-the-f, CC BY 4.0, last changed 2026-10-07.