Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

UPLC: Flat decoding accepts a byte string whose filler ends mid-byte

Abierto Apto para principiantes
#694 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
79/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
typescript
Área
backend

Línea de trabajo

Empieza en UPLC.ts, en decodeByteString (línea 510) y _skipByte (línea 461), y luego compara la comprobación del límite de byte descrita en Plutus Decoder/Prim.hs (línea 443). Haz que la decodificación lance un UPLCError cuando el relleno termine a mitad de un byte; comprueba que se rechace la entrada hexadecimal indicada mientras que las cadenas de bytes válidas sigan decodificándose.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug

UPLC.fromFlatHex("01010048a0354001") decodes to the byte string constant aa, and UPLC.toFlatHex writes it back as 010100488101aa0001. Plutus rejects the input.

In those bytes, the type list ends at bit 2 of the byte a0. The filler before the byte string is a single 1 bit, so it ends at bit 3 of that byte, and the chunk length and data that follow start mid-byte. decodeByteString (UPLC.ts:510) calls _skipByte (UPLC.ts:461), which reads bits until a 1 and never checks that it stopped on a byte boundary, then reads the chunks unaligned. Plutus reads the same filler (dFiller, PlutusCore/Flat/Decoder/Strict.hs:301-304) and then fails in getChunksInfo unless the position is byte aligned (Decoder/Prim.hs:443, badEncoding endPtr s "usedBits /= 0", at plutus 1.72.0.0).

Every byte string goes through this path: ByteString, String and Data constants, and with #667 the keys of Value constants. Only hand-made or corrupted input triggers it, and the ledger rejects such a script. The effect is that decoding and re-encoding changes the script bytes, and so its hash, where it should fail.

decodeByteString should throw a UPLCError when the filler does not end on a byte boundary.

Lenguaje dominante
TypeScript
Estrellas
22
Forks
35
Merge medio
19 h 56 min
PR fusionados (30 d)
58

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de IntersectMBO/evolution-sdk

Todos los issues de IntersectMBO/evolution-sdk

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.