compressor

package module
v0.0.0-...-8181b47 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	METHOD_EXECUTE_SEQUENCE_TX uint = iota
	METHOD_EXECUTE_SEQUENCE_N_TXS
	METHOD_READ_ADDRESS
	METHOD_READ_BYTES32
	METHOD_READ_SIZES
	METHOD_READ_STORAGE_SLOTS
	METHOD_DECODE_SEQUENCE_TX
	METHOD_DECODE_SEQUENCE_N_TXS
	METHOD_EXECUTE_CALL
	METHOD_EXECUTE_CALL_RETURN
	METHOD_EXECUTE_N_CALLS
	METHOD_DECODE_CALL
	METHOD_DECODE_N_CALLS
	METHOD_DECODE_ANY
)
View Source
const (
	FLAG_NO_OP uint = iota
	FLAG_READ_WORD_1
	FLAG_READ_WORD_2
	FLAG_READ_WORD_3
	FLAG_READ_WORD_4
	FLAG_READ_WORD_5
	FLAG_READ_WORD_6
	FLAG_READ_WORD_7
	FLAG_READ_WORD_8
	FLAG_READ_WORD_9
	FLAG_READ_WORD_10
	FLAG_READ_WORD_11
	FLAG_READ_WORD_12
	FLAG_READ_WORD_13
	FLAG_READ_WORD_14
	FLAG_READ_WORD_15
	FLAG_READ_WORD_16
	FLAG_READ_WORD_17
	FLAG_READ_WORD_18
	FLAG_READ_WORD_19
	FLAG_READ_WORD_20
	FLAG_READ_WORD_21
	FLAG_READ_WORD_22
	FLAG_READ_WORD_23
	FLAG_READ_WORD_24
	FLAG_READ_WORD_25
	FLAG_READ_WORD_26
	FLAG_READ_WORD_27
	FLAG_READ_WORD_28
	FLAG_READ_WORD_29
	FLAG_READ_WORD_30
	FLAG_READ_WORD_31
	FLAG_READ_WORD_32
	FLAG_READ_WORD_INV
	FLAG_READ_N_BYTES
	FLAG_WRITE_ZEROS
	FLAG_NESTED_N_FLAGS_S
	FLAG_NESTED_N_FLAGS_L
	FLAG_SAVE_ADDRESS
	FLAG_READ_ADDRESS_2
	FLAG_READ_ADDRESS_3
	FLAG_READ_ADDRESS_4
	FLAG_SAVE_BYTES32
	FLAG_READ_BYTES32_2
	FLAG_READ_BYTES32_3
	FLAG_READ_BYTES32_4
	FLAG_READ_STORE_FLAG_S
	FLAG_READ_STORE_FLAG_L
	FLAG_POW_2
	FLAG_POW_2_MINUS_1
	FLAG_POW_10
	FLAG_POW_10_MANTISSA_S
	FLAG_POW_10_MANTISSA_L
	FLAG_ABI_0_PARAM
	FLAG_ABI_1_PARAM
	FLAG_ABI_2_PARAMS
	FLAG_ABI_3_PARAMS
	FLAG_ABI_4_PARAMS
	FLAG_ABI_5_PARAMS
	FLAG_ABI_6_PARAMS
	FLAG_READ_DYNAMIC_ABI
	FLAG_MIRROR_FLAG_S
	FLAG_MIRROR_FLAG_L
	FLAG_COPY_CALLDATA_S
	FLAG_COPY_CALLDATA_L
	FLAG_COPY_CALLDATA_XL
	FLAG_SEQUENCE_EXECUTE
	FLAG_SEQUENCE_SELF_EXECUTE
	FLAG_SEQUENCE_SIGNATURE_W0
	FLAG_SEQUENCE_SIGNATURE_W1
	FLAG_SEQUENCE_SIGNATURE_W2
	FLAG_SEQUENCE_SIGNATURE_W3
	FLAG_SEQUENCE_SIGNATURE_W4
	FLAG_SEQUENCE_ADDRESS_W0
	FLAG_SEQUENCE_ADDRESS_W1
	FLAG_SEQUENCE_ADDRESS_W2
	FLAG_SEQUENCE_ADDRESS_W3
	FLAG_SEQUENCE_ADDRESS_W4
	FLAG_SEQUENCE_NODE
	FLAG_SEQUENCE_BRANCH
	FLAG_SEQUENCE_SUBDIGEST
	FLAG_SEQUENCE_NESTED
	FLAG_SEQUENCE_DYNAMIC_SIGNATURE
	FLAG_SEQUENCE_SIG_NO_CHAIN
	FLAG_SEQUENCE_SIG
	FLAG_SEQUENCE_L_SIG_NO_CHAIN
	FLAG_SEQUENCE_L_SIG
	FLAG_SEQUENCE_READ_CHAINED_S
	FLAG_SEQUENCE_READ_CHAINED_L
)
View Source
const BYTES4_TABLE = "" /* 2048-byte string literal not displayed */
View Source
const LITERAL_ZERO = FLAG_SEQUENCE_READ_CHAINED_L + 1
View Source
const MAX_LITERAL = 0xff - LITERAL_ZERO

Variables

View Source
var VERSION = "dev"

Functions

func AddressIndex

func AddressIndex(i uint) []byte

func Bytes32Index

func Bytes32Index(i uint) []byte

func FlagNames

func FlagNames() map[string]uint

func GenBatch

func GenBatch(from uint, to uint, max uint, itemplate func(uint) []byte) []byte

func GetTotals

func GetTotals(ctx context.Context, provider *ethrpc.Provider, contract common.Address, skipBlocks uint) (uint, uint, error)

func LoadAddresses

func LoadAddresses(ctx context.Context, provider *ethrpc.Provider, contract common.Address, batchSize uint, skip uint, skipBlocks uint) (uint, map[string]uint, error)

func LoadBytes4

func LoadBytes4() map[string]uint

func LoadBytes32

func LoadBytes32(ctx context.Context, provider *ethrpc.Provider, contract common.Address, batchSize uint, skip uint, skipBlocks uint) (uint, map[string]uint, error)

func LoadState

func LoadState(ctx context.Context, provider *ethrpc.Provider, contract common.Address, batchSize uint, skipa uint, skipb uint, skipBlocks uint) (uint, map[string]uint, uint, map[string]uint, error)

func LoadStorage

func LoadStorage(ctx context.Context, provider *ethrpc.Provider, contract common.Address, batchSize uint, skip uint, total uint, itemplate func(uint) []byte) (uint, map[string]uint, error)

func ParseBatchResult

func ParseBatchResult(to map[string]uint, res []byte, offset uint) error

Types

type AllowOpcodes

type AllowOpcodes struct {
	Default bool
	List    map[uint]bool
}

type Buffer

type Buffer struct {
	Commited []byte
	Pending  []byte

	Refs *References
}

func NewBuffer

func NewBuffer(method uint, indexes *Indexes, allowOpcodes *AllowOpcodes, useStorage bool) *Buffer

func (*Buffer) Allows

func (cb *Buffer) Allows(op uint) bool

func (*Buffer) Data

func (cb *Buffer) Data() []byte

func (*Buffer) Encode4Bytes

func (buf *Buffer) Encode4Bytes(bytes []byte) []byte

func (*Buffer) EncodeWordBytes32

func (buf *Buffer) EncodeWordBytes32(word []byte) ([]byte, EncodeType, error)

Encodes a 32 word, without any optimizations

func (*Buffer) EncodeWordBytes32Inv

func (buf *Buffer) EncodeWordBytes32Inv(word []byte) ([]byte, EncodeType, error)

func (*Buffer) EncodeWordOptimized

func (buf *Buffer) EncodeWordOptimized(word []byte, saveWord bool) ([]byte, EncodeType, error)

Encodes a 32 bytes word, trying to optimize it as much as possible

func (*Buffer) FindPastData

func (cb *Buffer) FindPastData(data []byte) int

func (*Buffer) Len

func (cb *Buffer) Len() int

func (*Buffer) Restore

func (cb *Buffer) Restore(snap *Snapshot)

func (*Buffer) Snapshot

func (cb *Buffer) Snapshot() *Snapshot

func (*Buffer) WriteBytesOptimized

func (buf *Buffer) WriteBytesOptimized(bytes []byte, saveWord bool) (EncodeType, error)

Encode N bytes, as optimized as possible

func (*Buffer) WriteCall

func (buf *Buffer) WriteCall(to []byte, data []byte) (EncodeType, error)

func (*Buffer) WriteCalls

func (buf *Buffer) WriteCalls(tos [][]byte, datas [][]byte) (EncodeType, error)

func (*Buffer) WriteNBytesRaw

func (buf *Buffer) WriteNBytesRaw(bytes []byte) (EncodeType, error)

Encodes N bytes, without any optimizations

func (*Buffer) WriteNWords

func (buf *Buffer) WriteNWords(words []byte) (EncodeType, error)

Encodes N words

func (*Buffer) WriteSequenceBranchSignaturePart

func (buf *Buffer) WriteSequenceBranchSignaturePart(branch []byte) (EncodeType, error)

func (*Buffer) WriteSequenceChainedSignature

func (buf *Buffer) WriteSequenceChainedSignature(signature []byte) (EncodeType, error)

func (*Buffer) WriteSequenceDynamicSignaturePart

func (buf *Buffer) WriteSequenceDynamicSignaturePart(address []byte, weight uint, signature []byte) (EncodeType, error)

func (*Buffer) WriteSequenceExecute

func (buf *Buffer) WriteSequenceExecute(to []byte, transaction *sequence.Transaction) (EncodeType, error)

func (*Buffer) WriteSequenceExecuteFlag

func (buf *Buffer) WriteSequenceExecuteFlag(transaction *sequence.Transaction) (EncodeType, error)

func (*Buffer) WriteSequenceNestedSignaturePart

func (buf *Buffer) WriteSequenceNestedSignaturePart(weight uint, threshold uint, branch []byte) (EncodeType, error)

func (*Buffer) WriteSequenceNonce

func (buf *Buffer) WriteSequenceNonce(nonce *big.Int, randomNonce bool) (EncodeType, error)

func (*Buffer) WriteSequenceSelfExecuteFlag

func (buf *Buffer) WriteSequenceSelfExecuteFlag(transaction *sequence.Transaction) (EncodeType, error)

func (*Buffer) WriteSequenceSignature

func (buf *Buffer) WriteSequenceSignature(signature []byte, mayUseBytes bool) (EncodeType, error)

func (*Buffer) WriteSequenceSignatureBody

func (buf *Buffer) WriteSequenceSignatureBody(noChain bool, body []byte) (EncodeType, error)

func (*Buffer) WriteSequenceSignatureTree

func (buf *Buffer) WriteSequenceSignatureTree(tree []byte) (EncodeType, error)

func (*Buffer) WriteSequenceTransaction

func (buf *Buffer) WriteSequenceTransaction(tx *sequence.Transaction) (EncodeType, error)

func (*Buffer) WriteSequenceTransactions

func (buf *Buffer) WriteSequenceTransactions(txs sequence.Transactions) (EncodeType, error)

func (*Buffer) WriteWord

func (buf *Buffer) WriteWord(word []byte, useStorage bool) (EncodeType, error)

Encodes and writes a word to the buffer

type EncodeType

type EncodeType int
const (
	Stateless EncodeType = iota
	Mirror
	ReadStorage
	WriteStorage
)

type Indexes

type Indexes struct {
	AddressIndexes map[string]uint
	Bytes32Indexes map[string]uint
	Bytes4Indexes  map[string]uint
}

type References

type References struct {
	AllowOpcodes *AllowOpcodes

	Indexes *Indexes
	// contains filtered or unexported fields
}

func (*References) Copy

func (r *References) Copy() *References

type Snapshot

type Snapshot struct {
	Commited []byte

	SignatureLevel uint

	Refs *References
}

Directories

Path Synopsis
cmd
czip-compressor command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL