-
Notifications
You must be signed in to change notification settings - Fork 202
Remove scheduled transactions feature flag #8142
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
Open
devbugging
wants to merge
14
commits into
onflow:master
Choose a base branch
from
devbugging:gregor/remove-feature-flag-scheduled-tx
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
56a3ced
deprecate flags
devbugging 3db3547
remove logic relying on scheduled tx dissabled
devbugging 361d3c5
default fvm option fix
devbugging a0a0041
default options fix
devbugging 0ae8b7f
Merge branch 'master' into gregor/remove-feature-flag-scheduled-tx
devbugging 47e9175
remove nil check
devbugging 28b46f0
Merge branch 'gregor/remove-feature-flag-scheduled-tx' of https://git…
devbugging 9ce46bc
update test to include scheduled tx
devbugging c15b3a1
Merge branch 'master' into gregor/remove-feature-flag-scheduled-tx
devbugging 512118d
Merge branch 'gregor/remove-feature-flag-scheduled-tx' of https://git…
devbugging 635bffe
fix missing change
devbugging a31efc1
Merge branch 'master' into gregor/remove-feature-flag-scheduled-tx
devbugging 2859a74
fix block executor tests for scheduled transactions always enabled
devbugging 03fc4d0
add scheduled txs storage
devbugging File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,58 +59,54 @@ type Transactions struct { | |
| txStatusDeriver *txstatus.TxStatusDeriver | ||
| systemCollections *systemcollection.Versioned | ||
| txResultCache TxResultCache | ||
|
|
||
| scheduledTransactionsEnabled bool | ||
| } | ||
|
|
||
| var _ access.TransactionsAPI = (*Transactions)(nil) | ||
|
|
||
| type Params struct { | ||
| Log zerolog.Logger | ||
| Metrics module.TransactionMetrics | ||
| State protocol.State | ||
| ChainID flow.ChainID | ||
| SystemCollections *systemcollection.Versioned | ||
| StaticCollectionRPCClient accessproto.AccessAPIClient | ||
| HistoricalAccessNodeClients []accessproto.AccessAPIClient | ||
| NodeCommunicator node_communicator.Communicator | ||
| ConnFactory connection.ConnectionFactory | ||
| EnableRetries bool | ||
| NodeProvider *rpc.ExecutionNodeIdentitiesProvider | ||
| Blocks storage.Blocks | ||
| Collections storage.Collections | ||
| Transactions storage.Transactions | ||
| ScheduledTransactions storage.ScheduledTransactionsReader | ||
| TxErrorMessageProvider error_messages.Provider | ||
| TxResultCache TxResultCache | ||
| TxProvider provider.TransactionProvider | ||
| TxValidator *validator.TransactionValidator | ||
| TxStatusDeriver *txstatus.TxStatusDeriver | ||
| EventsIndex *index.EventsIndex | ||
| TxResultsIndex *index.TransactionResultsIndex | ||
| ScheduledTransactionsEnabled bool | ||
| Log zerolog.Logger | ||
| Metrics module.TransactionMetrics | ||
| State protocol.State | ||
| ChainID flow.ChainID | ||
| SystemCollections *systemcollection.Versioned | ||
| StaticCollectionRPCClient accessproto.AccessAPIClient | ||
| HistoricalAccessNodeClients []accessproto.AccessAPIClient | ||
| NodeCommunicator node_communicator.Communicator | ||
| ConnFactory connection.ConnectionFactory | ||
| EnableRetries bool | ||
| NodeProvider *rpc.ExecutionNodeIdentitiesProvider | ||
| Blocks storage.Blocks | ||
| Collections storage.Collections | ||
| Transactions storage.Transactions | ||
| ScheduledTransactions storage.ScheduledTransactionsReader | ||
| TxErrorMessageProvider error_messages.Provider | ||
| TxResultCache TxResultCache | ||
| TxProvider provider.TransactionProvider | ||
| TxValidator *validator.TransactionValidator | ||
| TxStatusDeriver *txstatus.TxStatusDeriver | ||
| EventsIndex *index.EventsIndex | ||
| TxResultsIndex *index.TransactionResultsIndex | ||
| } | ||
|
|
||
| func NewTransactionsBackend(params Params) (*Transactions, error) { | ||
| txs := &Transactions{ | ||
| log: params.Log, | ||
| metrics: params.Metrics, | ||
| state: params.State, | ||
| chainID: params.ChainID, | ||
| systemCollections: params.SystemCollections, | ||
| collectionRPCClient: params.StaticCollectionRPCClient, | ||
| historicalAccessNodeClients: params.HistoricalAccessNodeClients, | ||
| nodeCommunicator: params.NodeCommunicator, | ||
| connectionFactory: params.ConnFactory, | ||
| blocks: params.Blocks, | ||
| collections: params.Collections, | ||
| transactions: params.Transactions, | ||
| scheduledTransactions: params.ScheduledTransactions, | ||
| txResultCache: params.TxResultCache, | ||
| txValidator: params.TxValidator, | ||
| txProvider: params.TxProvider, | ||
| txStatusDeriver: params.TxStatusDeriver, | ||
| scheduledTransactionsEnabled: params.ScheduledTransactionsEnabled, | ||
| log: params.Log, | ||
| metrics: params.Metrics, | ||
| state: params.State, | ||
| chainID: params.ChainID, | ||
| systemCollections: params.SystemCollections, | ||
| collectionRPCClient: params.StaticCollectionRPCClient, | ||
| historicalAccessNodeClients: params.HistoricalAccessNodeClients, | ||
| nodeCommunicator: params.NodeCommunicator, | ||
| connectionFactory: params.ConnFactory, | ||
| blocks: params.Blocks, | ||
| collections: params.Collections, | ||
| transactions: params.Transactions, | ||
| scheduledTransactions: params.ScheduledTransactions, | ||
| txResultCache: params.TxResultCache, | ||
| txValidator: params.TxValidator, | ||
| txProvider: params.TxProvider, | ||
| txStatusDeriver: params.TxStatusDeriver, | ||
| } | ||
|
|
||
| return txs, nil | ||
|
|
@@ -255,15 +251,12 @@ func (t *Transactions) GetTransaction(ctx context.Context, txID flow.Identifier) | |
| } | ||
|
|
||
| // check if it's a scheduled transaction | ||
| if t.scheduledTransactions != nil { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is still needed. we only index scheduled tx when execution state indexing is also enabled |
||
| tx, isScheduledTx, err := t.lookupScheduledTransaction(ctx, txID) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
| if isScheduledTx { | ||
| return tx, nil | ||
| } | ||
| // else, this is not a system collection tx. continue with the normal lookup | ||
| tx, isScheduledTx, err := t.lookupScheduledTransaction(ctx, txID) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
| if isScheduledTx { | ||
| return tx, nil | ||
| } | ||
|
|
||
| // otherwise, check if it's a historic transaction | ||
|
|
@@ -350,16 +343,12 @@ func (t *Transactions) GetTransactionResult( | |
| return txResult, nil | ||
| } | ||
|
|
||
| // if the node is not indexing scheduled transactions, then fallback to the normal lookup. if the | ||
| // request was for a scheduled transaction, it will fail with a not found error. | ||
| if t.scheduledTransactions != nil { | ||
| txResult, isScheduledTx, err := t.lookupScheduledTransactionResult(ctx, txID, blockID, encodingVersion) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
| if isScheduledTx { | ||
| return txResult, nil | ||
| } | ||
| txResult, isScheduledTx, err := t.lookupScheduledTransactionResult(ctx, txID, blockID, encodingVersion) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
| if isScheduledTx { | ||
| return txResult, nil | ||
| } | ||
|
|
||
| txResult, tx, err := t.lookupSubmittedTransactionResult(ctx, txID, blockID, collectionID, encodingVersion) | ||
|
|
@@ -715,12 +704,6 @@ func (t *Transactions) GetSystemTransactionResult( | |
| // Expected error returns during normal operation: | ||
| // - [codes.NotFound]: if the scheduled transaction is not found | ||
| func (t *Transactions) GetScheduledTransaction(ctx context.Context, scheduledTxID uint64) (*flow.TransactionBody, error) { | ||
| // The scheduled transactions index is only written if execution state indexing is enabled. | ||
| // Note: it's possible indexing is enabled and requests are still served from execution nodes. | ||
| if t.scheduledTransactions == nil { | ||
| return nil, status.Errorf(codes.Unimplemented, "scheduled transactions endpoints require execution state indexing.") | ||
| } | ||
|
|
||
| txID, err := t.scheduledTransactions.TransactionIDByID(scheduledTxID) | ||
| if err != nil { | ||
| return nil, rpc.ConvertStorageError(err) | ||
|
|
@@ -746,12 +729,6 @@ func (t *Transactions) GetScheduledTransaction(ctx context.Context, scheduledTxI | |
| // Expected error returns during normal operation: | ||
| // - [codes.NotFound]: if the scheduled transaction is not found | ||
| func (t *Transactions) GetScheduledTransactionResult(ctx context.Context, scheduledTxID uint64, encodingVersion entities.EventEncodingVersion) (*accessmodel.TransactionResult, error) { | ||
| // The scheduled transactions index is only written if execution state indexing is enabled. | ||
| // Note: it's possible indexing is enabled and requests are still served from execution nodes. | ||
| if t.scheduledTransactions == nil { | ||
| return nil, status.Errorf(codes.Unimplemented, "scheduled transactions endpoints require execution state indexing.") | ||
| } | ||
|
|
||
| txID, err := t.scheduledTransactions.TransactionIDByID(scheduledTxID) | ||
| if err != nil { | ||
| return nil, rpc.ConvertStorageError(err) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this may still be nil if indexing is not enabled