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

Handle event signatures consistently #251

Merged
merged 5 commits into from
May 24, 2018

Conversation

garious
Copy link
Contributor

@garious garious commented May 23, 2018

Currently we have an Event enum type that is either a Transaction or a Witness that a previously submitted smart contract is waiting on. In each field (Transaction, Timestamp, Signature), we see duplicate information, a from PublicKey and a sig Signature, but those signatures are not handled consistently by the SigVerifyStage or the BankingStage. Rather than handling those individually, as well as each new Event type that we add, we need the top-level data type to be a struct containing the PublicKey, Signature, and the signed data. This PR gets most of the way there by reducing Event to an enum with a single field, Transaction, and then replacing Transaction's contract field with a new instruction field containing a new Instruction enum with fields for spinning up a smart contract or applying a witness. It means that Transaction now has a clear definition, "an atomic client-defined set of instructions," and one that is consistent with both Distributed Systems and Bitcoin terminology.

The next step is to remove the Event enum, which after this patchset, only exists as a shim to minimize churn. Once removed, we'll see Entries containing a list of Transactions, not a list of Events. To extend the contract language, you'll add a field to the Instruction enum, and handle it in the Bank's process_verified_transactions() method. Duplicates will automatically be discarded and you can be certain the from PublicKey was from the entity that sent the message.

Fixes #236

@garious garious added the work in progress This isn't quite right yet label May 23, 2018
@garious garious removed the work in progress This isn't quite right yet label May 24, 2018
@garious
Copy link
Contributor Author

garious commented May 24, 2018

This is as much as can be done without deleting event.rs, so would like to merge it before moving on. The next commit is more invasive and will require tweaks to the offsets.

@garious garious changed the title Add Instruction type Handle event signatures consistently May 24, 2018
@garious garious merged commit e12e154 into solana-labs:master May 24, 2018
vkomenda pushed a commit to vkomenda/solana that referenced this pull request Aug 29, 2021
Bumps [rollup](https://github.com/rollup/rollup) from 2.23.0 to 2.23.1.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](rollup/rollup@v2.23.0...v2.23.1)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
apfitzge referenced this pull request in apfitzge/agave Mar 15, 2024
…-xyz#199) (anza-xyz#251)

Add in metrics for detecting Redundant Pulls (anza-xyz#199)

(cherry picked from commit d49ceb0)

Co-authored-by: Greg Cusack <[email protected]>
willhickey pushed a commit that referenced this pull request Mar 16, 2024
#251)

Add in metrics for detecting Redundant Pulls (#199)

(cherry picked from commit d49ceb0)

Co-authored-by: Greg Cusack <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants