diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6db8bde5..7795d339 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -29,7 +29,6 @@ jobs: crate: [ "fil_actor_account_state", "fil_actor_cron_state", - "fil_actor_eam_state", "fil_actor_ethaccount_state" ] steps: @@ -62,7 +61,7 @@ jobs: with: crate: ${{ matrix.crate }} - publish-verifreg: + publish-verifreg-and-eam: runs-on: ubuntu-latest needs: publish-shared steps: @@ -71,11 +70,14 @@ jobs: - name: Publish verifreg crate uses: ./.github/composite-actions/publish-crate with: - crate: "fil_actor_verifreg_state" + crate: [ + "fil_actor_verifreg_state", + "fil_actor_eam_state" + ] publish-market-and-miner: runs-on: ubuntu-latest - needs: publish-verifreg + needs: publish-verifreg-and-eam strategy: matrix: crate: [ diff --git a/actors/eam/Cargo.toml b/actors/eam/Cargo.toml index e7460547..352dd003 100644 --- a/actors/eam/Cargo.toml +++ b/actors/eam/Cargo.toml @@ -9,7 +9,10 @@ version.workspace = true keywords.workspace = true [dependencies] +fil_actor_evm_state = { workspace = true } +fvm_ipld_encoding = { workspace = true } fvm_shared3 = { workspace = true } fvm_shared4 = { workspace = true } num-derive = { workspace = true } num-traits = { workspace = true } +serde = { workspace = true } diff --git a/actors/eam/src/v10/mod.rs b/actors/eam/src/v10/mod.rs index 4b2ff96a..ea575c43 100644 --- a/actors/eam/src/v10/mod.rs +++ b/actors/eam/src/v10/mod.rs @@ -1,8 +1,11 @@ // Copyright 2019-2022 ChainSafe Systems // SPDX-License-Identifier: Apache-2.0, MIT -use fvm_shared3::METHOD_CONSTRUCTOR; +use fil_actor_evm_state::evm_shared::v10::address::EthAddress; +use fvm_ipld_encoding::{strict_bytes, tuple::*}; +use fvm_shared3::{address::Address, ActorID, METHOD_CONSTRUCTOR}; use num_derive::FromPrimitive; +use serde::{Deserialize, Serialize}; #[derive(FromPrimitive)] #[repr(u64)] @@ -12,3 +15,33 @@ pub enum Method { Create2 = 3, CreateExternal = 4, } + +#[derive(Serialize_tuple, Deserialize_tuple)] +pub struct CreateParams { + #[serde(with = "strict_bytes")] + pub initcode: Vec, + pub nonce: u64, +} + +#[derive(Serialize_tuple, Deserialize_tuple)] +pub struct Create2Params { + #[serde(with = "strict_bytes")] + pub initcode: Vec, + #[serde(with = "strict_bytes")] + pub salt: [u8; 32], +} + +#[derive(Serialize, Deserialize)] +#[serde(transparent)] +pub struct CreateExternalParams(#[serde(with = "strict_bytes")] pub Vec); + +#[derive(Serialize_tuple, Deserialize_tuple, Debug, PartialEq, Eq)] +pub struct Return { + pub actor_id: ActorID, + pub robust_address: Option
, + pub eth_address: EthAddress, +} + +pub type CreateReturn = Return; +pub type Create2Return = Return; +pub type CreateExternalReturn = Return; diff --git a/actors/eam/src/v11/mod.rs b/actors/eam/src/v11/mod.rs index 4b2ff96a..1eaa9a0d 100644 --- a/actors/eam/src/v11/mod.rs +++ b/actors/eam/src/v11/mod.rs @@ -1,8 +1,11 @@ // Copyright 2019-2022 ChainSafe Systems // SPDX-License-Identifier: Apache-2.0, MIT -use fvm_shared3::METHOD_CONSTRUCTOR; +use fil_actor_evm_state::evm_shared::v11::address::EthAddress; +use fvm_ipld_encoding::{strict_bytes, tuple::*}; +use fvm_shared3::{address::Address, ActorID, METHOD_CONSTRUCTOR}; use num_derive::FromPrimitive; +use serde::{Deserialize, Serialize}; #[derive(FromPrimitive)] #[repr(u64)] @@ -12,3 +15,33 @@ pub enum Method { Create2 = 3, CreateExternal = 4, } + +#[derive(Serialize_tuple, Deserialize_tuple)] +pub struct CreateParams { + #[serde(with = "strict_bytes")] + pub initcode: Vec, + pub nonce: u64, +} + +#[derive(Serialize_tuple, Deserialize_tuple)] +pub struct Create2Params { + #[serde(with = "strict_bytes")] + pub initcode: Vec, + #[serde(with = "strict_bytes")] + pub salt: [u8; 32], +} + +#[derive(Serialize, Deserialize)] +#[serde(transparent)] +pub struct CreateExternalParams(#[serde(with = "strict_bytes")] pub Vec); + +#[derive(Serialize_tuple, Deserialize_tuple, Debug, PartialEq, Eq)] +pub struct Return { + pub actor_id: ActorID, + pub robust_address: Option
, + pub eth_address: EthAddress, +} + +pub type CreateReturn = Return; +pub type Create2Return = Return; +pub type CreateExternalReturn = Return; diff --git a/actors/eam/src/v12/mod.rs b/actors/eam/src/v12/mod.rs index d362a109..2215638c 100644 --- a/actors/eam/src/v12/mod.rs +++ b/actors/eam/src/v12/mod.rs @@ -1,8 +1,11 @@ // Copyright 2019-2022 ChainSafe Systems // SPDX-License-Identifier: Apache-2.0, MIT -use fvm_shared4::METHOD_CONSTRUCTOR; +use fil_actor_evm_state::evm_shared::v12::address::EthAddress; +use fvm_ipld_encoding::{strict_bytes, tuple::*}; +use fvm_shared4::{address::Address, ActorID, METHOD_CONSTRUCTOR}; use num_derive::FromPrimitive; +use serde::{Deserialize, Serialize}; #[derive(FromPrimitive)] #[repr(u64)] @@ -12,3 +15,33 @@ pub enum Method { Create2 = 3, CreateExternal = 4, } + +#[derive(Serialize_tuple, Deserialize_tuple)] +pub struct CreateParams { + #[serde(with = "strict_bytes")] + pub initcode: Vec, + pub nonce: u64, +} + +#[derive(Serialize_tuple, Deserialize_tuple)] +pub struct Create2Params { + #[serde(with = "strict_bytes")] + pub initcode: Vec, + #[serde(with = "strict_bytes")] + pub salt: [u8; 32], +} + +#[derive(Serialize, Deserialize)] +#[serde(transparent)] +pub struct CreateExternalParams(#[serde(with = "strict_bytes")] pub Vec); + +#[derive(Serialize_tuple, Deserialize_tuple, Debug, PartialEq, Eq)] +pub struct Return { + pub actor_id: ActorID, + pub robust_address: Option
, + pub eth_address: EthAddress, +} + +pub type CreateReturn = Return; +pub type Create2Return = Return; +pub type CreateExternalReturn = Return; diff --git a/actors/eam/src/v13/mod.rs b/actors/eam/src/v13/mod.rs index d362a109..790559a6 100644 --- a/actors/eam/src/v13/mod.rs +++ b/actors/eam/src/v13/mod.rs @@ -1,8 +1,11 @@ // Copyright 2019-2022 ChainSafe Systems // SPDX-License-Identifier: Apache-2.0, MIT -use fvm_shared4::METHOD_CONSTRUCTOR; +use fil_actor_evm_state::evm_shared::v13::address::EthAddress; +use fvm_ipld_encoding::{strict_bytes, tuple::*}; +use fvm_shared4::{address::Address, ActorID, METHOD_CONSTRUCTOR}; use num_derive::FromPrimitive; +use serde::{Deserialize, Serialize}; #[derive(FromPrimitive)] #[repr(u64)] @@ -12,3 +15,33 @@ pub enum Method { Create2 = 3, CreateExternal = 4, } + +#[derive(Serialize_tuple, Deserialize_tuple)] +pub struct CreateParams { + #[serde(with = "strict_bytes")] + pub initcode: Vec, + pub nonce: u64, +} + +#[derive(Serialize_tuple, Deserialize_tuple)] +pub struct Create2Params { + #[serde(with = "strict_bytes")] + pub initcode: Vec, + #[serde(with = "strict_bytes")] + pub salt: [u8; 32], +} + +#[derive(Serialize, Deserialize)] +#[serde(transparent)] +pub struct CreateExternalParams(#[serde(with = "strict_bytes")] pub Vec); + +#[derive(Serialize_tuple, Deserialize_tuple, Debug, PartialEq, Eq)] +pub struct Return { + pub actor_id: ActorID, + pub robust_address: Option
, + pub eth_address: EthAddress, +} + +pub type CreateReturn = Return; +pub type Create2Return = Return; +pub type CreateExternalReturn = Return; diff --git a/actors/eam/src/v14/mod.rs b/actors/eam/src/v14/mod.rs index d362a109..f139eb7a 100644 --- a/actors/eam/src/v14/mod.rs +++ b/actors/eam/src/v14/mod.rs @@ -1,8 +1,11 @@ // Copyright 2019-2022 ChainSafe Systems // SPDX-License-Identifier: Apache-2.0, MIT -use fvm_shared4::METHOD_CONSTRUCTOR; +use fil_actor_evm_state::evm_shared::v14::address::EthAddress; +use fvm_ipld_encoding::{strict_bytes, tuple::*}; +use fvm_shared4::{address::Address, ActorID, METHOD_CONSTRUCTOR}; use num_derive::FromPrimitive; +use serde::{Deserialize, Serialize}; #[derive(FromPrimitive)] #[repr(u64)] @@ -12,3 +15,33 @@ pub enum Method { Create2 = 3, CreateExternal = 4, } + +#[derive(Serialize_tuple, Deserialize_tuple)] +pub struct CreateParams { + #[serde(with = "strict_bytes")] + pub initcode: Vec, + pub nonce: u64, +} + +#[derive(Serialize_tuple, Deserialize_tuple)] +pub struct Create2Params { + #[serde(with = "strict_bytes")] + pub initcode: Vec, + #[serde(with = "strict_bytes")] + pub salt: [u8; 32], +} + +#[derive(Serialize, Deserialize)] +#[serde(transparent)] +pub struct CreateExternalParams(#[serde(with = "strict_bytes")] pub Vec); + +#[derive(Serialize_tuple, Deserialize_tuple, Debug, PartialEq, Eq)] +pub struct Return { + pub actor_id: ActorID, + pub robust_address: Option
, + pub eth_address: EthAddress, +} + +pub type CreateReturn = Return; +pub type Create2Return = Return; +pub type CreateExternalReturn = Return; diff --git a/actors/eam/src/v15/mod.rs b/actors/eam/src/v15/mod.rs index d362a109..f41a2fac 100644 --- a/actors/eam/src/v15/mod.rs +++ b/actors/eam/src/v15/mod.rs @@ -1,8 +1,11 @@ // Copyright 2019-2022 ChainSafe Systems // SPDX-License-Identifier: Apache-2.0, MIT -use fvm_shared4::METHOD_CONSTRUCTOR; +use fil_actor_evm_state::evm_shared::v15::address::EthAddress; +use fvm_ipld_encoding::{strict_bytes, tuple::*}; +use fvm_shared4::{address::Address, ActorID, METHOD_CONSTRUCTOR}; use num_derive::FromPrimitive; +use serde::{Deserialize, Serialize}; #[derive(FromPrimitive)] #[repr(u64)] @@ -12,3 +15,33 @@ pub enum Method { Create2 = 3, CreateExternal = 4, } + +#[derive(Serialize_tuple, Deserialize_tuple)] +pub struct CreateParams { + #[serde(with = "strict_bytes")] + pub initcode: Vec, + pub nonce: u64, +} + +#[derive(Serialize_tuple, Deserialize_tuple)] +pub struct Create2Params { + #[serde(with = "strict_bytes")] + pub initcode: Vec, + #[serde(with = "strict_bytes")] + pub salt: [u8; 32], +} + +#[derive(Serialize, Deserialize)] +#[serde(transparent)] +pub struct CreateExternalParams(#[serde(with = "strict_bytes")] pub Vec); + +#[derive(Serialize_tuple, Deserialize_tuple, Debug, PartialEq, Eq)] +pub struct Return { + pub actor_id: ActorID, + pub robust_address: Option
, + pub eth_address: EthAddress, +} + +pub type CreateReturn = Return; +pub type Create2Return = Return; +pub type CreateExternalReturn = Return; diff --git a/fil_actors_shared/src/abi/commp.rs b/fil_actors_shared/src/abi/commp.rs index 37f0a6e3..7b4706ff 100644 --- a/fil_actors_shared/src/abi/commp.rs +++ b/fil_actors_shared/src/abi/commp.rs @@ -3,9 +3,9 @@ use cid::Cid; use fvm_shared::{ - commcid::data_commitment_v1_to_cid, piece::PieceInfo as PieceInfoV2, - sector::RegisteredSealProof as RegisteredSealProofV2, + piece::PieceInfo as PieceInfoV2, sector::RegisteredSealProof as RegisteredSealProofV2, }; +use fvm_shared4::commcid::data_commitment_v1_to_cid; /// Computes an unsealed sector CID (`CommD`) from its constituent piece CIDs (`CommPs`) and sizes. ///