# Internal Task Handler

## Overview

The `InternalTaskHandler` contract on **L2** is one of the core component of the Othentic AVS framework handling [Internal Tasks](https://docs.othentic.xyz/main/learn/advanced-concepts/internal-tasks). It is responsible for processing and executing system-level tasks that are delegated by the `AttestationCenter`.&#x20;

These tasks include:

* [Voting power synchronization](https://docs.othentic.xyz/main/learn/advanced-concepts/internal-tasks#sync-voting-power)
* Voting power sync per task definition

***

## Core Functions

#### getLastCommitBlockL1

```
function getLastCommitBlockL1() external view returns (uint256);
```

Returns the block number of the last committed update from L1.

#### getLastCommitBlockL2

```
function getLastCommitBlockL2() external view returns (uint256);
```

Returns the block number of the last committed update from L2.

#### attestationCenter

```
function attestationCenter() external view returns (IAttestationCenter);
```

Returns the address of the current `AttestationCenter` contract.

#### processTask

```
function processTask(IAttestationCenter.TaskInfo calldata _task) external;
```

Processes a task from the `AttestationCenter`. Based on the [taskDefinitionId](https://docs.othentic.xyz/main/learn/core-concepts/tasks/task-definitions), the appropriate internal function is triggered:

* [Voting Power Sync](https://docs.othentic.xyz/main/learn/advanced-concepts/internal-tasks#sync-voting-power) 10001
* [Voting Power Sync Per Task](https://docs.othentic.xyz/main/learn/advanced-concepts/internal-tasks#id-2.-voting-power-sync-per-task-definition) 10002

Access is restricted to the `ATTESTATION_CENTER` role.

***

### Task Handlers

#### votingPowerUpdate

```
function _votingPowerUpdate(IAttestationCenter.TaskInfo memory _task) internal;
```

Handles voting power sync tasks. Decodes a `VotingPowerUpdate` struct and updates voting power for Operators using the OBLS contract. It also includes checks against duplicate or future block submissions.

#### triggerInternalTransactionsTask

```
function _triggerInternalTransactionsTask(IAttestationCenter.TaskInfo memory _task) private;
```

Processes internal OBLS-specific administrative transactions to update voting power per task for restricted operators. This is restricted only to certain method selectors on the OBLS contract.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.othentic.xyz/main/reference/contracts/internal-task-handler.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
