ChainSafe / ChainSafe/discv5

[Error] Offset is outside the bounds of the DataView

Open
#257 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
31
Forks
21
PR merge metrics
No merged PRs in 30d

Description

I am getting the following error while Decode this Payload:

` ENR.decodeTxt("T1WJc2VjcDI1NmsxoQJbQ9BY7wgWhlf7QvAS0iJWw5L30RQyN8bSQ15Car-v0YRzbmFwwIN0Y3Bfg3VkcF8")`

Fail here:

```
export function getProtocolValue(kvs, key) {
const raw = kvs.get(key);
if (raw) {
const view = new DataView(raw.buffer, raw.byteOffset, raw.byteLength);
return view.getUint16(0);
}
else {
return undefined;
}
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at ENR.decodeTxt(...) and the getProtocolValue(kvs, key) entry point shown in the report, then reproduce the supplied payload decode to inspect the failing DataView access. Done means the reported payload decodes without the offset error and the regression is covered by an appropriate test.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.