Skip to content

Commit d564061

Browse files
authored
env: Decrease default GRAPH_MAX_IPFS_FILE_BYTES (#4669)
1 parent dc4def8 commit d564061

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

docs/environment-variables.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ those.
7070

7171
- `GRAPH_IPFS_TIMEOUT`: timeout for IPFS, which includes requests for manifest files
7272
and from mappings (in seconds, default is 60).
73-
- `GRAPH_MAX_IPFS_FILE_BYTES`: maximum size for a file that can be retrieved (in bytes, default is 256 MiB).
73+
- `GRAPH_MAX_IPFS_FILE_BYTES`: maximum size for a file that can be retrieved by an `ipfs cat` call.
74+
This affects both subgraph definition files and `file/ipfs` data sources. In bytes, default is 25 MiB.
7475
- `GRAPH_MAX_IPFS_MAP_FILE_SIZE`: maximum size of files that can be processed
7576
with `ipfs.map`. When a file is processed through `ipfs.map`, the entities
7677
generated from that are kept in memory until the entire file is done

graph/src/env/mappings.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub struct EnvVarsMapping {
4646
/// Sets the `ipfs.cat` file size limit.
4747
///
4848
/// Set by the environment variable `GRAPH_MAX_IPFS_FILE_BYTES` (expressed in
49-
/// bytes). Defaults to 256 MiB.
49+
/// bytes). Defaults to 25 MiB.
5050
pub max_ipfs_file_bytes: usize,
5151

5252
/// Limits per second requests to IPFS for file data sources.
@@ -110,7 +110,7 @@ pub struct InnerMappingHandlers {
110110
#[envconfig(from = "GRAPH_MAX_IPFS_MAP_FILE_SIZE", default = "")]
111111
max_ipfs_map_file_size: WithDefaultUsize<usize, { 256 * 1024 * 1024 }>,
112112
#[envconfig(from = "GRAPH_MAX_IPFS_FILE_BYTES", default = "")]
113-
max_ipfs_file_bytes: WithDefaultUsize<usize, { 256 * 1024 * 1024 }>,
113+
max_ipfs_file_bytes: WithDefaultUsize<usize, { 25 * 1024 * 1024 }>,
114114
#[envconfig(from = "GRAPH_IPFS_REQUEST_LIMIT", default = "100")]
115115
ipfs_request_limit: u16,
116116
#[envconfig(from = "GRAPH_ALLOW_NON_DETERMINISTIC_IPFS", default = "false")]

0 commit comments

Comments
 (0)