oasisprotocol / oasisprotocol/oasis-core

nit: does EmitTag contract include not emitting a tag with a key that is already in the tags slice?

Open
#2,164 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
369
Forks
151
Avg merge
1d 3h
Merged PRs (30d)
6

Description

Description of the bug

nit: EmitTag should either be documented as requiring as pre-condition that the key argument not already be in the c.tags slice, or enforce uniqueness and generate an error

https://github.com/oasislabs/ekiden/blob/221f43394d4469bd71ab72302feec15f67c0944e/go/tendermint/abci/context.go#L86

EmitTag paired with GetTag feel inconsistent: one can emit duplicate tag entries, and not be able to find any but the first entry.

Steps to reproduce
1.

Expected behavior

Either EmitTag includes as pre-condition that keys are unique in the history of key/value pairs entered as tags to a context, or GetTag should have the ability to find all tag entries with a given key rather than just the first entry.

Environment

  • OS:
  • Versions of relevant software and tools:

Additional information
Anything else you think would be useful; including context and suggested fixes.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read go/tendermint/abci/context.go at the linked EmitTag implementation, then compare its behavior with GetTag. Determine which tag-key contract the API should document or enforce, and verify that the chosen behavior consistently handles repeated keys.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
blockchain
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.