Skip to main content

ACS11 - Cross Chain Consensus Standard

ACS11 is a standard used to customize consensus mechanisms for cross-chain operations.

Interface

Contracts inheriting from ACS11 must implement the following interfaces:

Methods

Method NameRequest TypeResponse TypeDescription
UpdateInformationFromCrossChaingoogle.protobuf.BytesValuegoogle.protobuf.EmptyUpdate the consensus information of the side chain.
GetChainInitializationInformationgoogle.protobuf.BytesValuegoogle.protobuf.BytesValueGet the current miner list and consensus round information.
CheckCrossChainIndexingPermissionaelf.Addressgoogle.protobuf.BoolValueVerify that the input address is the current miner.

Types

aelf.Address

FieldTypeDescriptionLabel
valuebytes

aelf.BinaryMerkleTree

FieldTypeDescriptionLabel
nodesHashThe leaf nodes.
rootHashThe root node hash.repeated
leaf_countint32The count of leaf node.

aelf.Hash

FieldTypeDescriptionLabel
valuebytes

aelf.LogEvent

FieldTypeDescriptionLabel
addressAddressThe contract address.
namestringThe name of the log event.
indexedbytesThe indexed data, used to calculate bloom.repeated
non_indexedbytesThe non-indexed data.repeated

aelf.MerklePath

FieldTypeDescriptionLabel
merkle_path_nodesMerklePathNodeThe merkle path nodes.repeated

aelf.MerklePathNode

FieldTypeDescriptionLabel
hashHashThe node hash.
is_left_child_nodeboolWhether it is a left child node.

aelf.SInt32Value

FieldTypeDescriptionLabel
valuesint32

aelf.SInt64Value

FieldTypeDescriptionLabel
valuesint64

aelf.ScopedStatePath

FieldTypeDescriptionLabel
addressAddressThe scope address.
pathStatePathThe path of contract state.

aelf.SmartContractRegistration

FieldTypeDescriptionLabel
categorysint32The category of contract code (0: C#).
codebytesThe byte array of the contract code.
code_hashHashThe hash of the contract code.
is_system_contractboolWhether it is a system contract.
versionint32The version of the current contract.

aelf.StatePath

FieldTypeDescriptionLabel
partsstringThe partial path of the state path.repeated

aelf.Transaction

FieldTypeDescriptionLabel
fromAddressThe address of the sender of the transaction.
toAddressThe address of the contract when calling a contract.
ref_block_numberint64The height of the referenced block hash.
ref_block_prefixbytesThe first four bytes of the referenced block hash.
method_namestringThe name of a method in the smart contract at the To address.
paramsbytesThe parameters to pass to the smart contract method.
signaturebytesSubset of fields: from/to, target method, parameter, reference block number, prefix.

aelf.TransactionExecutingStateSet

FieldTypeDescriptionLabel
writesTransactionExecutingStateSet.WritesEntryThe changed states.repeated
readsTransactionExecutingStateSet.ReadsEntryThe read states.repeated
deletesTransactionExecutingStateSet.DeletesEntryThe deleted states.repeated
aelf.TransactionExecutingStateSet.DeletesEntry
FieldTypeDescriptionLabel
keystring
valuebool
aelf.TransactionExecutingStateSet.ReadsEntry
FieldTypeDescriptionLabel
keystring
valuebool
aelf.TransactionExecutingStateSet.WritesEntry
FieldTypeDescriptionLabel
keystring
valuebytes

aelf.TransactionResult

FieldTypeDescriptionLabel
transaction_idHashThe transaction id.
statusTransactionResultStatusThe transaction result status.
logsLogEventThe log events.repeated
bloombytesBloom filter for transaction logs.repeated
return_valuebytesThe return value of the transaction execution.
block_numberint64The height of the block that packages the transaction.
block_hashHashThe hash of the block that packages the transaction.
errorstringFailed execution error message.

aelf.TransactionResultStatus

NameNumberDescription
NOT_EXISTED0The execution result of the transaction does not exist.
PENDING1The transaction is in the transaction pool waiting to be packaged.
FAILED2Transaction execution failed.
MINED3The transaction was successfully executed and packaged into a block.
CONFLICT4When executed in parallel, there are conflicts with other transactions.
PENDING_VALIDATION5The transaction is waiting for validation.
NODE_VALIDATION_FAILED6Transaction validation failed.

Example

ACS11 defines methods for customizing consensus mechanisms for cross-chain scenarios. aelf provides an implementation of ACS11 through the AEDPoS contract. Developers can refer to the AEDPoS contract API for implementation details.