@ -12,7 +12,7 @@ defmodule Indexer.Fetcher.ZkSync.StatusTracking.Proven do
associate_and_import_or_prepare_for_recovery : 4
]
import Indexer.Fetcher.ZkSync.Utils.Logging , only : [ log_info : 1 ]
import Indexer.Fetcher.ZkSync.Utils.Logging , only : [ log_error : 1 , log_ info : 1 ]
@doc """
Checks if the oldest unproven batch in the database has the associated L1 proving transaction
@ -68,8 +68,6 @@ defmodule Indexer.Fetcher.ZkSync.StatusTracking.Proven do
end
defp get_proven_batches_from_calldata ( calldata ) do
" 0x7f61885c " <> encoded_params = calldata
# /// @param batchNumber Rollup batch number
# /// @param batchHash Hash of L2 batch
# /// @param indexRepeatedStorageChanges The serial number of the shortcut index that's used as a unique identifier for storage keys that were used twice or more
@ -93,8 +91,10 @@ defmodule Indexer.Fetcher.ZkSync.StatusTracking.Proven do
# uint256[] recursiveAggregationInput;
# uint256[] serializedProof;
# }
proven_batches =
case calldata do
" 0x7f61885c " <> encoded_params ->
# proveBatches(StoredBatchInfo calldata _prevBatch, StoredBatchInfo[] calldata _committedBatches, ProofInput calldata _proof)
# IO.inspect(FunctionSelector.decode("proveBatches((uint64,bytes32,uint64,uint256,bytes32,bytes32,uint256,bytes32),(uint64,bytes32,uint64,uint256,bytes32,bytes32,uint256,bytes32)[],(uint256[],uint256[]))"))
[ _prev_batch , proven_batches , _proof ] =
TypeDecoder . decode (
@ -129,6 +129,53 @@ defmodule Indexer.Fetcher.ZkSync.StatusTracking.Proven do
}
)
proven_batches
" 0xc37533bb " <> encoded_params ->
# proveBatchesSharedBridge(uint256 _chainId, StoredBatchInfo calldata _prevBatch, StoredBatchInfo[] calldata _committedBatches, ProofInput calldata _proof)
# IO.inspect(FunctionSelector.decode("proveBatchesSharedBridge(uint256,(uint64,bytes32,uint64,uint256,bytes32,bytes32,uint256,bytes32),(uint64,bytes32,uint64,uint256,bytes32,bytes32,uint256,bytes32)[],(uint256[],uint256[]))"))
[ _chainid , _prev_batch , proven_batches , _proof ] =
TypeDecoder . decode (
Base . decode16! ( encoded_params , case : :lower ) ,
% FunctionSelector {
function : " proveBatchesSharedBridge " ,
types : [
{ :uint , 256 } ,
tuple : [
uint : 64 ,
bytes : 32 ,
uint : 64 ,
uint : 256 ,
bytes : 32 ,
bytes : 32 ,
uint : 256 ,
bytes : 32
] ,
array :
{ :tuple ,
[
uint : 64 ,
bytes : 32 ,
uint : 64 ,
uint : 256 ,
bytes : 32 ,
bytes : 32 ,
uint : 256 ,
bytes : 32
] } ,
tuple : [ array : { :uint , 256 } , array : { :uint , 256 } ]
]
}
)
proven_batches
_ ->
log_error ( " Unknown calldata format: #{ calldata } " )
[ ]
end
log_info ( " Discovered #{ length ( proven_batches ) } proven batches in the prove tx " )
proven_batches