AlveyChain Documents
  • Alveychain Docs
  • Get-Started
    • Alveychain
    • Installation
    • Local Setup
    • Cloud Setup
    • Full Node
    • CLI Commands
    • JSON RPC Commands
    • Performance Reports
  • Configuration
    • Manage private keys
    • Set up Hashicorp Vault
    • Enable Prometheus metrics
  • Working-With-Node
    • Query JSON RPC endpoints
    • Query operator information
    • Backup/restore node instance
  • Consensus
    • Proof of Authority (PoA)
    • Proof of Stake
    • Set up and use Proof of Stake (PoS)
    • Migration from PoA to PoS
  • Additional Features
    • Alveycoin bridge
    • Network stress testing
    • Blockscout
  • Architecture
    • Architecture Overview
    • modules
      • Blockchain
      • Consensus
      • JSON RPC
      • Minimal
      • Networking
      • Other modules
      • Protocol
      • Sealer
      • State
      • Storage
      • TxPool
      • Types
  • Concepts
    • State in Ethereum
  • Community
    • Propose a new feature
    • Report an issue
  • Docs
    • Server Config File
    • how-tos
      • How to set up and use Proof of Stake (PoS)
Powered by GitBook
On this page
  • Overview
  • RLP Encoding / Decoding
  1. Architecture
  2. modules

Types

Overview

The Types module implements core object types, such as:

  • Address

  • Hash

  • Header

  • lots of helper functions

RLP Encoding / Decoding

Unlike clients such as GETH, the alveychain doesn't use reflection for the encoding. The preference was to not use reflection because it introduces new problems, such as performance degradation, and harder scaling.

The Types module provides an easy-to-use interface for RLP marshaling and unmarshalling, using the FastRLP package.

Marshaling is done through the MarshalRLPWith and MarshalRLPTo methods. The analogous methods exist for unmarshalling.

By manually defining these methods, the alveychain doesn't need to use reflection. In rlp_marshal.go, you can find methods for marshaling:

  • Bodies

  • Blocks

  • Headers

  • Receipts

  • Logs

  • Transactions

PreviousTxPoolNextState in Ethereum

Last updated 2 years ago