Skip to content

gas_limit

Provides classes to interact with the set of endpoints for management of gas limits.

API reference: https://ethereum.github.io/keymanager-APIs/#/Gas%20Limit

Each class provides access to a specific endpoint. The classes are organized in the same way as the API documentation.

Class API Endpoint
DeleteGasLimit https://ethereum.github.io/keymanager-APIs/#/Gas%20Limit/deleteGasLimit
GetGasLimit https://ethereum.github.io/keymanager-APIs/#/Gas%20Limit/getGasLimit
SetGasLimit https://ethereum.github.io/keymanager-APIs/#/Gas%20Limit/setGasLimit

DeleteGasLimit

Contains methods for accessing the DELETE method of the /eth/v1/validator/{pubkey}/gas_limit endpoint.

The endpoint returns the following HTTP status code if successful
  • 204: No Content
Typical usage example - synchronous
import eth_2_key_manager_api_client

eth_2_key_manager = eth_2_key_manager_api_client.Eth2KeyManager()
pubkey = "0x99c4c42fac7d1393956bd9e2785ed67cf5aaca4bf56d2fcda94c42d6042aebb1723ce6bac6f0216ff8c5d4f9f013008b"
response = eth_2_key_manager.delete_gas_limit.sync_detailed(pubkey=pubkey)
if response.status_code == 204:
    print("Gas limit deleted successfully")
else:
    print(f"Gas limit deletion failed with status code: {response.status_code}")
assert response.status_code == 204
Typical usage example - asynchronous
import eth_2_key_manager_api_client

eth_2_key_manager = eth_2_key_manager_api_client.Eth2KeyManager()
pubkey = "0x99c4c42fac7d1393956bd9e2785ed67cf5aaca4bf56d2fcda94c42d6042aebb1723ce6bac6f0216ff8c5d4f9f013008b"
response = await eth_2_key_manager.delete_gas_limit.asyncio_detailed(pubkey=pubkey)
if response.status_code == 204:
    print("Gas limit deleted successfully")
else:
    print(f"Gas limit deletion failed with status code: {response.status_code}")
assert response.status_code == 204
Source code in eth_2_key_manager_api_client/api/gas_limit.py
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
@attr.s(auto_attribs=True)
class DeleteGasLimit:
    """Contains methods for accessing the DELETE method of the /eth/v1/validator/{pubkey}/gas_limit endpoint.

    The endpoint returns the following HTTP status code if successful:
        - 204: No Content

    Typical usage example - synchronous:
        ```python
        import eth_2_key_manager_api_client

        eth_2_key_manager = eth_2_key_manager_api_client.Eth2KeyManager()
        pubkey = "0x99c4c42fac7d1393956bd9e2785ed67cf5aaca4bf56d2fcda94c42d6042aebb1723ce6bac6f0216ff8c5d4f9f013008b"
        response = eth_2_key_manager.delete_gas_limit.sync_detailed(pubkey=pubkey)
        if response.status_code == 204:
            print("Gas limit deleted successfully")
        else:
            print(f"Gas limit deletion failed with status code: {response.status_code}")
        assert response.status_code == 204
        ```

    Typical usage example - asynchronous:
        ```python
        import eth_2_key_manager_api_client

        eth_2_key_manager = eth_2_key_manager_api_client.Eth2KeyManager()
        pubkey = "0x99c4c42fac7d1393956bd9e2785ed67cf5aaca4bf56d2fcda94c42d6042aebb1723ce6bac6f0216ff8c5d4f9f013008b"
        response = await eth_2_key_manager.delete_gas_limit.asyncio_detailed(pubkey=pubkey)
        if response.status_code == 204:
            print("Gas limit deleted successfully")
        else:
            print(f"Gas limit deletion failed with status code: {response.status_code}")
        assert response.status_code == 204
        ```
    """

    client: AuthenticatedClient
    METHOD: str = "DELETE"

    def sync_detailed(
        self,
        pubkey: str,
    ) -> Response[Union[Any, ErrorResponse]]:
        """Delete Configured Gas Limit (synchronous).

        Delete a configured gas limit for the specified public key.

        The server may return a 400 status code if no external builder is configured.

        Args:
            pubkey: The validator's BLS public key, uniquely identifying them. _48-bytes, hex
                encoded with 0x prefix, case insensitive._
                Example: 0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1c
                fe39b56f43611df74a.

        Raises:
            errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
            httpx.TimeoutException: If the request takes longer than Client.timeout.

        Returns:
            Response object containing the response from the server, response headers and status code.
        """

        kwargs = _get_kwargs(client=self.client, endpoint=f"validator/{pubkey}/gas_limit", method=self.METHOD)

        response = httpx.request(
            verify=self.client.verify_ssl,
            **kwargs,
        )

        return _build_response(client=self.client, response=response)

    def sync(
        self,
        pubkey: str,
    ) -> Optional[Union[Any, ErrorResponse]]:
        """Delete Configured Gas Limit (synchronous).

        Delete a configured gas limit for the specified public key.

        The server may return a 400 status code if no external builder is configured.

        Args:
            pubkey: The validator's BLS public key, uniquely identifying them. _48-bytes, hex
                encoded with 0x prefix, case insensitive._
                Example: 0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1c
                fe39b56f43611df74a.

        Raises:
            errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
            httpx.TimeoutException: If the request takes longer than Client.timeout.

        Returns:
            Parsed response from the server.
        """

        return self.sync_detailed(pubkey=pubkey).parsed

    async def asyncio_detailed(
        self,
        pubkey: str,
    ) -> Response[Union[Any, ErrorResponse]]:
        """Delete Configured Gas Limit (asynchronous).

        Delete a configured gas limit for the specified public key.

        The server may return a 400 status code if no external builder is configured.

        Args:
            pubkey: The validator's BLS public key, uniquely identifying them. _48-bytes, hex
                encoded with 0x prefix, case insensitive._
                Example: 0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1c
                fe39b56f43611df74a.

        Raises:
            errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
            httpx.TimeoutException: If the request takes longer than Client.timeout.

        Returns:
            Response object containing the response from the server, response headers and status code.
        """

        kwargs = _get_kwargs(client=self.client, endpoint=f"validator/{pubkey}/gas_limit", method=self.METHOD)

        async with httpx.AsyncClient(verify=self.client.verify_ssl) as _client:
            response = await _client.request(**kwargs)

        return _build_response(client=self.client, response=response)

    async def asyncio(
        self,
        pubkey: str,
    ) -> Optional[Union[Any, ErrorResponse]]:
        """Delete Configured Gas Limit (asynchronous).

        Delete a configured gas limit for the specified public key.

        The server may return a 400 status code if no external builder is configured.

        Args:
            pubkey: The validator's BLS public key, uniquely identifying them. _48-bytes, hex
                encoded with 0x prefix, case insensitive._
                Example: 0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1c
                fe39b56f43611df74a.

        Raises:
            errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
            httpx.TimeoutException: If the request takes longer than Client.timeout.

        Returns:
            Parsed response from the server.
        """

        return (await self.asyncio_detailed(pubkey=pubkey)).parsed

asyncio(pubkey) async

Delete Configured Gas Limit (asynchronous).

Delete a configured gas limit for the specified public key.

The server may return a 400 status code if no external builder is configured.

Parameters:

Name Type Description Default
pubkey str

The validator's BLS public key, uniquely identifying them. 48-bytes, hex encoded with 0x prefix, case insensitive. Example: 0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1c fe39b56f43611df74a.

required

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Optional[Union[Any, ErrorResponse]]

Parsed response from the server.

Source code in eth_2_key_manager_api_client/api/gas_limit.py
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
async def asyncio(
    self,
    pubkey: str,
) -> Optional[Union[Any, ErrorResponse]]:
    """Delete Configured Gas Limit (asynchronous).

    Delete a configured gas limit for the specified public key.

    The server may return a 400 status code if no external builder is configured.

    Args:
        pubkey: The validator's BLS public key, uniquely identifying them. _48-bytes, hex
            encoded with 0x prefix, case insensitive._
            Example: 0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1c
            fe39b56f43611df74a.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Parsed response from the server.
    """

    return (await self.asyncio_detailed(pubkey=pubkey)).parsed

asyncio_detailed(pubkey) async

Delete Configured Gas Limit (asynchronous).

Delete a configured gas limit for the specified public key.

The server may return a 400 status code if no external builder is configured.

Parameters:

Name Type Description Default
pubkey str

The validator's BLS public key, uniquely identifying them. 48-bytes, hex encoded with 0x prefix, case insensitive. Example: 0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1c fe39b56f43611df74a.

required

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Response[Union[Any, ErrorResponse]]

Response object containing the response from the server, response headers and status code.

Source code in eth_2_key_manager_api_client/api/gas_limit.py
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
async def asyncio_detailed(
    self,
    pubkey: str,
) -> Response[Union[Any, ErrorResponse]]:
    """Delete Configured Gas Limit (asynchronous).

    Delete a configured gas limit for the specified public key.

    The server may return a 400 status code if no external builder is configured.

    Args:
        pubkey: The validator's BLS public key, uniquely identifying them. _48-bytes, hex
            encoded with 0x prefix, case insensitive._
            Example: 0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1c
            fe39b56f43611df74a.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response object containing the response from the server, response headers and status code.
    """

    kwargs = _get_kwargs(client=self.client, endpoint=f"validator/{pubkey}/gas_limit", method=self.METHOD)

    async with httpx.AsyncClient(verify=self.client.verify_ssl) as _client:
        response = await _client.request(**kwargs)

    return _build_response(client=self.client, response=response)

sync(pubkey)

Delete Configured Gas Limit (synchronous).

Delete a configured gas limit for the specified public key.

The server may return a 400 status code if no external builder is configured.

Parameters:

Name Type Description Default
pubkey str

The validator's BLS public key, uniquely identifying them. 48-bytes, hex encoded with 0x prefix, case insensitive. Example: 0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1c fe39b56f43611df74a.

required

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Optional[Union[Any, ErrorResponse]]

Parsed response from the server.

Source code in eth_2_key_manager_api_client/api/gas_limit.py
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
def sync(
    self,
    pubkey: str,
) -> Optional[Union[Any, ErrorResponse]]:
    """Delete Configured Gas Limit (synchronous).

    Delete a configured gas limit for the specified public key.

    The server may return a 400 status code if no external builder is configured.

    Args:
        pubkey: The validator's BLS public key, uniquely identifying them. _48-bytes, hex
            encoded with 0x prefix, case insensitive._
            Example: 0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1c
            fe39b56f43611df74a.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Parsed response from the server.
    """

    return self.sync_detailed(pubkey=pubkey).parsed

sync_detailed(pubkey)

Delete Configured Gas Limit (synchronous).

Delete a configured gas limit for the specified public key.

The server may return a 400 status code if no external builder is configured.

Parameters:

Name Type Description Default
pubkey str

The validator's BLS public key, uniquely identifying them. 48-bytes, hex encoded with 0x prefix, case insensitive. Example: 0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1c fe39b56f43611df74a.

required

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Response[Union[Any, ErrorResponse]]

Response object containing the response from the server, response headers and status code.

Source code in eth_2_key_manager_api_client/api/gas_limit.py
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
def sync_detailed(
    self,
    pubkey: str,
) -> Response[Union[Any, ErrorResponse]]:
    """Delete Configured Gas Limit (synchronous).

    Delete a configured gas limit for the specified public key.

    The server may return a 400 status code if no external builder is configured.

    Args:
        pubkey: The validator's BLS public key, uniquely identifying them. _48-bytes, hex
            encoded with 0x prefix, case insensitive._
            Example: 0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1c
            fe39b56f43611df74a.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response object containing the response from the server, response headers and status code.
    """

    kwargs = _get_kwargs(client=self.client, endpoint=f"validator/{pubkey}/gas_limit", method=self.METHOD)

    response = httpx.request(
        verify=self.client.verify_ssl,
        **kwargs,
    )

    return _build_response(client=self.client, response=response)

GetGasLimit

Contains methods for accessing the GET method of the /eth/v1/validator/{pubkey}/gas_limit endpoint.

The endpoint returns the following HTTP status code if successful
  • 200: OK
Typical usage example
import eth_2_key_manager_api_client

eth_2_key_manager = eth_2_key_manager_api_client.Eth2KeyManager()
pubkey = "0x99c4c42fac7d1393956bd9e2785ed67cf5aaca4bf56d2fcda94c42d6042aebb1723ce6bac6f0216ff8c5d4f9f013008b"
response = eth_2_key_manager.get_gas_limit.sync_detailed(pubkey=pubkey)
if response.status_code == 200:
    print(f"Gas limit for pubkey {pubkey} is {response.parsed.data.gas_limit}")
else:
    print(f"Gas limit listing failed with status code: {response.status_code}")
assert response.status_code == 200
Typical usage example - asynchronous
import eth_2_key_manager_api_client

eth_2_key_manager = eth_2_key_manager_api_client.Eth2KeyManager()
pubkey = "0x99c4c42fac7d1393956bd9e2785ed67cf5aaca4bf56d2fcda94c42d6042aebb1723ce6bac6f0216ff8c5d4f9f013008b"
response = await eth_2_key_manager.get_gas_limit.asyncio_detailed(pubkey=pubkey)
if response.status_code == 200:
    print(f"Gas limit for pubkey {pubkey} is {response.parsed.data.gas_limit}")
else:
    print(f"Gas limit listing failed with status code: {response.status_code}")
assert response.status_code == 200
Source code in eth_2_key_manager_api_client/api/gas_limit.py
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
@attr.s(auto_attribs=True)
class GetGasLimit:

    """Contains methods for accessing the GET method of the /eth/v1/validator/{pubkey}/gas_limit endpoint.

    The endpoint returns the following HTTP status code if successful:
        - 200: OK

    Typical usage example:
        ```python
        import eth_2_key_manager_api_client

        eth_2_key_manager = eth_2_key_manager_api_client.Eth2KeyManager()
        pubkey = "0x99c4c42fac7d1393956bd9e2785ed67cf5aaca4bf56d2fcda94c42d6042aebb1723ce6bac6f0216ff8c5d4f9f013008b"
        response = eth_2_key_manager.get_gas_limit.sync_detailed(pubkey=pubkey)
        if response.status_code == 200:
            print(f"Gas limit for pubkey {pubkey} is {response.parsed.data.gas_limit}")
        else:
            print(f"Gas limit listing failed with status code: {response.status_code}")
        assert response.status_code == 200
        ```

    Typical usage example - asynchronous:
        ```python
        import eth_2_key_manager_api_client

        eth_2_key_manager = eth_2_key_manager_api_client.Eth2KeyManager()
        pubkey = "0x99c4c42fac7d1393956bd9e2785ed67cf5aaca4bf56d2fcda94c42d6042aebb1723ce6bac6f0216ff8c5d4f9f013008b"
        response = await eth_2_key_manager.get_gas_limit.asyncio_detailed(pubkey=pubkey)
        if response.status_code == 200:
            print(f"Gas limit for pubkey {pubkey} is {response.parsed.data.gas_limit}")
        else:
            print(f"Gas limit listing failed with status code: {response.status_code}")
        assert response.status_code == 200
        ```
    """

    client: AuthenticatedClient
    METHOD: str = "GET"

    def sync_detailed(
        self,
        pubkey: str,
    ) -> Response[Union[ErrorResponse, ListGasLimitResponse]]:
        """Get Gas Limit (synchronous).

        Get the execution gas limit for an individual validator. This gas limit is the one used by the
        validator when proposing blocks via an external builder. If no limit has been set explicitly for
        a key then the process-wide default will be returned.

        The server may return a 400 status code if no external builder is configured.

        WARNING: The gas_limit is not used on Phase0 or Altair networks.

        Args:
            pubkey: The validator's BLS public key, uniquely identifying them. _48-bytes, hex
                encoded with 0x prefix, case insensitive._
                Example: 0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1c
                fe39b56f43611df74a.

        Raises:
            errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
            httpx.TimeoutException: If the request takes longer than Client.timeout.

        Returns:
            Response object containing the response from the server, response headers and status code.
        """

        kwargs = _get_kwargs(client=self.client, endpoint=f"validator/{pubkey}/gas_limit", method=self.METHOD)

        response = httpx.request(
            verify=self.client.verify_ssl,
            **kwargs,
        )

        return _build_response(client=self.client, response=response, cls=ListGasLimitResponse)

    def sync(
        self,
        pubkey: str,
    ) -> Optional[Union[ErrorResponse, ListGasLimitResponse]]:
        """Get Gas Limit (synchronous).

        Get the execution gas limit for an individual validator. This gas limit is the one used by the
        validator when proposing blocks via an external builder. If no limit has been set explicitly for
        a key then the process-wide default will be returned.

        The server may return a 400 status code if no external builder is configured.

        WARNING: The gas_limit is not used on Phase0 or Altair networks.

        Args:
            pubkey: The validator's BLS public key, uniquely identifying them. _48-bytes, hex
                encoded with 0x prefix, case insensitive._
                Example: 0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1c
                fe39b56f43611df74a.

        Raises:
            errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
            httpx.TimeoutException: If the request takes longer than Client.timeout.

        Returns:
            Parsed response from the server.
        """

        return self.sync_detailed(
            pubkey=pubkey,
        ).parsed

    async def asyncio_detailed(
        self,
        pubkey: str,
    ) -> Response[Union[ErrorResponse, ListGasLimitResponse]]:
        """Get Gas Limit (asynchronous).

        Get the execution gas limit for an individual validator. This gas limit is the one used by the
        validator when proposing blocks via an external builder. If no limit has been set explicitly for
        a key then the process-wide default will be returned.

        The server may return a 400 status code if no external builder is configured.

        WARNING: The gas_limit is not used on Phase0 or Altair networks.

        Args:
            pubkey: The validator's BLS public key, uniquely identifying them. _48-bytes, hex
                encoded with 0x prefix, case insensitive._
                Example: 0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1c
                fe39b56f43611df74a.

        Raises:
            errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
            httpx.TimeoutException: If the request takes longer than Client.timeout.

        Returns:
            Response object containing the response from the server, response headers and status code.
        """

        kwargs = _get_kwargs(client=self.client, endpoint=f"validator/{pubkey}/gas_limit", method=self.METHOD)

        async with httpx.AsyncClient(verify=self.client.verify_ssl) as _client:
            response = await _client.request(**kwargs)

        return _build_response(client=self.client, response=response, cls=ListGasLimitResponse)

    async def asyncio(
        self,
        pubkey: str,
    ) -> Optional[Union[ErrorResponse, ListGasLimitResponse]]:
        """Get Gas Limit (asynchronous).

        Get the execution gas limit for an individual validator. This gas limit is the one used by the
        validator when proposing blocks via an external builder. If no limit has been set explicitly for
        a key then the process-wide default will be returned.

        The server may return a 400 status code if no external builder is configured.

        WARNING: The gas_limit is not used on Phase0 or Altair networks.

        Args:
            pubkey: The validator's BLS public key, uniquely identifying them. _48-bytes, hex
                encoded with 0x prefix, case insensitive._
                Example: 0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1c
                fe39b56f43611df74a.

        Raises:
            errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
            httpx.TimeoutException: If the request takes longer than Client.timeout.

        Returns:
            Parsed response from the server.
        """

        return (await self.asyncio_detailed(pubkey=pubkey)).parsed

asyncio(pubkey) async

Get Gas Limit (asynchronous).

Get the execution gas limit for an individual validator. This gas limit is the one used by the validator when proposing blocks via an external builder. If no limit has been set explicitly for a key then the process-wide default will be returned.

The server may return a 400 status code if no external builder is configured.

WARNING: The gas_limit is not used on Phase0 or Altair networks.

Parameters:

Name Type Description Default
pubkey str

The validator's BLS public key, uniquely identifying them. 48-bytes, hex encoded with 0x prefix, case insensitive. Example: 0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1c fe39b56f43611df74a.

required

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Optional[Union[ErrorResponse, ListGasLimitResponse]]

Parsed response from the server.

Source code in eth_2_key_manager_api_client/api/gas_limit.py
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
async def asyncio(
    self,
    pubkey: str,
) -> Optional[Union[ErrorResponse, ListGasLimitResponse]]:
    """Get Gas Limit (asynchronous).

    Get the execution gas limit for an individual validator. This gas limit is the one used by the
    validator when proposing blocks via an external builder. If no limit has been set explicitly for
    a key then the process-wide default will be returned.

    The server may return a 400 status code if no external builder is configured.

    WARNING: The gas_limit is not used on Phase0 or Altair networks.

    Args:
        pubkey: The validator's BLS public key, uniquely identifying them. _48-bytes, hex
            encoded with 0x prefix, case insensitive._
            Example: 0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1c
            fe39b56f43611df74a.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Parsed response from the server.
    """

    return (await self.asyncio_detailed(pubkey=pubkey)).parsed

asyncio_detailed(pubkey) async

Get Gas Limit (asynchronous).

Get the execution gas limit for an individual validator. This gas limit is the one used by the validator when proposing blocks via an external builder. If no limit has been set explicitly for a key then the process-wide default will be returned.

The server may return a 400 status code if no external builder is configured.

WARNING: The gas_limit is not used on Phase0 or Altair networks.

Parameters:

Name Type Description Default
pubkey str

The validator's BLS public key, uniquely identifying them. 48-bytes, hex encoded with 0x prefix, case insensitive. Example: 0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1c fe39b56f43611df74a.

required

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Response[Union[ErrorResponse, ListGasLimitResponse]]

Response object containing the response from the server, response headers and status code.

Source code in eth_2_key_manager_api_client/api/gas_limit.py
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
async def asyncio_detailed(
    self,
    pubkey: str,
) -> Response[Union[ErrorResponse, ListGasLimitResponse]]:
    """Get Gas Limit (asynchronous).

    Get the execution gas limit for an individual validator. This gas limit is the one used by the
    validator when proposing blocks via an external builder. If no limit has been set explicitly for
    a key then the process-wide default will be returned.

    The server may return a 400 status code if no external builder is configured.

    WARNING: The gas_limit is not used on Phase0 or Altair networks.

    Args:
        pubkey: The validator's BLS public key, uniquely identifying them. _48-bytes, hex
            encoded with 0x prefix, case insensitive._
            Example: 0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1c
            fe39b56f43611df74a.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response object containing the response from the server, response headers and status code.
    """

    kwargs = _get_kwargs(client=self.client, endpoint=f"validator/{pubkey}/gas_limit", method=self.METHOD)

    async with httpx.AsyncClient(verify=self.client.verify_ssl) as _client:
        response = await _client.request(**kwargs)

    return _build_response(client=self.client, response=response, cls=ListGasLimitResponse)

sync(pubkey)

Get Gas Limit (synchronous).

Get the execution gas limit for an individual validator. This gas limit is the one used by the validator when proposing blocks via an external builder. If no limit has been set explicitly for a key then the process-wide default will be returned.

The server may return a 400 status code if no external builder is configured.

WARNING: The gas_limit is not used on Phase0 or Altair networks.

Parameters:

Name Type Description Default
pubkey str

The validator's BLS public key, uniquely identifying them. 48-bytes, hex encoded with 0x prefix, case insensitive. Example: 0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1c fe39b56f43611df74a.

required

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Optional[Union[ErrorResponse, ListGasLimitResponse]]

Parsed response from the server.

Source code in eth_2_key_manager_api_client/api/gas_limit.py
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
def sync(
    self,
    pubkey: str,
) -> Optional[Union[ErrorResponse, ListGasLimitResponse]]:
    """Get Gas Limit (synchronous).

    Get the execution gas limit for an individual validator. This gas limit is the one used by the
    validator when proposing blocks via an external builder. If no limit has been set explicitly for
    a key then the process-wide default will be returned.

    The server may return a 400 status code if no external builder is configured.

    WARNING: The gas_limit is not used on Phase0 or Altair networks.

    Args:
        pubkey: The validator's BLS public key, uniquely identifying them. _48-bytes, hex
            encoded with 0x prefix, case insensitive._
            Example: 0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1c
            fe39b56f43611df74a.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Parsed response from the server.
    """

    return self.sync_detailed(
        pubkey=pubkey,
    ).parsed

sync_detailed(pubkey)

Get Gas Limit (synchronous).

Get the execution gas limit for an individual validator. This gas limit is the one used by the validator when proposing blocks via an external builder. If no limit has been set explicitly for a key then the process-wide default will be returned.

The server may return a 400 status code if no external builder is configured.

WARNING: The gas_limit is not used on Phase0 or Altair networks.

Parameters:

Name Type Description Default
pubkey str

The validator's BLS public key, uniquely identifying them. 48-bytes, hex encoded with 0x prefix, case insensitive. Example: 0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1c fe39b56f43611df74a.

required

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Response[Union[ErrorResponse, ListGasLimitResponse]]

Response object containing the response from the server, response headers and status code.

Source code in eth_2_key_manager_api_client/api/gas_limit.py
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
def sync_detailed(
    self,
    pubkey: str,
) -> Response[Union[ErrorResponse, ListGasLimitResponse]]:
    """Get Gas Limit (synchronous).

    Get the execution gas limit for an individual validator. This gas limit is the one used by the
    validator when proposing blocks via an external builder. If no limit has been set explicitly for
    a key then the process-wide default will be returned.

    The server may return a 400 status code if no external builder is configured.

    WARNING: The gas_limit is not used on Phase0 or Altair networks.

    Args:
        pubkey: The validator's BLS public key, uniquely identifying them. _48-bytes, hex
            encoded with 0x prefix, case insensitive._
            Example: 0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1c
            fe39b56f43611df74a.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response object containing the response from the server, response headers and status code.
    """

    kwargs = _get_kwargs(client=self.client, endpoint=f"validator/{pubkey}/gas_limit", method=self.METHOD)

    response = httpx.request(
        verify=self.client.verify_ssl,
        **kwargs,
    )

    return _build_response(client=self.client, response=response, cls=ListGasLimitResponse)

SetGasLimit

Contains methods for accessing the POST method of the /eth/v1/validator/{pubkey}/gas_limit endpoint.

The endpoint returns the following HTTP status code if successful
  • 202: Accepted
Typical usage example - synchronous
import eth_2_key_manager_api_client

eth_2_key_manager = eth_2_key_manager_api_client.Eth2KeyManager()
pubkey = "0x99c4c42fac7d1393956bd9e2785ed67cf5aaca4bf56d2fcda94c42d6042aebb1723ce6bac6f0216ff8c5d4f9f013008b"
response = eth_2_key_manager.set_gas_limit.sync_detailed(pubkey=pubkey, gas_limit="999999")
if response.status_code == 202:
    print("Gas limit set successfully")
else:
    print(f"Gas limit set failed with status code: {response.status_code}")
assert response.status_code == 202
Typical usage example - asynchronous
import eth_2_key_manager_api_client

eth_2_key_manager = eth_2_key_manager_api_client.Eth2KeyManager()
pubkey = "0x99c4c42fac7d1393956bd9e2785ed67cf5aaca4bf56d2fcda94c42d6042aebb1723ce6bac6f0216ff8c5d4f9f013008b"
response = await eth_2_key_manager.set_gas_limit.asyncio_detailed(pubkey=pubkey, gas_limit="999999")
if response.status_code == 202:
    print("Gas limit set successfully")
else:
    print(f"Gas limit set failed with status code: {response.status_code}")
assert response.status_code == 202
Source code in eth_2_key_manager_api_client/api/gas_limit.py
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
@attr.s(auto_attribs=True)
class SetGasLimit:
    """Contains methods for accessing the POST method of the /eth/v1/validator/{pubkey}/gas_limit endpoint.

    The endpoint returns the following HTTP status code if successful:
        - 202: Accepted

    Typical usage example - synchronous:
        ```python
        import eth_2_key_manager_api_client

        eth_2_key_manager = eth_2_key_manager_api_client.Eth2KeyManager()
        pubkey = "0x99c4c42fac7d1393956bd9e2785ed67cf5aaca4bf56d2fcda94c42d6042aebb1723ce6bac6f0216ff8c5d4f9f013008b"
        response = eth_2_key_manager.set_gas_limit.sync_detailed(pubkey=pubkey, gas_limit="999999")
        if response.status_code == 202:
            print("Gas limit set successfully")
        else:
            print(f"Gas limit set failed with status code: {response.status_code}")
        assert response.status_code == 202
        ```

    Typical usage example - asynchronous:
        ```python
        import eth_2_key_manager_api_client

        eth_2_key_manager = eth_2_key_manager_api_client.Eth2KeyManager()
        pubkey = "0x99c4c42fac7d1393956bd9e2785ed67cf5aaca4bf56d2fcda94c42d6042aebb1723ce6bac6f0216ff8c5d4f9f013008b"
        response = await eth_2_key_manager.set_gas_limit.asyncio_detailed(pubkey=pubkey, gas_limit="999999")
        if response.status_code == 202:
            print("Gas limit set successfully")
        else:
            print(f"Gas limit set failed with status code: {response.status_code}")
        assert response.status_code == 202
        ```
    """

    client: AuthenticatedClient
    METHOD: str = "POST"

    def sync_detailed(self, pubkey: str, gas_limit: str) -> Response[Union[Any, ErrorResponse]]:
        """Set Gas Limit (synchronous).

        Set the gas limit for an individual validator. This limit will be propagated to the beacon
        node for use on future block proposals. The beacon node is responsible for informing external
        block builders of the change.

        The server may return a 400 status code if no external builder is configured.

        WARNING: The gas_limit is not used on Phase0 or Altair networks.

        Args:
            pubkey: The validator's BLS public key, uniquely identifying them. _48-bytes, hex
                encoded with 0x prefix, case insensitive._
                Example: 0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1c
                fe39b56f43611df74a.
            gas_limit: The gas limit to set for the validator as string.

        Raises:
            errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
            httpx.TimeoutException: If the request takes longer than Client.timeout.

        Returns:
            Response object containing the response from the server, response headers and status code.
        """

        json_body = SetGasLimitRequest(gas_limit=gas_limit)

        kwargs = _get_kwargs(
            client=self.client,
            endpoint=f"validator/{pubkey}/gas_limit",
            method=self.METHOD,
            json_body=json_body,
        )

        response = httpx.request(
            verify=self.client.verify_ssl,
            **kwargs,
        )

        return _build_response(client=self.client, response=response)

    def sync(self, pubkey: str, gas_limit: str) -> Optional[Union[Any, ErrorResponse]]:
        """Set Gas Limit (synchronous).

        Set the gas limit for an individual validator. This limit will be propagated to the beacon
        node for use on future block proposals. The beacon node is responsible for informing external
        block builders of the change.

        The server may return a 400 status code if no external builder is configured.

        WARNING: The gas_limit is not used on Phase0 or Altair networks.

        Args:
            pubkey: The validator's BLS public key, uniquely identifying them. _48-bytes, hex
                encoded with 0x prefix, case insensitive._
                Example: 0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1c
                fe39b56f43611df74a.
            gas_limit: The gas limit to set for the validator as string.

        Raises:
            errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
            httpx.TimeoutException: If the request takes longer than Client.timeout.

        Returns:
            Parsed response from the server.
        """

        return self.sync_detailed(pubkey=pubkey, gas_limit=gas_limit).parsed

    async def asyncio_detailed(self, pubkey: str, gas_limit: str) -> Response[Union[Any, ErrorResponse]]:
        """Set Gas Limit (asynchronous).

        Set the gas limit for an individual validator. This limit will be propagated to the beacon
        node for use on future block proposals. The beacon node is responsible for informing external
        block builders of the change.

        The server may return a 400 status code if no external builder is configured.

        WARNING: The gas_limit is not used on Phase0 or Altair networks.

        Args:
            pubkey: The validator's BLS public key, uniquely identifying them. _48-bytes, hex
                encoded with 0x prefix, case insensitive._
                Example: 0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1c
                fe39b56f43611df74a.
            gas_limit: The gas limit to set for the validator as string.

        Raises:
            errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
            httpx.TimeoutException: If the request takes longer than Client.timeout.

        Returns:
            Response object containing the response from the server, response headers and status code.
        """

        json_body = SetGasLimitRequest(gas_limit=gas_limit)

        kwargs = _get_kwargs(
            client=self.client,
            endpoint=f"validator/{pubkey}/gas_limit",
            method=self.METHOD,
            json_body=json_body,
        )

        async with httpx.AsyncClient(verify=self.client.verify_ssl) as _client:
            response = await _client.request(**kwargs)

        return _build_response(client=self.client, response=response)

    async def asyncio(self, pubkey: str, gas_limit: str) -> Optional[Union[Any, ErrorResponse]]:
        """Set Gas Limit (asynchronous).

        Set the gas limit for an individual validator. This limit will be propagated to the beacon
        node for use on future block proposals. The beacon node is responsible for informing external
        block builders of the change.

        The server may return a 400 status code if no external builder is configured.

        WARNING: The gas_limit is not used on Phase0 or Altair networks.

        Args:
            pubkey: The validator's BLS public key, uniquely identifying them. _48-bytes, hex
                encoded with 0x prefix, case insensitive._
                Example: 0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1c
                fe39b56f43611df74a.
            gas_limit: The gas limit to set for the validator as string.

        Raises:
            errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
            httpx.TimeoutException: If the request takes longer than Client.timeout.

        Returns:
            Parsed response from the server.
        """

        return (await self.asyncio_detailed(pubkey=pubkey, gas_limit=gas_limit)).parsed

asyncio(pubkey, gas_limit) async

Set Gas Limit (asynchronous).

Set the gas limit for an individual validator. This limit will be propagated to the beacon node for use on future block proposals. The beacon node is responsible for informing external block builders of the change.

The server may return a 400 status code if no external builder is configured.

WARNING: The gas_limit is not used on Phase0 or Altair networks.

Parameters:

Name Type Description Default
pubkey str

The validator's BLS public key, uniquely identifying them. 48-bytes, hex encoded with 0x prefix, case insensitive. Example: 0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1c fe39b56f43611df74a.

required
gas_limit str

The gas limit to set for the validator as string.

required

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Optional[Union[Any, ErrorResponse]]

Parsed response from the server.

Source code in eth_2_key_manager_api_client/api/gas_limit.py
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
async def asyncio(self, pubkey: str, gas_limit: str) -> Optional[Union[Any, ErrorResponse]]:
    """Set Gas Limit (asynchronous).

    Set the gas limit for an individual validator. This limit will be propagated to the beacon
    node for use on future block proposals. The beacon node is responsible for informing external
    block builders of the change.

    The server may return a 400 status code if no external builder is configured.

    WARNING: The gas_limit is not used on Phase0 or Altair networks.

    Args:
        pubkey: The validator's BLS public key, uniquely identifying them. _48-bytes, hex
            encoded with 0x prefix, case insensitive._
            Example: 0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1c
            fe39b56f43611df74a.
        gas_limit: The gas limit to set for the validator as string.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Parsed response from the server.
    """

    return (await self.asyncio_detailed(pubkey=pubkey, gas_limit=gas_limit)).parsed

asyncio_detailed(pubkey, gas_limit) async

Set Gas Limit (asynchronous).

Set the gas limit for an individual validator. This limit will be propagated to the beacon node for use on future block proposals. The beacon node is responsible for informing external block builders of the change.

The server may return a 400 status code if no external builder is configured.

WARNING: The gas_limit is not used on Phase0 or Altair networks.

Parameters:

Name Type Description Default
pubkey str

The validator's BLS public key, uniquely identifying them. 48-bytes, hex encoded with 0x prefix, case insensitive. Example: 0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1c fe39b56f43611df74a.

required
gas_limit str

The gas limit to set for the validator as string.

required

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Response[Union[Any, ErrorResponse]]

Response object containing the response from the server, response headers and status code.

Source code in eth_2_key_manager_api_client/api/gas_limit.py
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
async def asyncio_detailed(self, pubkey: str, gas_limit: str) -> Response[Union[Any, ErrorResponse]]:
    """Set Gas Limit (asynchronous).

    Set the gas limit for an individual validator. This limit will be propagated to the beacon
    node for use on future block proposals. The beacon node is responsible for informing external
    block builders of the change.

    The server may return a 400 status code if no external builder is configured.

    WARNING: The gas_limit is not used on Phase0 or Altair networks.

    Args:
        pubkey: The validator's BLS public key, uniquely identifying them. _48-bytes, hex
            encoded with 0x prefix, case insensitive._
            Example: 0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1c
            fe39b56f43611df74a.
        gas_limit: The gas limit to set for the validator as string.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response object containing the response from the server, response headers and status code.
    """

    json_body = SetGasLimitRequest(gas_limit=gas_limit)

    kwargs = _get_kwargs(
        client=self.client,
        endpoint=f"validator/{pubkey}/gas_limit",
        method=self.METHOD,
        json_body=json_body,
    )

    async with httpx.AsyncClient(verify=self.client.verify_ssl) as _client:
        response = await _client.request(**kwargs)

    return _build_response(client=self.client, response=response)

sync(pubkey, gas_limit)

Set Gas Limit (synchronous).

Set the gas limit for an individual validator. This limit will be propagated to the beacon node for use on future block proposals. The beacon node is responsible for informing external block builders of the change.

The server may return a 400 status code if no external builder is configured.

WARNING: The gas_limit is not used on Phase0 or Altair networks.

Parameters:

Name Type Description Default
pubkey str

The validator's BLS public key, uniquely identifying them. 48-bytes, hex encoded with 0x prefix, case insensitive. Example: 0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1c fe39b56f43611df74a.

required
gas_limit str

The gas limit to set for the validator as string.

required

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Optional[Union[Any, ErrorResponse]]

Parsed response from the server.

Source code in eth_2_key_manager_api_client/api/gas_limit.py
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
def sync(self, pubkey: str, gas_limit: str) -> Optional[Union[Any, ErrorResponse]]:
    """Set Gas Limit (synchronous).

    Set the gas limit for an individual validator. This limit will be propagated to the beacon
    node for use on future block proposals. The beacon node is responsible for informing external
    block builders of the change.

    The server may return a 400 status code if no external builder is configured.

    WARNING: The gas_limit is not used on Phase0 or Altair networks.

    Args:
        pubkey: The validator's BLS public key, uniquely identifying them. _48-bytes, hex
            encoded with 0x prefix, case insensitive._
            Example: 0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1c
            fe39b56f43611df74a.
        gas_limit: The gas limit to set for the validator as string.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Parsed response from the server.
    """

    return self.sync_detailed(pubkey=pubkey, gas_limit=gas_limit).parsed

sync_detailed(pubkey, gas_limit)

Set Gas Limit (synchronous).

Set the gas limit for an individual validator. This limit will be propagated to the beacon node for use on future block proposals. The beacon node is responsible for informing external block builders of the change.

The server may return a 400 status code if no external builder is configured.

WARNING: The gas_limit is not used on Phase0 or Altair networks.

Parameters:

Name Type Description Default
pubkey str

The validator's BLS public key, uniquely identifying them. 48-bytes, hex encoded with 0x prefix, case insensitive. Example: 0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1c fe39b56f43611df74a.

required
gas_limit str

The gas limit to set for the validator as string.

required

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Response[Union[Any, ErrorResponse]]

Response object containing the response from the server, response headers and status code.

Source code in eth_2_key_manager_api_client/api/gas_limit.py
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
def sync_detailed(self, pubkey: str, gas_limit: str) -> Response[Union[Any, ErrorResponse]]:
    """Set Gas Limit (synchronous).

    Set the gas limit for an individual validator. This limit will be propagated to the beacon
    node for use on future block proposals. The beacon node is responsible for informing external
    block builders of the change.

    The server may return a 400 status code if no external builder is configured.

    WARNING: The gas_limit is not used on Phase0 or Altair networks.

    Args:
        pubkey: The validator's BLS public key, uniquely identifying them. _48-bytes, hex
            encoded with 0x prefix, case insensitive._
            Example: 0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1c
            fe39b56f43611df74a.
        gas_limit: The gas limit to set for the validator as string.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response object containing the response from the server, response headers and status code.
    """

    json_body = SetGasLimitRequest(gas_limit=gas_limit)

    kwargs = _get_kwargs(
        client=self.client,
        endpoint=f"validator/{pubkey}/gas_limit",
        method=self.METHOD,
        json_body=json_body,
    )

    response = httpx.request(
        verify=self.client.verify_ssl,
        **kwargs,
    )

    return _build_response(client=self.client, response=response)