Skip to content

Commit c9ae1e5

Browse files
authored
Merge branch 'master' into bastian/document-new-features
2 parents 97a6458 + 87ce7fb commit c9ae1e5

File tree

22 files changed

+1006
-448
lines changed

22 files changed

+1006
-448
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ on:
1717
- "release/**"
1818

1919
env:
20-
GO_VERSION: 1.25
20+
GO_VERSION: 1.25
2121

2222
jobs:
2323
test:
2424
name: "Test"
2525
runs-on: ubuntu-latest
2626
steps:
27-
- uses: actions/checkout@v5
27+
- uses: actions/checkout@v6
2828
with:
2929
fetch-depth: 0
3030
- uses: actions/setup-go@v6
@@ -47,12 +47,12 @@ jobs:
4747
name: "Lint"
4848
runs-on: ubuntu-latest
4949
steps:
50-
- uses: actions/checkout@v5
50+
- uses: actions/checkout@v6
5151
- uses: actions/setup-go@v6
5252
with:
5353
go-version: ${{ env.GO_VERSION }}
5454
- name: Run golangci-lint
55-
uses: golangci/golangci-lint-action@v8
55+
uses: golangci/golangci-lint-action@v9
5656
with:
5757
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
5858
version: v2.4
@@ -94,7 +94,7 @@ jobs:
9494
${{ runner.os }}-buildx-
9595
9696
- name: Checkout
97-
uses: actions/checkout@v5
97+
uses: actions/checkout@v6
9898

9999
- name: Login to GCR
100100
uses: docker/login-action@v2

.github/workflows/sync-labels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
build:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v5
14+
- uses: actions/checkout@v6
1515
- uses: micnncim/action-label-syncer@v1
1616
env:
1717
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 43 additions & 41 deletions
Large diffs are not rendered by default.

adapters/access.go

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,13 +205,31 @@ func (a *AccessAdapter) GetTransaction(_ context.Context, id flowgo.Identifier)
205205
func (a *AccessAdapter) GetTransactionResult(
206206
_ context.Context,
207207
id flowgo.Identifier,
208-
_ flowgo.Identifier,
208+
blockID flowgo.Identifier,
209209
_ flowgo.Identifier,
210210
requiredEventEncodingVersion entities.EventEncodingVersion,
211211
) (
212212
*accessmodel.TransactionResult,
213213
error,
214214
) {
215+
// If a blockID is provided, try system transaction result first
216+
if blockID != flowgo.ZeroID {
217+
if sysResult, err := a.emulator.GetSystemTransactionResult(id, blockID); err == nil {
218+
// Convert CCF events to JSON events, else return CCF encoded version
219+
if requiredEventEncodingVersion == entities.EventEncodingVersion_JSON_CDC_V0 {
220+
sysResult.Events, err = ConvertCCFEventsToJsonEvents(sysResult.Events)
221+
if err != nil {
222+
return nil, convertError(err, codes.Internal)
223+
}
224+
}
225+
a.logger.Debug().
226+
Str("txID", id.String()).
227+
Str("blockID", blockID.String()).
228+
Msg("📝 GetTransactionResult (system) called")
229+
return sysResult, nil
230+
}
231+
}
232+
215233
result, err := a.emulator.GetTransactionResult(id)
216234
if err != nil {
217235
return nil, convertError(err, codes.Internal)

cmd/emulator/start/start.go

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,10 @@ type Config struct {
6464
StorageMBPerFLOW string `flag:"storage-per-flow" info:"the MB amount of storage capacity an account has per 1 FLOW token it has. e.g. '100.0'. The default is taken from the current version of flow-go"`
6565
MinimumAccountBalance string `flag:"min-account-balance" info:"The minimum account balance of an account. This is also the cost of creating one account. e.g. '0.001'. The default is taken from the current version of flow-go"`
6666
TransactionFeesEnabled bool `default:"false" flag:"transaction-fees" info:"enable transaction fees"`
67-
TransactionMaxGasLimit int `default:"9999" flag:"transaction-max-gas-limit" info:"maximum gas limit for transactions"`
68-
ScriptGasLimit int `default:"100000" flag:"script-gas-limit" info:"gas limit for scripts"`
67+
TransactionMaxGasLimit int `default:"9999" flag:"transaction-max-gas-limit" info:"(deprecated) use --transaction-max-compute-limit"`
68+
ScriptGasLimit int `default:"100000" flag:"script-gas-limit" info:"(deprecated) use --script-compute-limit"`
69+
TransactionMaxComputeLimit int `default:"9999" flag:"transaction-max-compute-limit" info:"maximum computation limit for transactions"`
70+
ScriptComputeLimit int `default:"100000" flag:"script-compute-limit" info:"compute limit for scripts"`
6971
Contracts bool `default:"false" flag:"contracts" info:"deploy common contracts when emulator starts"`
7072
ContractRemovalEnabled bool `default:"true" flag:"contract-removal" info:"allow removal of already deployed contracts, used for updating during development"`
7173
SkipTxValidation bool `default:"false" flag:"skip-tx-validation" info:"skip verification of transaction signatures and sequence numbers"`
@@ -162,6 +164,20 @@ func Cmd(config StartConfig) *cobra.Command {
162164
conf.ForkHeight = conf.StartBlockHeight
163165
}
164166

167+
// Gas/Compute terminology deprecation
168+
if cmd.PersistentFlags().Changed("transaction-max-gas-limit") {
169+
logger.Warn().Msg("❗ --transaction-max-gas-limit is deprecated; use --transaction-max-compute-limit")
170+
if !cmd.PersistentFlags().Changed("transaction-max-compute-limit") {
171+
conf.TransactionMaxComputeLimit = conf.TransactionMaxGasLimit
172+
}
173+
}
174+
if cmd.PersistentFlags().Changed("script-gas-limit") {
175+
logger.Warn().Msg("❗ --script-gas-limit is deprecated; use --script-compute-limit")
176+
if !cmd.PersistentFlags().Changed("script-compute-limit") {
177+
conf.ScriptComputeLimit = conf.ScriptGasLimit
178+
}
179+
}
180+
165181
// In non-fork mode, fork-only flags are invalid
166182
if conf.ForkHost == "" && (conf.StartBlockHeight > 0 || conf.ForkHeight > 0) {
167183
Exit(1, "❗ --fork-height requires --fork-host")
@@ -210,8 +226,8 @@ func Cmd(config StartConfig) *cobra.Command {
210226
Snapshot: conf.Snapshot,
211227
DBPath: conf.DBPath,
212228
GenesisTokenSupply: parseCadenceUFix64(conf.TokenSupply, "token-supply"),
213-
TransactionMaxGasLimit: uint64(conf.TransactionMaxGasLimit),
214-
ScriptGasLimit: uint64(conf.ScriptGasLimit),
229+
TransactionMaxGasLimit: uint64(conf.TransactionMaxComputeLimit),
230+
ScriptGasLimit: uint64(conf.ScriptComputeLimit),
215231
TransactionExpiry: uint(conf.TransactionExpiry),
216232
StorageLimitEnabled: conf.StorageLimitEnabled,
217233
StorageMBPerFLOW: storageMBPerFLOW,
@@ -274,6 +290,10 @@ func Cmd(config StartConfig) *cobra.Command {
274290
_ = cmd.PersistentFlags().MarkDeprecated("rpc-host", "use --fork-host")
275291
_ = cmd.PersistentFlags().MarkHidden("start-block-height")
276292
_ = cmd.PersistentFlags().MarkDeprecated("start-block-height", "use --fork-height")
293+
_ = cmd.PersistentFlags().MarkHidden("transaction-max-gas-limit")
294+
_ = cmd.PersistentFlags().MarkDeprecated("transaction-max-gas-limit", "use --transaction-max-compute-limit")
295+
_ = cmd.PersistentFlags().MarkHidden("script-gas-limit")
296+
_ = cmd.PersistentFlags().MarkDeprecated("script-gas-limit", "use --script-compute-limit")
277297

278298
return cmd
279299
}

docs/overview.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,10 @@ values.
6565
| `--storage-per-flow` | `FLOW_STORAGEMBPERFLOW` | | Specify size of the storage in MB for each FLOW in account balance. Default value from the flow-go |
6666
| `--min-account-balance` | `FLOW_MINIMUMACCOUNTBALANCE` | | Specify minimum balance the account must have. Default value from the flow-go |
6767
| `--transaction-fees` | `FLOW_TRANSACTIONFEESENABLED` | `false` | Enable variable transaction fees and execution effort metering <br> as described in [Variable Transaction Fees: Execution Effort](https://github.com/onflow/flow/pull/753) FLIP |
68-
| `--transaction-max-gas-limit` | `FLOW_TRANSACTIONMAXGASLIMIT` | `9999` | Maximum [gas limit for transactions](https://docs.onflow.org/flow-go-sdk/building-transactions/#gas-limit) |
69-
| `--script-gas-limit` | `FLOW_SCRIPTGASLIMIT` | `100000` | Specify gas limit for script execution |
68+
| `--transaction-max-compute-limit` | `FLOW_TRANSACTIONMAXCOMPUTELIMIT` | `9999` | Maximum [compute limit for transactions](https://docs.onflow.org/flow-go-sdk/building-transactions/#gas-limit) |
69+
| `--script-compute-limit` | `FLOW_SCRIPTCOMPUTELIMIT` | `100000` | Specify compute limit for script execution |
70+
| ~~`--transaction-max-gas-limit`~~ | ~~`FLOW_TRANSACTIONMAXGASLIMIT`~~ | `9999` | **Deprecated:** Use `--transaction-max-compute-limit` instead |
71+
| ~~`--script-gas-limit`~~ | ~~`FLOW_SCRIPTGASLIMIT`~~ | `100000` | **Deprecated:** Use `--script-compute-limit` instead |
7072
| `--with-contracts` | `FLOW_WITHCONTRACTS` | `false` | Deploy common contracts when emulator starts |
7173
| `--coverage-reporting` | `FLOW_COVERAGEREPORTING` | `false` | Enable Cadence code coverage reporting |
7274
| `--skip-transaction-validation` | `FLOW_SKIPTRANSACTIONVALIDATION` | `false` | Skip verification of transaction signatures and sequence numbers |

0 commit comments

Comments
 (0)