MCPcopy Create free account
hub / github.com/SeismicSystems/summit / new

Method new

finalizer/src/actor.rs:128–223  ·  view source on GitHub ↗
(
        context: R,
        cfg: FinalizerConfig<C, O, V>,
    )

Source from the content-addressed store, hash-verified

126 .generate_removed_validator_proof(*index)
127 .map(|field| StateProofEntry { field, key: None }),
128 })
129 .collect()
130}
131
132#[derive(Clone, Copy, Debug, Eq, PartialEq)]
133enum DepositRejectionReason {
134 Refund,
135 InvalidSignature,
136 /// Deposit chunk's Ed25519 / BLS key bytes did not decode. A single
137 /// malformed chunk in a grouped EIP-7685 deposit entry must not poison
138 /// the valid chunks alongside it. Routing this through the same refund
139 /// branch as `InvalidSignature` keeps the malformed chunk's depositor
140 /// whole.
141 MalformedKey,
142}
143
144fn deposit_refund_key(domain_tag: u8, withdrawal_address: Address, deposit_index: u64) -> [u8; 32] {
145 let mut key = [0u8; 32];
146 key[0] = domain_tag;
147 key[1..9].copy_from_slice(&deposit_index.to_le_bytes());
148 key[12..32].copy_from_slice(withdrawal_address.as_ref());
149 key
150}
151
152fn refunded_deposit_key(withdrawal_address: Address, deposit_index: u64) -> [u8; 32] {
153 deposit_refund_key(0xFE, withdrawal_address, deposit_index)
154}
155
156fn invalid_signature_refund_key(withdrawal_address: Address, deposit_index: u64) -> [u8; 32] {
157 deposit_refund_key(0xFF, withdrawal_address, deposit_index)
158}
159
160fn invalid_deposit_tax_key(treasury_address: Address, deposit_index: u64) -> [u8; 32] {
161 deposit_refund_key(0xFD, treasury_address, deposit_index)
162}
163
164fn push_invalid_deposit_withdrawals(
165 state: &mut ConsensusState,
166 withdrawal_credentials: Address,
167 refund_pubkey: [u8; 32],
168 deposit_index: u64,
169 amount: u64,
170 withdrawal_epoch: u64,
171) {
172 let (refund_amount, tax_amount) =
173 invalid_deposit_refund_split(amount, state.get_invalid_deposit_tax());
174
175 if refund_amount > 0 {
176 state.push_refund_withdrawal_request(
177 WithdrawalRequest {
178 source_address: withdrawal_credentials,
179 validator_pubkey: refund_pubkey,
180 amount: refund_amount,
181 },
182 withdrawal_epoch,
183 0, // deposit was never credited to balance
184 );
185 }

Callers

nothing calls this directly

Calls 2

registerMethod · 0.80

Tested by

no test coverage detected