In most (all?) classical sources such as the book of Goldreich (2001), hard-core predicated are defined thus:
A polynomial-time computable predicate $b : \{0,1\}^* \to \{0,1\}$ is a hard-core of a function $f$ if for every probabilistic polynomial-time (PPT) algorithm $A$, every positive polynomial $p$ and all sufficiently large $n$, $$\mathsf{Pr}\left[A(f(U_n)) = b(U_n)\right] < \frac{1}{2} + \frac{1}{p(n)}.$$
However, in the more recent book of Katz and Lindell (2015 for the second edition), $A$ is also given $1^n$. This seems to make a difference, for example for the following exercise:
Show that any injective, polynomial-time computable function which has a hard-core predicate is one-way.
Under the Katz-Lindell definition of hard-core predicates, this is trivial: given a PPT adversary $A$ which can successfully invert such a function $f$, we construct a PPT adversary $B$ which can successfully compute any predicate $b$ for $f$ as follows. On input $(y, 1^n)$, $B$ runs $x' \gets A(y, 1^n)$ and outputs $b(x')$ if $f(x') = y$ and a random bit otherwise.
However, if $B$ is not given $1^n$, then it is not clear to me that it can determine in polynomial time the correct value of $n$ on which to run $A$. Goldreich also gives this exercise, but adds that "you may assume for simplicity that $f$ is length-preserving", which again makes it trivial.
In general, giving $1^n$ to the adversary seems to make the situation simpler, mainly because it makes the definition of hard-core predicates mirror that of one-way functions more closely, and if we assume (as is common) that $f$ is length-preserving, it is just redundant. I guess my question is: is there currently any consensus among researchers in this regard? Or are the two definitions actually equivalent (in which case I probably need to give in more thought...)?