Skip to content

Commit

Permalink
Merge branch 'develop' into tooling-dashboard/add-feature-flags
Browse files Browse the repository at this point in the history
  • Loading branch information
evavirseda authored Oct 30, 2024
2 parents 92f677f + aa9dcbe commit 431b5b3
Show file tree
Hide file tree
Showing 13 changed files with 66 additions and 322 deletions.
40 changes: 36 additions & 4 deletions .github/workflows/release_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,19 @@ jobs:
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # pin@v5
with:
images: docker-registry.iota.org/iota-node
# mapping semver tags to networks
# v{MAJOR}.{MINOR}.{PATCH}-alpha -> alphanet
# v{MAJOR}.{MINOR}.{PATCH}-beta -> devnet
# v{MAJOR}.{MINOR}.{PATCH}-rc -> testnet
# v{MAJOR}.{MINOR}.{PATCH} -> mainnet
tags: |
type=raw,value={{sha}},enable=${{ github.event_name == 'workflow_dispatch' }}
type=raw,value=latest,enable=${{ github.event_name == 'workflow_dispatch' }}
type=raw,value={{tag}},enable=${{ github.event_name == 'release' }}
type=match,pattern=(.*)-v\d+\.\d+\.\d+,group=1,enable=${{ github.event_name == 'release' }}
type=match,pattern=v\d+\.\d+\.\d+-alpha.*\d*,group=0,value=alphanet,enable=${{ github.event_name == 'release' }}
type=match,pattern=v\d+\.\d+\.\d+-beta.*\d*,group=0,value=devnet,enable=${{ github.event_name == 'release' }}
type=match,pattern=v\d+\.\d+\.\d+-rc.*\d*,group=0,value=testnet,enable=${{ github.event_name == 'release' }}
type=match,pattern=v\d+\.\d+\.\d+$,group=0,value=mainnet,enable=${{ github.event_name == 'release' }}
- name: Login to Docker Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # pin@v3
Expand Down Expand Up @@ -97,11 +105,19 @@ jobs:
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # pin@v5
with:
images: docker-registry.iota.org/iota-indexer
# mapping semver tags to networks
# v{MAJOR}.{MINOR}.{PATCH}-alpha -> alphanet
# v{MAJOR}.{MINOR}.{PATCH}-beta -> devnet
# v{MAJOR}.{MINOR}.{PATCH}-rc -> testnet
# v{MAJOR}.{MINOR}.{PATCH} -> mainnet
tags: |
type=raw,value={{sha}},enable=${{ github.event_name == 'workflow_dispatch' }}
type=raw,value=latest,enable=${{ github.event_name == 'workflow_dispatch' }}
type=raw,value={{tag}},enable=${{ github.event_name == 'release' }}
type=match,pattern=(.*)-v\d+\.\d+\.\d+,group=1,enable=${{ github.event_name == 'release' }}
type=match,pattern=v\d+\.\d+\.\d+-alpha.*\d*,group=0,value=alphanet,enable=${{ github.event_name == 'release' }}
type=match,pattern=v\d+\.\d+\.\d+-beta.*\d*,group=0,value=devnet,enable=${{ github.event_name == 'release' }}
type=match,pattern=v\d+\.\d+\.\d+-rc.*\d*,group=0,value=testnet,enable=${{ github.event_name == 'release' }}
type=match,pattern=v\d+\.\d+\.\d+$,group=0,value=mainnet,enable=${{ github.event_name == 'release' }}
- name: Login to Docker Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # pin@v3
Expand Down Expand Up @@ -148,11 +164,19 @@ jobs:
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # pin@v5
with:
images: docker-registry.iota.org/iota-tools
# mapping semver tags to networks
# v{MAJOR}.{MINOR}.{PATCH}-alpha -> alphanet
# v{MAJOR}.{MINOR}.{PATCH}-beta -> devnet
# v{MAJOR}.{MINOR}.{PATCH}-rc -> testnet
# v{MAJOR}.{MINOR}.{PATCH} -> mainnet
tags: |
type=raw,value={{sha}},enable=${{ github.event_name == 'workflow_dispatch' }}
type=raw,value=latest,enable=${{ github.event_name == 'workflow_dispatch' }}
type=raw,value={{tag}},enable=${{ github.event_name == 'release' }}
type=match,pattern=(.*)-v\d+\.\d+\.\d+,group=1,enable=${{ github.event_name == 'release' }}
type=match,pattern=v\d+\.\d+\.\d+-alpha.*\d*,group=0,value=alphanet,enable=${{ github.event_name == 'release' }}
type=match,pattern=v\d+\.\d+\.\d+-beta.*\d*,group=0,value=devnet,enable=${{ github.event_name == 'release' }}
type=match,pattern=v\d+\.\d+\.\d+-rc.*\d*,group=0,value=testnet,enable=${{ github.event_name == 'release' }}
type=match,pattern=v\d+\.\d+\.\d+$,group=0,value=mainnet,enable=${{ github.event_name == 'release' }}
- name: Login to Docker Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # pin@v3
Expand Down Expand Up @@ -199,11 +223,19 @@ jobs:
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # pin@v5
with:
images: docker-registry.iota.org/iota-graphql-rpc
# mapping semver tags to networks
# v{MAJOR}.{MINOR}.{PATCH}-alpha -> alphanet
# v{MAJOR}.{MINOR}.{PATCH}-beta -> devnet
# v{MAJOR}.{MINOR}.{PATCH}-rc -> testnet
# v{MAJOR}.{MINOR}.{PATCH} -> mainnet
tags: |
type=raw,value={{sha}},enable=${{ github.event_name == 'workflow_dispatch' }}
type=raw,value=latest,enable=${{ github.event_name == 'workflow_dispatch' }}
type=raw,value={{tag}},enable=${{ github.event_name == 'release' }}
type=match,pattern=(.*)-v\d+\.\d+\.\d+,group=1,enable=${{ github.event_name == 'release' }}
type=match,pattern=v\d+\.\d+\.\d+-alpha.*\d*,group=0,value=alphanet,enable=${{ github.event_name == 'release' }}
type=match,pattern=v\d+\.\d+\.\d+-beta.*\d*,group=0,value=devnet,enable=${{ github.event_name == 'release' }}
type=match,pattern=v\d+\.\d+\.\d+-rc.*\d*,group=0,value=testnet,enable=${{ github.event_name == 'release' }}
type=match,pattern=v\d+\.\d+\.\d+$,group=0,value=mainnet,enable=${{ github.event_name == 'release' }}
- name: Login to Docker Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # pin@v3
Expand Down
6 changes: 3 additions & 3 deletions apps/wallet/src/ui/app/shared/dapp-status/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function DappStatus() {
ref={refs.setFloating}
>
<div className="flex flex-col items-center gap-xs">
<div className="flex flex-row items-start gap-xs">
<div className="flex w-full flex-row items-start gap-xs">
{activeOriginFavIcon ? (
<div className="h-7 w-7 shrink-0 rounded-full border border-shader-neutral-light-8 p-xxs">
<img
Expand All @@ -129,13 +129,13 @@ function DappStatus() {
</div>
</div>
<Loading loading={disconnecting}>
<div className="self-end">
<div className="self-center">
<Button
onClick={handleDisconnect}
disabled={disconnecting}
size={ButtonSize.Small}
text="Disconnect App"
type={ButtonType.Ghost}
type={ButtonType.Destructive}
/>
</div>
</Loading>
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-open-rpc/spec/openrpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -1603,7 +1603,7 @@
"u64": "1"
},
"gas_model_version": {
"u64": "8"
"u64": "1"
},
"gas_rounding_step": {
"u64": "1000"
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-protocol-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1266,7 +1266,7 @@ impl ProtocolConfig {
obj_access_cost_verify_per_byte: Some(200),
obj_data_cost_refundable: Some(100),
obj_metadata_cost_non_refundable: Some(50),
gas_model_version: Some(8),
gas_model_version: Some(1),
storage_rebate_rate: Some(10000),
// Change reward slashing rate to 100%.
reward_slashing_rate: Some(10000),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ obj_access_cost_read_per_byte: 15
obj_access_cost_mutate_per_byte: 40
obj_access_cost_delete_per_byte: 40
obj_access_cost_verify_per_byte: 200
gas_model_version: 8
gas_model_version: 1
obj_data_cost_refundable: 100
obj_metadata_cost_non_refundable: 50
storage_rebate_rate: 10000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ obj_access_cost_read_per_byte: 15
obj_access_cost_mutate_per_byte: 40
obj_access_cost_delete_per_byte: 40
obj_access_cost_verify_per_byte: 200
gas_model_version: 8
gas_model_version: 1
obj_data_cost_refundable: 100
obj_metadata_cost_non_refundable: 50
storage_rebate_rate: 10000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ obj_access_cost_read_per_byte: 15
obj_access_cost_mutate_per_byte: 40
obj_access_cost_delete_per_byte: 40
obj_access_cost_verify_per_byte: 200
gas_model_version: 8
gas_model_version: 1
obj_data_cost_refundable: 100
obj_metadata_cost_non_refundable: 50
storage_rebate_rate: 10000
Expand Down
8 changes: 2 additions & 6 deletions crates/iota-types/src/gas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ pub mod checked {
ObjectID,
effects::{TransactionEffects, TransactionEffectsAPI},
error::{ExecutionError, IotaResult, UserInputError, UserInputResult},
gas_model::{
gas_predicates::gas_price_too_high, gas_v1::IotaGasStatus as IotaGasStatusV1,
tables::GasStatus,
},
gas_model::{gas_v1::IotaGasStatus as IotaGasStatusV1, tables::GasStatus},
iota_serde::{BigInt, Readable},
object::Object,
transaction::ObjectReadResult,
Expand Down Expand Up @@ -78,8 +75,7 @@ pub mod checked {
}
.into());
}
if gas_price_too_high(config.gas_model_version()) && gas_price >= config.max_gas_price()
{
if gas_price > config.max_gas_price() {
return Err(UserInputError::GasPriceTooHigh {
max_gas_price: config.max_gas_price(),
}
Expand Down
48 changes: 3 additions & 45 deletions crates/iota-types/src/gas_model/gas_predicates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,51 +6,9 @@
// Predicates and utility functions based on gas versions.
//

use crate::gas_model::{
tables::{
initial_cost_schedule_v1, initial_cost_schedule_v2, initial_cost_schedule_v3,
initial_cost_schedule_v4, initial_cost_schedule_v5,
},
units_types::CostTable,
};

/// If true, do not charge the entire budget on storage OOG
pub fn dont_charge_budget_on_storage_oog(gas_model_version: u64) -> bool {
gas_model_version >= 4
}

/// If true, enable the check for gas price too high
pub fn gas_price_too_high(gas_model_version: u64) -> bool {
gas_model_version >= 4
}

/// If true, input object bytes are treated as memory allocated in Move and
/// charged according to the bucket they end up in.
pub fn charge_input_as_memory(gas_model_version: u64) -> bool {
gas_model_version == 4
}

/// If true, calculate value sizes using the legacy size calculation.
pub fn use_legacy_abstract_size(gas_model_version: u64) -> bool {
gas_model_version <= 7
}

// If true, charge differently for package upgrades
pub fn charge_upgrades(gas_model_version: u64) -> bool {
gas_model_version >= 7
}
use crate::gas_model::{tables::initial_cost_schedule_v1, units_types::CostTable};

// Return the version supported cost table
pub fn cost_table_for_version(gas_model: u64) -> CostTable {
if gas_model <= 3 {
initial_cost_schedule_v1()
} else if gas_model == 4 {
initial_cost_schedule_v2()
} else if gas_model == 5 {
initial_cost_schedule_v3()
} else if gas_model <= 7 {
initial_cost_schedule_v4()
} else {
initial_cost_schedule_v5()
}
pub fn cost_table_for_version(_gas_model: u64) -> CostTable {
initial_cost_schedule_v1()
}
Loading

0 comments on commit 431b5b3

Please sign in to comment.