Skip to content
This repository was archived by the owner on Jul 5, 2024. It is now read-only.
This repository was archived by the owner on Jul 5, 2024. It is now read-only.

MPT extension node turns into branch issue detected by light client #1738

Open
@miha-stopar

Description

@miha-stopar

What command(s) is the bug in?

No response

Describe the bug

Mainnet test with block 18363441 fails with

panic: runtime error: index out of range [35] with length 35

goroutine 17 [running, locked to thread]:
github.com/privacy-scaling-explorations/mpt-witness-generator/witness.getDriftedPosition({0x14005112ed0, 0x23, 0x2?}, 0x0)

The issue is there is an extension node
[226 29 160 217 96 198 67 216 20 103 173 8 242 218 197 154 41 240 104 151 164 226 76 167 89 156 221 241 114 184 233 63 208 17 10]
in the S proof, which gets replaced by a branch
[248 81 128 128 128 128 128 128 128 128 128 128 128 128 128 160 217 96 198 67 216 20 103 173 8 242 218 197 154 41 240 104 151 164 226 76 167 89 156 221 241 114 184 233 63 208 17 10 160 141 70 158 90 135 150 17 215 30 146 98 157 197 214 148 52 70 144 37 56 64 111 28 57 252 62 114 96 129 79 37 127 128 128]. This branch contains the above mentioned extension node and a leaf. The issue appears when getDriftedPosition tries to compute the drifted position out of the extension node.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

🏗 In progress

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions