Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

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 force-pushed the add-instruction branch from 5e0238e to cf4e271 Compare May 23, 2018 23:25
@garious garious force-pushed the add-instruction branch from cf4e271 to aecb620 Compare May 24, 2018 02:12
@garious garious removed the work in progress This isn't quite right yet label May 24, 2018
@garious garious requested review from aeyakovenko and sakridge May 24, 2018 06:24
@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] <support@github.com>

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 <greg.cusack@anza.xyz>
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 <greg.cusack@anza.xyz>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants