Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add all signers to the Transaction when serializing with ToStackItem #2460

Closed
csmuller opened this issue May 6, 2021 · 4 comments
Closed
Assignees
Labels
discussion Initial issue state - proposed but not yet accepted

Comments

@csmuller
Copy link

csmuller commented May 6, 2021

Summary or problem description
I was looking for a way to fetch the transaction signers in a contract invocation. I thought I could get them from the Transaction returned by Runtime.GetScriptContainer(), but that Transaction object only contains the hash of the sender, not of any other signers. Checking Transaction.ToStackItem() shows that the signers are explicitly left out of the returned stack item.

What's the reason for this.

Do you have any solution you want to propose?

Add all signers to the stack item returned from Transaction.ToStackItem().

Neo Version
Neo N3 RC2

@csmuller csmuller added the discussion Initial issue state - proposed but not yet accepted label May 6, 2021
@csmuller csmuller changed the title Add all signers to the Transaction when serializing in ToStackItem Add all signers to the Transaction when serializing with ToStackItem May 6, 2021
@shargon shargon self-assigned this May 6, 2021
@erikzhang
Copy link
Member

Why do you need to fetch the signers? I think we should use CheckWitness.

@PaschaC420
Copy link

Zusammenfassung oder Problembeschreibung
Ich suchte nach einer Möglichkeit, die Transaktionsunterzeichner in einem Vertragsaufruf abzurufen. Ich dachte, ich könnte sie von der zurückgegebenen erhalten, aber dieses Objekt enthält nur den Hash des Absenders, nicht von anderen Unterzeichnern. Die Überprüfung zeigt, dass die Unterzeichner explizit aus dem zurückgegebenen Stapelelement ausgeschlossen werden.Transaction``Runtime.GetScriptContainer()``Transaction``Transaction.ToStackItem()

Was ist der Grund dafür.

Haben Sie eine Lösung, die Sie vorschlagen möchten?

Fügen Sie dem Stapelelement, das von zurückgegeben wird, alle Unterzeichner hinzu.Transaction.ToStackItem()

Neo Version
Neo N3 RC2

@roman-khimov
Copy link
Contributor

I'd say that this asymmetry contributes a lot to the fact that people just don't understand that there can be multiple signers in each transaction. And they're also missing scopes completely. So they see this "transaction" (but really just a part of it) returned by Runtime.GetScriptContainer() and assume that Sender is somehow magic like he's the one who does the action and approves anything in this transaction (as with Global witness scope). Almost like in some other blockchains.

Although of course people must use CheckWitness to do things right it'd still be nice to fix it and allow to see transaction with full details inside the contract.

@erikzhang
Copy link
Member

Fixed by #2685

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Initial issue state - proposed but not yet accepted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants