Skip to content

Commit fcfafac

Browse files
l-monningerandygolaymusitdevmzabaluev0xmovses
authored andcommitted
fix: Gas Upgrades Beta Fixes pt. 2 (#1070)
Co-authored-by: Andy Golay <[email protected]> Co-authored-by: musitdev <[email protected]> Co-authored-by: Mikhail Zabaluev <[email protected]> Co-authored-by: Richard Melkonian <[email protected]> Co-authored-by: Icarus131 <[email protected]> Co-authored-by: primata <[email protected]> Co-authored-by: Icarus131 <[email protected]> Co-authored-by: Richard Melkonian <[email protected]> Co-authored-by: Radu Popa <[email protected]>
1 parent 69b2e6c commit fcfafac

File tree

7 files changed

+18
-35
lines changed

7 files changed

+18
-35
lines changed

.github/workflows/build-push-container.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
strategy:
2222
matrix:
2323
architecture: [x86_64, arm64]
24-
runs-on: ${{ matrix.architecture == 'x86_64' && 'buildjet-8vcpu-ubuntu-2204' || 'buildjet-8vcpu-ubuntu-2204-arm' }}
24+
runs-on: ${{ matrix.architecture == 'x86_64' && 'buildjet-16vcpu-ubuntu-2204' || 'buildjet-16vcpu-ubuntu-2204-arm' }}
2525
steps:
2626
- name: Checkout repository
2727
uses: actions/checkout@v4

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protocol-units/da/movement/protocol/light-node/src/passthrough.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,6 @@ where
234234
let blobs = request.into_inner().blobs;
235235
for data in blobs {
236236
let blob = InnerSignedBlobV1Data::now(data.data)
237-
.map_err(|e| tonic::Status::internal(format!("Failed to create blob data: {}", e)))?
238237
.try_to_sign(&self.signer)
239238
.await
240239
.map_err(|e| tonic::Status::internal(format!("Failed to sign blob: {}", e)))?;

protocol-units/da/movement/protocol/util/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ movement-da-light-node-signer = { workspace = true }
4949
movement-signer = { workspace = true }
5050
movement-signer-loader = { workspace = true }
5151
movement-types = { workspace = true }
52+
chrono = { workspace = true }
5253

5354
[dev-dependencies]
5455
tempfile = { workspace = true }

protocol-units/da/movement/protocol/util/src/blob/ir/data.rs

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@ where
2727
Self { blob, timestamp, __curve_marker: std::marker::PhantomData }
2828
}
2929

30-
pub fn now(blob: Vec<u8>) -> Result<Self, anyhow::Error> {
31-
Ok(Self::new(
32-
blob,
33-
std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH)?.as_secs(),
34-
))
30+
pub fn now(blob: Vec<u8>) -> Self {
31+
// Define the block timestamp value. Aptos framework need a timestamp in micro sec.
32+
// Changing this value will generate blocks that can't be executed.
33+
let timestamp = chrono::Utc::now().timestamp_micros() as u64;
34+
35+
Self::new(blob, timestamp)
3536
}
3637

3738
/// Gets an owned copy of the bytes to be signed
@@ -76,31 +77,7 @@ pub mod block {
7677

7778
fn try_from(block: block::Block) -> Result<Self, Self::Error> {
7879
let blob = bcs::to_bytes(&block)?;
79-
Self::now(blob)
80-
}
81-
}
82-
83-
impl<C> TryFrom<block::Id> for InnerSignedBlobV1Data<C>
84-
where
85-
C: Curve + Verify<C> + Digester<C>,
86-
{
87-
type Error = anyhow::Error;
88-
89-
fn try_from(id: block::Id) -> Result<Self, Self::Error> {
90-
let blob = id.as_bytes().to_vec();
91-
Self::now(blob)
92-
}
93-
}
94-
95-
impl<C> TryFrom<Vec<block::Id>> for InnerSignedBlobV1Data<C>
96-
where
97-
C: Curve + Verify<C> + Digester<C>,
98-
{
99-
type Error = anyhow::Error;
100-
101-
fn try_from(ids: Vec<block::Id>) -> Result<Self, Self::Error> {
102-
let blob = bcs::to_bytes(&ids)?;
103-
Self::now(blob)
80+
Ok(Self::now(blob))
10481
}
10582
}
10683
}

protocol-units/execution/maptos/framework/releases/biarritz-rc1/src/cached.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ generate_gas_upgrade_module!(gas_upgrade, BiarritzRc1, {
1111
let mut gas_parameters = AptosGasParameters::initial();
1212
gas_parameters.vm.txn.max_transaction_size_in_bytes = GasQuantity::new(100_000_000);
1313
gas_parameters.vm.txn.max_execution_gas = GasQuantity::new(10_000_000_000);
14-
14+
gas_parameters.vm.txn.gas_unit_scaling_factor = GasQuantity::new(50_000);
1515
aptos_types::on_chain_config::GasScheduleV2 {
1616
feature_version: aptos_gas_schedule::LATEST_GAS_FEATURE_VERSION,
1717
entries: gas_parameters

protocol-units/execution/maptos/opt-executor/src/background/transaction_pipe.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,14 @@ impl TransactionPipe {
102102
}
103103
}
104104

105-
/// Pipes a batch of transactions from the mempool to the transaction channel.
106-
/// todo: it may be wise to move the batching logic up a level to the consuming structs.
105+
/// Performs a transaction read, mempool batch formation, and garbage collection.
107106
pub(crate) async fn tick(&mut self) -> Result<(), Error> {
107+
self.receive_transaction_tick().await
108+
}
109+
110+
/// Receives a transaction and adds it to the mempool.
111+
/// todo: it may be wise to move the batching logic up a level to the consuming structs.
112+
pub(crate) async fn receive_transaction_tick(&mut self) -> Result<(), Error> {
108113
let next = self.mempool_client_receiver.next().await;
109114
if let Some(request) = next {
110115
match request {

0 commit comments

Comments
 (0)